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

For the function which I wrote in a TransientModel I'm getting the below error:

line 499, in export_xls
    datas['form'] = self.read(['start_date', 'end_date'])[0]

The code is:


@api.multi
def export_xls(self):
    context = self._context
    datas = {'ids': context.get('active_ids', [])}
    datas['model'] = 'wizard.stock.history'
    datas['form'] = self.read(['start_date', 'end_date'])[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)

I'm taking stock report from odoo 11. For that purpose I have created a wizard and passing values. Now the error comes like this.

아바타
취소
베스트 답변


tmp = self.read(['start_date', 'end_date'])
if len(tmp) > 0:
  datas['form'] = tmp[0]
You're getting an empty result

    


아바타
취소
관련 게시물 답글 화면 활동
0
8월 19
3521
2
3월 21
28994
2
10월 22
9893
3
6월 22
12465
6
2월 25
53873