Browse Source

[IMP] add product code in product name on PO creaption from CPO

pull/145/head
robinkeunen 7 years ago
committed by robin.keunen
parent
commit
b74fa7b4db
  1. 6
      compute_purchase_order/models/computed_purchase_order.py

6
compute_purchase_order/models/computed_purchase_order.py

@ -170,8 +170,12 @@ class ComputedPurchaseOrder(models.Model):
for cpo_line in self.order_line_ids: for cpo_line in self.order_line_ids:
if cpo_line.purchase_quantity > 0: if cpo_line.purchase_quantity > 0:
if cpo_line.supplierinfo_id.product_code:
pol_name = '[%s] %s' % (cpo_line.supplierinfo_id.product_code, cpo_line.name)
else:
pol_name = cpo_line.name
pol_values = { pol_values = {
'name': cpo_line.name,
'name': pol_name,
'product_id': cpo_line.get_default_product_product().id, 'product_id': cpo_line.get_default_product_product().id,
'product_qty': cpo_line.purchase_quantity, 'product_qty': cpo_line.purchase_quantity,
'price_unit': cpo_line.product_price, 'price_unit': cpo_line.product_price,

Loading…
Cancel
Save