人工线下加工工单也需要走cloud编程流程的优化需求

This commit is contained in:
mgw
2025-02-05 17:41:52 +08:00
parent 8bfe5eca03
commit 0a8cc050b8
3 changed files with 8 additions and 5 deletions

View File

@@ -1302,6 +1302,7 @@ class MrpProduction(models.Model):
# 对制造订单所以面的cnc工单的程序用刀进行校验
try:
logging.info(f'已更新制造订单:{productions_not_delivered}')
productions = productions.env['mrp.production'].search([('production_type', '=', '自动化产线加工')])
productions.production_cnc_tool_checkout()
except Exception as e:
logging.info(f'对cnc工单的程序用刀进行校验报错{e}')

View File

@@ -289,7 +289,7 @@ class StockRule(models.Model):
if production_item.product_id.id in product_id_to_production_names:
# 同一个产品多个制造订单对应一个编程单和模型库
# 只调用一次fetchCNC并将所有生产订单的名称作为字符串传递
if not production_item.programming_no and production_item.production_type == '自动化产线加工':
if not production_item.programming_no and production_item.production_type in ['自动化产线加工', '人工线下加工']:
if not production_programming.programming_no:
production_item.fetchCNC(
', '.join(product_id_to_production_names[production_item.product_id.id]))

View File

@@ -74,7 +74,9 @@
<xpath expr="//field[@name='production_real_duration']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='state']" position="after">
<field name="programming_state" optional="hide"/>
</xpath>
</field>
</record>
@@ -115,11 +117,11 @@
<xpath expr="//sheet//group//group//div[3]" position="after">
<field name="production_type" readonly="1"/>
<field name="manual_quotation" readonly="1"
attrs="{'invisible': [('production_type', 'not in', ['自动化产线加工'])]}"/>
attrs="{'invisible': [('production_type', 'not in', ['自动化产线加工', '人工线下加工'])]}"/>
<field name="programming_no" readonly="1"
attrs="{'invisible': [('production_type', 'not in', ['自动化产线加工'])]}"/>
attrs="{'invisible': [('production_type', 'not in', ['自动化产线加工', '人工线下加工'])]}"/>
<field name="programming_state" readonly="1"
attrs="{'invisible': [('production_type', 'not in', ['自动化产线加工'])]}"
attrs="{'invisible': [('production_type', 'not in', ['自动化产线加工', '人工线下加工'])]}"
decoration-success="programming_state == '已编程'"
decoration-warning="programming_state =='编程中'"
decoration-danger="programming_state =='已编程未下发'"/>