[FIX] purchase: keep track of all procurements

Keep track of all the procurements in the field "Source Document" of the
PO.

opw-654424
This commit is contained in:
Nicolas Martinelli
2015-11-25 16:10:40 +01:00
parent 39f8b5aff7
commit 4d8ddabe63
+6
View File
@@ -822,6 +822,12 @@ class ProcurementOrder(models.Model):
vals = procurement._prepare_purchase_order(partner)
po = self.env['purchase.order'].create(vals)
cache[domain] = po
elif not po.origin or procurement.origin not in po.origin.split(', '):
# Keep track of all procurements
if po.origin:
po.write({'origin': po.origin + ', ' + procurement.origin})
else:
po.write({'origin': procurement.origin})
res += po.ids
# Create Line