我得到一个错误:
InvalidDatetimeFormat: invalid input syntax for type date: "%Y-%m-%d" LINE 1: ...,12))) AND ("sale_order_line"."confirm_date" >= '%Y-%m-%d'...
我的向导代码是:
@api.multi
def export_xls(self):
context = self._context
datas = {'ids': context.get('active_ids', [])}
datas['model'] = 'wizard.stock.history'
tmp = self.read(['start_date', 'end_date'])
if len(tmp) > 0:
datas['form'] = tmp[0]
for field in datas['form'].keys():
if isinstance(datas['form'][field], tuple):
datas['form'][field] = datas['form'][field]
if context.get('xls_export'):
return self.env.ref('product_category_report.stock_xlsx').report_action(self, data=datas)
我的代码是:
sale_obj = self.env['sale.order.line'].search([('order_id.state', 'in', ('sale', 'done')),
('product_id', '=', product.id),
('order_id.warehouse_id', '=', warehouse),
('confirm_date', '>=', start_date),
('confirm_date', '<=', end_date)])
我在评估奥多v11的报告。但是在这个场景中,error
是这样发生的。我不知道为什么,我尝试了很多其他的方法,但是错误仍然存在
如果确认日期是日期时间字段,请使用下面的代码将开始日期和结束日期转换为日期时间
相关问题 更多 >
编程相关推荐