去掉工单明细处删除按钮;已完成工单取24小时内

This commit is contained in:
mgw
2024-09-23 12:08:02 +08:00
parent 68f8c94332
commit 5269d09d0e
2 changed files with 11 additions and 1 deletions

View File

@@ -626,10 +626,16 @@ class Sf_Dashboard_Connect(http.Controller):
('production_id.state', 'not in', ['cancel', 'done']), ('active', '=', True)
])
# print(not_done_orders)
# 完成订单
# 获取当前时间并计算24小时前的时间
current_time = datetime.now()
time_24_hours_ago = current_time - timedelta(hours=24)
finish_orders = plan_obj.search([
('production_line_id.name', '=', line), ('state', 'in', ['finished']),
('production_id.state', 'not in', ['cancel']), ('active', '=', True)
('production_id.state', 'not in', ['cancel']), ('active', '=', True),
('actual_end_time', '>=', time_24_hours_ago)
])
# print(finish_orders)

View File

@@ -296,6 +296,10 @@
</attribute>
</xpath>
<xpath expr="//sheet//notebook//page[@name='operations']//field[@name='workorder_ids']" position="replace">
<field name="workorder_ids" attrs="{'readonly': ['|', ('state', '!=', 'test_value'), '&amp;', ('state', '=', 'done'), ('is_locked', '=', True)]}" context="{'tree_view_ref': 'mrp.mrp_production_workorder_tree_editable_view', 'default_product_uom_id': product_uom_id, 'from_manufacturing_order': True}"/>
</xpath>
<xpath expr="//sheet//notebook//page[@name='operations']" position="after">
<page string="检测结果" attrs="{'invisible': [('detection_result_ids', '=', [])]}">
<field name="detection_result_ids" string="" readonly="0">