콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다

I'm getting the error InvalidDatetimeFormat: invalid input syntax for type date: "%Y-%m-%d"

My code from wizard is below:

@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)

And my code from rendering is,
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)])

I was taking stock reports from the odoo v11. But in this scenario, the error is happening like this. I don't know why, I have tried in many other ways, still the error is there.

아바타
취소
관련 게시물 답글 화면 활동
1
12월 19
3673
2
3월 21
29008
2
10월 22
9897
3
6월 22
12489
6
2월 25
53911