去掉工单明细处删除按钮;已完成工单取24小时内
This commit is contained in:
@@ -626,10 +626,16 @@ class Sf_Dashboard_Connect(http.Controller):
|
|||||||
('production_id.state', 'not in', ['cancel', 'done']), ('active', '=', True)
|
('production_id.state', 'not in', ['cancel', 'done']), ('active', '=', True)
|
||||||
])
|
])
|
||||||
# print(not_done_orders)
|
# print(not_done_orders)
|
||||||
|
|
||||||
# 完成订单
|
# 完成订单
|
||||||
|
# 获取当前时间,并计算24小时前的时间
|
||||||
|
current_time = datetime.now()
|
||||||
|
time_24_hours_ago = current_time - timedelta(hours=24)
|
||||||
|
|
||||||
finish_orders = plan_obj.search([
|
finish_orders = plan_obj.search([
|
||||||
('production_line_id.name', '=', line), ('state', 'in', ['finished']),
|
('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)
|
# print(finish_orders)
|
||||||
|
|
||||||
|
|||||||
@@ -296,6 +296,10 @@
|
|||||||
</attribute>
|
</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|
||||||
|
<xpath expr="//sheet//notebook//page[@name='operations']//field[@name='workorder_ids']" position="replace">
|
||||||
|
<field name="workorder_ids" attrs="{'readonly': ['|', ('state', '!=', 'test_value'), '&', ('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">
|
<xpath expr="//sheet//notebook//page[@name='operations']" position="after">
|
||||||
<page string="检测结果" attrs="{'invisible': [('detection_result_ids', '=', [])]}">
|
<page string="检测结果" attrs="{'invisible': [('detection_result_ids', '=', [])]}">
|
||||||
<field name="detection_result_ids" string="" readonly="0">
|
<field name="detection_result_ids" string="" readonly="0">
|
||||||
|
|||||||
Reference in New Issue
Block a user