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

Only one product from the selected product pass to the sales order line form. 

What to do to get the whole product selected to the sales order form?

code:

    def create_sale_order(self):      

        return {           

                     'name': 'Create Sale Order',        

         'res_model': 'sale.order',           

                     'type': 'ir.actions.act_window',          

                     'context': {'default_order_line':(0,False,{'product_id':self.product_id.id}) },          

                     'view_type': 'form',

                     'view_mode': 'form',      

                     'views': [(self.env.ref('sale.view_order_form').id, 'form')],            

                     'view_id': self.env.ref('sale.view_order_form').id,            

                     'target': 'current',                }   

الصورة الرمزية
إهمال
أفضل إجابة

Before you start coding, please rethink your business logic. Adding multiple products per order line does not make sense for tax and accounting purposes. If you still think it should be necessary, your product definition is not correct.

الصورة الرمزية
إهمال