تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
3227 أدوات العرض

@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
يناير 25
1182
0
ديسمبر 15
3493
1
مارس 15
5455
0
مارس 15
3808
0
يوليو 25
260