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

@api.multi
    def action_open_product_wizard(self):
        context = {
            'product_id':self.product_id.id,

             'qty':self.qty,

             'line_id':self.id
            }
        return {
            'name': ('Batch Allocation'),
            'view_type':'form',
            'view_mode':'form',
            'res_model': 'batch.wise_allocation',
            'view_id':False,
            'type':'ir.actions.act_window',
            'target':'new',
            'context': context,
            }


#Something is wrong in the context it is not loading the desired fields

アバター
破棄
最善の回答

You have to prepend a default_ to the variable names in the context (qty -> default_qty), so that they will be taken as the default value for the wizard.

アバター
破棄
関連投稿 返信 ビュー 活動
0
1月 25
1001
0
12月 15
3372
1
3月 15
5296
0
3月 15
3656
0
10月 19
2722