Skip to content

Commit

Permalink
[FIX] purchase: no mrp fields in purchase please
Browse files Browse the repository at this point in the history
Fields of mrp should not be put in purchase like this,
as it can throw a traceback e.g. if you generate a purchase
based on a picking in MTO.
  • Loading branch information
jco-odoo committed Jun 25, 2018
1 parent 752347c commit d4582cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addons/purchase/models/purchase.py
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,7 @@ def make_po(self):
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: <a href=# data-oe-model=procurement.order data-oe-id=%d>%s</a>") % (procurement.id, name)
po.message_post(body=message)
cache[domain] = po
Expand All @@ -1075,7 +1075,7 @@ def make_po(self):
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: <a href=# data-oe-model=procurement.order data-oe-id=%d>%s</a>") % (procurement.id, name)
po.message_post(body=message)
if po:
Expand Down

0 comments on commit d4582cf

Please sign in to comment.