Accept Merge Request #1550: (feature/修复制造订单问题 -> develop)
Merge Request: 修复制造订单问题-退回调整 Created By: @杨金灵 Reviewed By: @胡尧 Approved By: @胡尧 Accepted By: @杨金灵 URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1550
This commit is contained in:
@@ -1306,6 +1306,7 @@ class MrpProduction(models.Model):
|
|||||||
raise_user_error=not self.env.context.get('from_orderpoint'))
|
raise_user_error=not self.env.context.get('from_orderpoint'))
|
||||||
productions = self.env['mrp.production'].sudo().search(
|
productions = self.env['mrp.production'].sudo().search(
|
||||||
[('origin', '=', self.origin)], order='id desc', limit=1)
|
[('origin', '=', self.origin)], order='id desc', limit=1)
|
||||||
|
productions.write({'programming_no': self.programming_no, 'is_remanufacture': True})
|
||||||
move = self.env['stock.move'].search([('origin', '=', productions.name)], order='id desc')
|
move = self.env['stock.move'].search([('origin', '=', productions.name)], order='id desc')
|
||||||
for mo in move:
|
for mo in move:
|
||||||
domain = []
|
domain = []
|
||||||
@@ -1332,7 +1333,6 @@ class MrpProduction(models.Model):
|
|||||||
mo_move.write({'reference': sfp_move.reference, 'partner_id': sfp_move.partner_id.id,
|
mo_move.write({'reference': sfp_move.reference, 'partner_id': sfp_move.partner_id.id,
|
||||||
'picking_id': sfp_move.picking_id.id, 'picking_type_id': sfp_move.picking_type_id.id,
|
'picking_id': sfp_move.picking_id.id, 'picking_type_id': sfp_move.picking_type_id.id,
|
||||||
'production_id': False})
|
'production_id': False})
|
||||||
productions.write({'programming_no': self.programming_no, 'is_remanufacture': True})
|
|
||||||
# productions.procurement_group_id.mrp_production_ids.move_dest_ids.write(
|
# productions.procurement_group_id.mrp_production_ids.move_dest_ids.write(
|
||||||
# {'group_id': self.env['procurement.group'].search([('name', '=', sale_order.name)])})
|
# {'group_id': self.env['procurement.group'].search([('name', '=', sale_order.name)])})
|
||||||
stock_picking_remanufacture = self.env['stock.picking'].search([('origin', '=', productions.name)])
|
stock_picking_remanufacture = self.env['stock.picking'].search([('origin', '=', productions.name)])
|
||||||
|
|||||||
@@ -975,10 +975,15 @@ class ReStockMove(models.Model):
|
|||||||
创建调拨单时,在此新增或修改调拨单的数据
|
创建调拨单时,在此新增或修改调拨单的数据
|
||||||
"""
|
"""
|
||||||
res = super(ReStockMove, self)._get_new_picking_values()
|
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 self[0].origin and self.picking_type_id.name in ['生产发料', '内部调拨']:
|
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')
|
production = self.env['mrp.production'].search([('name', '=', self[0].origin)], limit=1, order='id asc')
|
||||||
if not production:
|
|
||||||
return res
|
|
||||||
productions = self.env['mrp.production'].search(
|
productions = self.env['mrp.production'].search(
|
||||||
[('origin', '=', production.origin), ('product_id', '=', production.product_id.id)])
|
[('origin', '=', production.origin), ('product_id', '=', production.product_id.id)])
|
||||||
res['origin'] = ','.join(productions.mapped('name'))
|
res['origin'] = ','.join(productions.mapped('name'))
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class ProductionTechnologyReAdjustWizard(models.TransientModel):
|
|||||||
|
|
||||||
def confirm(self):
|
def confirm(self):
|
||||||
if self.is_technology_re_adjust is True:
|
if self.is_technology_re_adjust is True:
|
||||||
domain = [('origin', '=', self.origin), ('state', '=', 'technology_to_confirmed'),
|
domain = [('origin', '=', self.origin), ('state', '=', 'confirmed'),
|
||||||
('product_id', '=', self.production_id.product_id.id)]
|
('product_id', '=', self.production_id.product_id.id)]
|
||||||
else:
|
else:
|
||||||
domain = [('id', '=', self.production_id.id)]
|
domain = [('id', '=', self.production_id.id)]
|
||||||
|
|||||||
Reference in New Issue
Block a user