Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
3144 Widoki

@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

Awatar
Odrzuć
Najlepsza odpowiedź

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.

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
sty 25
1091
0
gru 15
3440
1
mar 15
5412
0
mar 15
3780
0
lip 25
218