Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/优化最新版返工

# Conflicts:
#	sf_manufacturing/views/mrp_workorder_view.xml
This commit is contained in:
jinling.yang
2024-07-11 17:38:38 +08:00
173 changed files with 14467 additions and 297 deletions

View File

@@ -124,12 +124,17 @@ class MrpProduction(models.Model):
if (
production.state == 'to_close' or production.state == 'progress') and production.schedule_state == '未排':
production.state = 'confirmed'
elif production.state == 'pending_cam' and production.schedule_state == '未排':
production.state = 'confirmed'
elif production.state == 'to_close' and production.schedule_state == '已排':
production.state = 'pending_cam'
if production.state == 'progress':
if all(wo_state not in ('progress', 'done') for wo_state in production.workorder_ids.mapped('state')):
production.state = 'pending_cam'
if production.state == 'pending_cam':
if all(wo_state in 'done' for wo_state in production.workorder_ids.mapped('state')):
production.state = 'done'
def action_check(self):
"""
@@ -699,7 +704,7 @@ class MrpProduction(models.Model):
logging.info('qty_produced:%s' % production.qty_produced)
production.write({
'date_finished': fields.Datetime.now(),
'product_qty': production.product_qty if production.qty_produced < 1.0 else production.qty_produced,
'product_qty': production.qty_produced,
'priority': '0',
'is_locked': True,
'state': 'done',