[FIX] purchase: origin field on "procurement.order"

The field origin is not required in "procurement.order" and
trying to concat a string with a boolean raises a Type Error.

opw:670307
This commit is contained in:
Goffin Simon
2016-03-29 12:21:49 +02:00
parent c26fa293c8
commit 11d3aaf848
+4 -1
View File
@@ -898,7 +898,10 @@ class ProcurementOrder(models.Model):
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})
if procurement.origin:
po.write({'origin': po.origin + ', ' + procurement.origin})
else:
po.write({'origin': po.origin})
else:
po.write({'origin': procurement.origin})
res += po.ids