diff --git a/addons/purchase/models/purchase.py b/addons/purchase/models/purchase.py index da83740a31f..e114915a0d7 100644 --- a/addons/purchase/models/purchase.py +++ b/addons/purchase/models/purchase.py @@ -1062,7 +1062,7 @@ class ProcurementOrder(models.Model): if not po: vals = procurement._prepare_purchase_order(partner) po = self.env['purchase.order'].create(vals) - name = (procurement.group_id and (procurement.group_id.name + ":") or "") + (procurement.name != "/" and procurement.name or procurement.move_dest_id.raw_material_production_id and procurement.move_dest_id.raw_material_production_id.name or "") + name = (procurement.group_id and (procurement.group_id.name + ":") or "") + (procurement.name != "/" and procurement.name or "") message = _("This purchase order has been created from: %s") % (procurement.id, name) po.message_post(body=message) cache[domain] = po @@ -1075,7 +1075,7 @@ class ProcurementOrder(models.Model): po.write({'origin': po.origin}) else: po.write({'origin': procurement.origin}) - name = (self.group_id and (self.group_id.name + ":") or "") + (self.name != "/" and self.name or self.move_dest_id.raw_material_production_id and self.move_dest_id.raw_material_production_id.name or "") + name = (self.group_id and (self.group_id.name + ":") or "") + (self.name != "/" and self.name or "") message = _("This purchase order has been modified from: %s") % (procurement.id, name) po.message_post(body=message) if po: