修复表面工艺外协单状态
This commit is contained in:
@@ -657,7 +657,7 @@ class MrpProduction(models.Model):
|
|||||||
for production in self:
|
for production in self:
|
||||||
production.write({
|
production.write({
|
||||||
'date_finished': fields.Datetime.now(),
|
'date_finished': fields.Datetime.now(),
|
||||||
'product_qty': production.qty_produced,
|
'product_qty': production.qty_produced if production.qty_produced < 1 else production.product_qty,
|
||||||
'priority': '0',
|
'priority': '0',
|
||||||
'is_locked': True,
|
'is_locked': True,
|
||||||
'state': 'done',
|
'state': 'done',
|
||||||
|
|||||||
@@ -202,6 +202,7 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
[("programming", "编程"), ("clamping", "返工"), ("cutter", "刀具"), ("operate computer", "操机"),
|
[("programming", "编程"), ("clamping", "返工"), ("cutter", "刀具"), ("operate computer", "操机"),
|
||||||
("technology", "工艺"), ("customer redrawing", "客户改图"), ("other", "其他"), ], string="原因", tracking=True)
|
("technology", "工艺"), ("customer redrawing", "客户改图"), ("other", "其他"), ], string="原因", tracking=True)
|
||||||
detailed_reason = fields.Text('详细原因')
|
detailed_reason = fields.Text('详细原因')
|
||||||
|
|
||||||
# is_send_program_again = fields.Boolean(string='是否重新下发NC程序', default=False)
|
# is_send_program_again = fields.Boolean(string='是否重新下发NC程序', default=False)
|
||||||
|
|
||||||
@api.onchange('rfid_code')
|
@api.onchange('rfid_code')
|
||||||
@@ -861,7 +862,7 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
('location_dest_id', '=', self.env['stock.location'].search(
|
('location_dest_id', '=', self.env['stock.location'].search(
|
||||||
[('barcode', 'ilike', 'VL-SPOC')]).id),
|
[('barcode', 'ilike', 'VL-SPOC')]).id),
|
||||||
('origin', '=', self.production_id.name)])
|
('origin', '=', self.production_id.name)])
|
||||||
purchase = self.env['purchase.order'].search([('origin', '=', self.production_id.name)])
|
purchase = self.env['purchase.order'].search([('origin', 'ilike', self.production_id.name)])
|
||||||
if purchase and move_out:
|
if purchase and move_out:
|
||||||
move_out.write({'state': 'assigned'})
|
move_out.write({'state': 'assigned'})
|
||||||
self.env['stock.move.line'].create(move_out.get_move_line(purchase, self))
|
self.env['stock.move.line'].create(move_out.get_move_line(purchase, self))
|
||||||
@@ -1010,6 +1011,7 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
workorder.rfid_code_old = rfid_code
|
workorder.rfid_code_old = rfid_code
|
||||||
workorder.rfid_code = ''
|
workorder.rfid_code = ''
|
||||||
if is_production_id is True and record.routing_type in ['解除装夹', '表面工艺']:
|
if is_production_id is True and record.routing_type in ['解除装夹', '表面工艺']:
|
||||||
|
logging.info('product_qty:%s' % record.production_id.product_qty)
|
||||||
for move_raw_id in record.production_id.move_raw_ids:
|
for move_raw_id in record.production_id.move_raw_ids:
|
||||||
move_raw_id.quantity_done = move_raw_id.product_uom_qty
|
move_raw_id.quantity_done = move_raw_id.product_uom_qty
|
||||||
record.process_state = '已完工'
|
record.process_state = '已完工'
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ class StockRule(models.Model):
|
|||||||
'''
|
'''
|
||||||
# productions._create_workorder()
|
# productions._create_workorder()
|
||||||
#
|
#
|
||||||
# self.env['stock.move'].sudo().create(productions._get_moves_finished_values())
|
self.env['stock.move'].sudo().create(productions._get_moves_finished_values())
|
||||||
productions.filtered(lambda p: (not p.orderpoint_id and p.move_raw_ids) or \
|
productions.filtered(lambda p: (not p.orderpoint_id and p.move_raw_ids) or \
|
||||||
(
|
(
|
||||||
p.move_dest_ids.procure_method != 'make_to_order' and not
|
p.move_dest_ids.procure_method != 'make_to_order' and not
|
||||||
|
|||||||
Reference in New Issue
Block a user