File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
purchase_order_generator/models Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -127,9 +127,19 @@ def create_purchase_order(self):
127127 for cpo_line in self .pog_line_ids :
128128 if cpo_line .purchase_quantity > 0 :
129129 product = cpo_line .product_template_id .product_variant_id
130+
131+ # name definition copied from purchase/models/purchase.py:593
132+ product_lang = product .with_context (
133+ lang = purchase_order .partner_id .lang ,
134+ partner_id = purchase_order .partner_id .id ,
135+ )
136+ pol_name = product_lang .display_name
137+ if product_lang .description_purchase :
138+ pol_name += "\n " + product_lang .description_purchase
139+
130140 pol = self .env ["purchase.order.line" ].create (
131141 {
132- "name" : cpo_line . name ,
142+ "name" : pol_name ,
133143 "product_id" : product .id ,
134144 "product_qty" : cpo_line .purchase_quantity ,
135145 "price_unit" : cpo_line .product_price ,
@@ -138,7 +148,6 @@ def create_purchase_order(self):
138148 "date_planned" : self .date_planned ,
139149 }
140150 )
141- pol .onchange_product_id ()
142151 pol .compute_taxes_id ()
143152
144153 self .generated_purchase_order_ids += purchase_order
You can’t perform that action at this time.
0 commit comments