コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
3556 ビュー

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
3451
2
3月 21
28880
2
10月 22
9827
3
6月 22
12393
6
2月 25
53743