工单详情添加回退按钮
This commit is contained in:
@@ -178,9 +178,9 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
[('workorder_id', '=', self.id)])
|
[('workorder_id', '=', self.id)])
|
||||||
for check_order in quality_check:
|
for check_order in quality_check:
|
||||||
if check_order.point_id.is_inspect:
|
if check_order.point_id.is_inspect:
|
||||||
check_order.state = 'waiting'
|
check_order.quality_state = 'waiting'
|
||||||
else:
|
else:
|
||||||
check_order.state = 'none'
|
check_order.quality_state = 'none'
|
||||||
# move_dest_ids
|
# move_dest_ids
|
||||||
finished_quants = moves.mapped('move_line_ids.lot_id.quant_ids')
|
finished_quants = moves.mapped('move_line_ids.lot_id.quant_ids')
|
||||||
finished_quants.quantity = 0
|
finished_quants.quantity = 0
|
||||||
@@ -204,9 +204,9 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
[('workorder_id', '=', self.id)])
|
[('workorder_id', '=', self.id)])
|
||||||
for check_order in quality_check:
|
for check_order in quality_check:
|
||||||
if check_order.point_id.is_inspect:
|
if check_order.point_id.is_inspect:
|
||||||
check_order.state = 'waiting'
|
check_order.quality_state = 'waiting'
|
||||||
else:
|
else:
|
||||||
check_order.state = 'none'
|
check_order.quality_state = 'none'
|
||||||
|
|
||||||
def _compute_working_users(self):
|
def _compute_working_users(self):
|
||||||
super()._compute_working_users()
|
super()._compute_working_users()
|
||||||
|
|||||||
@@ -61,7 +61,8 @@
|
|||||||
</xpath>
|
</xpath>
|
||||||
|
|
||||||
<xpath expr="//button[@name='button_start']" position="after">
|
<xpath expr="//button[@name='button_start']" position="after">
|
||||||
<button name="button_back" string="回退" type="object" class="btn-primary" attrs="{'invisible': [('back_button_display', '=', False)]}" confirm="是否确认回退"/>
|
<button name="button_back" string="回退" type="object" class="btn-primary"
|
||||||
|
attrs="{'invisible': [('back_button_display', '=', False)]}" confirm="是否确认回退"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//button[@name='%(mrp.act_mrp_block_workcenter_wo)d']" position="attributes">
|
<xpath expr="//button[@name='%(mrp.act_mrp_block_workcenter_wo)d']" position="attributes">
|
||||||
<attribute name="attrs">{'invisible':
|
<attribute name="attrs">{'invisible':
|
||||||
@@ -168,7 +169,8 @@
|
|||||||
<field name='is_delivery' invisible="1"/>
|
<field name='is_delivery' invisible="1"/>
|
||||||
<field name="is_trayed" invisible="1"/>
|
<field name="is_trayed" invisible="1"/>
|
||||||
<field name="is_inspect" invisible="1"/>
|
<field name="is_inspect" invisible="1"/>
|
||||||
<!-- <field name="rework_flag" invisible="1"/>-->
|
<field name="back_button_display" invisible="1"/>
|
||||||
|
<!-- <field name="rework_flag" invisible="1"/>-->
|
||||||
<!-- <field name='is_send_program_again' invisible="1"/>-->
|
<!-- <field name='is_send_program_again' invisible="1"/>-->
|
||||||
<!-- 工单form页面的开始停工按钮等 -->
|
<!-- 工单form页面的开始停工按钮等 -->
|
||||||
<!-- <button name="button_start" type="object" string="开始" class="btn-success" -->
|
<!-- <button name="button_start" type="object" string="开始" class="btn-success" -->
|
||||||
@@ -183,6 +185,8 @@
|
|||||||
|
|
||||||
<!-- <button name="button_start" type="object" string="开始" class="btn-success" confirm="是否确认开始"-->
|
<!-- <button name="button_start" type="object" string="开始" class="btn-success" confirm="是否确认开始"-->
|
||||||
<!-- attrs="{'invisible': ['|', '|', '|', ('production_state','in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('state', 'in', ('done', 'cancel','to be detected')), ('is_user_working', '!=', False)]}"/>-->
|
<!-- attrs="{'invisible': ['|', '|', '|', ('production_state','in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('state', 'in', ('done', 'cancel','to be detected')), ('is_user_working', '!=', False)]}"/>-->
|
||||||
|
<button name="button_back" string="回退" type="object" class="btn-primary"
|
||||||
|
attrs="{'invisible': [('back_button_display', '=', False)]}" confirm="是否确认回退"/>
|
||||||
<button name="button_start" type="object" string="开始" class="btn-success"
|
<button name="button_start" type="object" string="开始" class="btn-success"
|
||||||
attrs="{'invisible': [('state', '!=', 'ready')]}"/>
|
attrs="{'invisible': [('state', '!=', 'ready')]}"/>
|
||||||
<button name="button_pending" type="object" string="暂停" class="btn-warning"
|
<button name="button_pending" type="object" string="暂停" class="btn-warning"
|
||||||
@@ -217,12 +221,13 @@
|
|||||||
attrs="{'invisible': ['|', '|', '|', ('routing_type','!=','装夹预调'),('state','!=','progress'), ('is_trayed', '=', False), ('state', 'in', ('done'))]}"/>
|
attrs="{'invisible': ['|', '|', '|', ('routing_type','!=','装夹预调'),('state','!=','progress'), ('is_trayed', '=', False), ('state', 'in', ('done'))]}"/>
|
||||||
<button name="print_method" type="object" string="打印二维码" class="btn-primary"
|
<button name="print_method" type="object" string="打印二维码" class="btn-primary"
|
||||||
attrs="{'invisible': ['|',('routing_type','!=','解除装夹'),('state','!=','done')]}"/>
|
attrs="{'invisible': ['|',('routing_type','!=','解除装夹'),('state','!=','done')]}"/>
|
||||||
<!-- <button type="object" class="oe_highlight jikimo_button_confirm" name="button_rework"-->
|
<!-- <button type="object" class="oe_highlight jikimo_button_confirm" name="button_rework"-->
|
||||||
<!-- string="返工"-->
|
<!-- string="返工"-->
|
||||||
<!-- attrs='{"invisible": [("rework_flag","=",True)]}' confirm="是否返工"/>-->
|
<!-- attrs='{"invisible": [("rework_flag","=",True)]}' confirm="是否返工"/>-->
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//page[1]" position="before">
|
<xpath expr="//page[1]" position="before">
|
||||||
<page string="开料要求" attrs='{"invisible": [("routing_type","not in",("切割", "线切割", "人工线下加工"))]}'>
|
<page string="开料要求"
|
||||||
|
attrs='{"invisible": [("routing_type","not in",("切割", "线切割", "人工线下加工"))]}'>
|
||||||
<group>
|
<group>
|
||||||
<group>
|
<group>
|
||||||
<field name="product_tmpl_id_materials_id" widget="many2one"/>
|
<field name="product_tmpl_id_materials_id" widget="many2one"/>
|
||||||
@@ -321,7 +326,7 @@
|
|||||||
<xpath expr="//page[1]" position="before">
|
<xpath expr="//page[1]" position="before">
|
||||||
<page string="工件装夹" attrs='{"invisible": [("routing_type","!=","装夹预调")]}'>
|
<page string="工件装夹" attrs='{"invisible": [("routing_type","!=","装夹预调")]}'>
|
||||||
<group>
|
<group>
|
||||||
<!-- <field name="_barcode_scanned" widget="barcode_handler"/> -->
|
<!-- <field name="_barcode_scanned" widget="barcode_handler"/> -->
|
||||||
<group string="托盘">
|
<group string="托盘">
|
||||||
<field name="tray_serial_number" readonly="1" string="序列号"/>
|
<field name="tray_serial_number" readonly="1" string="序列号"/>
|
||||||
</group>
|
</group>
|
||||||
@@ -498,7 +503,8 @@
|
|||||||
</group>
|
</group>
|
||||||
</page>
|
</page>
|
||||||
|
|
||||||
<page string="2D加工图纸" attrs='{"invisible": [("routing_type","not in",["装夹预调", "人工线下加工"])]}'>
|
<page string="2D加工图纸"
|
||||||
|
attrs='{"invisible": [("routing_type","not in",["装夹预调", "人工线下加工"])]}'>
|
||||||
<field name="machining_drawings" widget="adaptive_viewer"/>
|
<field name="machining_drawings" widget="adaptive_viewer"/>
|
||||||
</page>
|
</page>
|
||||||
|
|
||||||
@@ -647,7 +653,8 @@
|
|||||||
<field name="inherit_id" ref="sf_manufacturing.view_mrp_production_workorder_tray_form_inherit_sf"/>
|
<field name="inherit_id" ref="sf_manufacturing.view_mrp_production_workorder_tray_form_inherit_sf"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//form//sheet//group//group[2]" position="replace">
|
<xpath expr="//form//sheet//group//group[2]" position="replace">
|
||||||
<group string="装夹图纸" attrs="{'invisible': [('routing_type', 'not in', ['装夹预调', '人工线下加工'])]}">
|
<group string="装夹图纸"
|
||||||
|
attrs="{'invisible': [('routing_type', 'not in', ['装夹预调', '人工线下加工'])]}">
|
||||||
<!-- 隐藏加工图纸字段名 -->
|
<!-- 隐藏加工图纸字段名 -->
|
||||||
<field name="processing_drawing" widget="pdf_viewer" string="" readonly="1"/>
|
<field name="processing_drawing" widget="pdf_viewer" string="" readonly="1"/>
|
||||||
<!-- <field name="production_id" invisible="0"/>-->
|
<!-- <field name="production_id" invisible="0"/>-->
|
||||||
|
|||||||
Reference in New Issue
Block a user