Merge branch 'feature/制造订单优化' into feature/制造、采购优化

This commit is contained in:
yuxianghui
2024-12-25 13:03:44 +08:00
2 changed files with 5 additions and 10 deletions

View File

@@ -363,15 +363,10 @@ class MrpProduction(models.Model):
# if production.state == 'pending_cam': # if production.state == 'pending_cam':
# if all(wo_state in 'done' for wo_state in production.workorder_ids.mapped('state')): # if all(wo_state in 'done' for wo_state in production.workorder_ids.mapped('state')):
# production.state = 'done' # production.state = 'done'
if any( if any((wo.test_results == '返工' and wo.state == 'done' and production.programming_state in ['已编程'])
( or (wo.state == 'rework' and production.programming_state == '编程中')
wo.test_results == '返工' and wo.state == 'done' and production.programming_state in [ or (wo.is_rework is True and wo.state == 'done' and production.programming_state in ['编程中', '已编程'])
'已编程']) or ( for wo in production.workorder_ids) and production.state not in ['progress']:
wo.state == 'rework' and production.programming_state == '编程中') or (
wo.is_rework is True and wo.state == 'done' and production.programming_state in ['编程中',
'已编程'])
for wo in
production.workorder_ids):
production.state = 'rework' production.state = 'rework'
if any(wo.test_results == '报废' and wo.state == 'done' for wo in production.workorder_ids): if any(wo.test_results == '报废' and wo.state == 'done' for wo in production.workorder_ids):
production.state = 'scrap' production.state = 'scrap'

View File

@@ -42,7 +42,7 @@
<button name="button_confirm" type="object" context="{'validate_analytic': True}" <button name="button_confirm" type="object" context="{'validate_analytic': True}"
string="确认订单" id="draft_confirm" string="确认订单" id="draft_confirm"
groups="sf_base.group_purchase,sf_base.group_purchase_director" groups="sf_base.group_purchase,sf_base.group_purchase_director"
attrs="{'invisible': [('state', 'in', ['purchase'])]}" attrs="{'invisible': [('state', 'in', ['purchase', 'cancel'])]}"
/> />
</xpath> </xpath>
<xpath expr="//form/header/button[@name='action_rfq_send'][1]" position="replace"> <xpath expr="//form/header/button[@name='action_rfq_send'][1]" position="replace">