报废新生成的制造订单没关联新采购单

This commit is contained in:
guanhuan
2024-12-10 17:18:33 +08:00
parent e14e750bd9
commit 83e57b63ec

View File

@@ -1495,7 +1495,9 @@ class MrpProduction(models.Model):
def action_view_purchase_orders(self):
self.ensure_one()
if self.product_id.product_tmpl_id.single_manufacturing == True:
if self.is_remanufacture:
production = self
elif self.product_id.product_tmpl_id.single_manufacturing == True:
production = self.env['mrp.production'].search(
[('origin', '=', self.origin), ('product_id', '=', self.product_id.id)], limit=1, order='id asc')
else: