Accept Merge Request #1914: (feature/制造功能优化 -> develop)

Merge Request: 修复按钮规则;修复排程单取消

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1914?initial=true
This commit is contained in:
马广威
2025-03-18 09:44:20 +08:00
committed by Coding
2 changed files with 8 additions and 8 deletions

View File

@@ -75,6 +75,12 @@ class SFSaleOrderCancelWizard(models.TransientModel):
# 取消销售订单
result = self.order_id.action_cancel()
# 取消制造订单的排程单
mo_plan_orders = self.env['sf.production.plan'].search([
('origin', '=', self.order_id.name)])
if mo_plan_orders:
mo_plan_orders.write({'state': 'cancel'})
# 取消关联的制造订单及其采购单
manufacturing_orders = self.env['mrp.production'].search([
('origin', '=', self.order_id.name)
@@ -94,12 +100,6 @@ class SFSaleOrderCancelWizard(models.TransientModel):
if mo_quality_checks:
mo_quality_checks.write({'quality_state': 'cancel'})
# 取消制造订单的排程单
mo_plan_orders = self.env['sf.production.plan'].search([
('origin', '=', order.name)])
if mo_plan_orders:
mo_plan_orders.write({'state': 'cancel'})
# 取消制造订单的子制造订单
child_mo_ids = self.env['mrp.production'].search([
('origin', '=', mo.name)

View File

@@ -52,7 +52,7 @@
</page>
</xpath>
<xpath expr="//header//button[@name='do_pass'][1]" position="attributes">
<attribute name="attrs">{'invisible': [('is_out_check', '=', True)]}</attribute>
<attribute name="attrs">{'invisible': ['|', ('is_out_check', '=', True), ('quality_state', '!=', 'none')]}</attribute>
<attribute name="string">合格</attribute>
</xpath>
<xpath expr="//header//button[@name='do_pass'][2]" position="attributes">
@@ -60,7 +60,7 @@
<attribute name="string">合格</attribute>
</xpath>
<xpath expr="//header//button[@name='do_fail'][1]" position="attributes">
<attribute name="attrs">{'invisible': [('is_out_check', '=', True)]}</attribute>
<attribute name="attrs">{'invisible': ['|', ('is_out_check', '=', True), ('quality_state', '!=', 'none')]}</attribute>
<attribute name="string">不合格</attribute>
</xpath>
<xpath expr="//header//button[@name='do_fail'][2]" position="attributes">