修复报废没有生成调拨单

This commit is contained in:
guanhuan
2025-01-08 10:58:56 +08:00
parent 9660392495
commit 4fc0eab513
6 changed files with 26 additions and 51 deletions

View File

@@ -1031,12 +1031,7 @@ class ReStockMove(models.Model):
"""
res = super(ReStockMove, self)._get_new_picking_values()
## 制造订单报废生成的新制造订单不走合并
production_remanufacture = None
if 'origin' in res:
if self.picking_type_id.name in ['生产发料', '内部调拨']:
production_remanufacture = self.env['mrp.production'].search(
[('name', '=', res['origin']), ('is_remanufacture', '=', True)])
if not production_remanufacture:
if not self.env.context.get('is_remanufacture_flag'):
if self[0].origin and self.picking_type_id.name in ['生产发料', '内部调拨']:
production = self.env['mrp.production'].search([('name', '=', self[0].origin)], limit=1, order='id asc')
productions = self.env['mrp.production'].search(