还原OCC代码

This commit is contained in:
jinling.yang
2024-08-21 14:43:22 +08:00
parent 7b2908defa
commit 6668e0ee2f
6 changed files with 15 additions and 17 deletions

View File

@@ -987,17 +987,20 @@ class MrpProduction(models.Model):
move = self.env['stock.move'].search([('origin', '=', productions.name)], order='id desc')
for mo in move:
print(mo.id)
if mo.name in ['/', '']:
if mo.procure_method == 'make_to_order' and mo.name != productions.name:
if mo.name == '/':
domain = [('barcode', '=', 'WH-PC'), ('sequence_code', '=', 'PC')]
elif mo.name == '':
domain = [('barcode', '=', 'WH-INTERNAL'), ('sequence_code', '=', 'INT')]
picking_type = self.env['stock.picking.type'].search(domain)
mo.picking_type_id = picking_type.id
mo.write({'picking_type_id': picking_type.id})
mo._assign_picking()
mo.reference = mo.picking_id.name
else:
mo.reference = productions.name
if mo.reference != productions.name:
mo.reference = productions.name
if mo.production_id:
if mo.production_id != productions:
mo.production_id = False
productions.write({'programming_no': self.programming_no, 'is_remanufacture': True})
productions.procurement_group_id.mrp_production_ids.move_dest_ids.write(
{'group_id': self.env['procurement.group'].search([('name', '=', sale_order.name)])})