diff --git a/addons/mrp/views/mrp_production_views.xml b/addons/mrp/views/mrp_production_views.xml index 6e7137e06df7ecc9eee1a1aff58e316f5f37ca93..d607aea69c0013efad9d30760965e51d553f8042 100644 --- a/addons/mrp/views/mrp_production_views.xml +++ b/addons/mrp/views/mrp_production_views.xml @@ -262,7 +262,7 @@ </field> </page> <page string="Operations" name="operations" groups="mrp.group_mrp_routings"> - <field name="workorder_ids" attrs="{'readonly': [('state', 'in', ['cancel', 'done'])]}" context="{'tree_view_ref': 'mrp.mrp_production_workorder_tree_editable_view', 'default_production_id': id, 'default_product_uom_id': product_uom_id, 'default_consumption': consumption, 'default_company_id': company_id}"/> </page> + <field name="workorder_ids" attrs="{'readonly': [('state', 'in', ['cancel', 'done'])]}" context="{'tree_view_ref': 'mrp.mrp_production_workorder_tree_editable_view', 'form_view_ref': 'mrp.mrp_production_workorder_form_view_inherit', 'default_production_id': id, 'default_product_uom_id': product_uom_id, 'default_consumption': consumption, 'default_company_id': company_id}"/> </page> <page string="By-Products" name="finished_products" groups="mrp.group_mrp_byproducts"> <field name="move_byproduct_ids" context="{'default_location_id': production_location_id, 'default_location_dest_id': location_src_id, 'default_state': 'draft', 'default_production_id': id, 'default_picking_type_id': picking_type_id, 'default_company_id': company_id}" attrs="{'readonly': ['|', ('state', '=', 'cancel'), '&', ('state', '=', 'done'), ('is_locked', '=', True)]}"> <tree delete="0" default_order="is_done,sequence" decoration-muted="is_done" editable="bottom"> diff --git a/addons/mrp/views/mrp_workorder_views.xml b/addons/mrp/views/mrp_workorder_views.xml index 9b7a37b6058bacb9b79ada2433149d2e11c6b728..641e6dbda640dbbdf71763e439b06a67f976c0a9 100644 --- a/addons/mrp/views/mrp_workorder_views.xml +++ b/addons/mrp/views/mrp_workorder_views.xml @@ -130,7 +130,6 @@ <header> <field name="state" widget="statusbar" statusbar_visible="pending,ready,progress,done"/> </header> - <sheet> <div class="oe_button_box" name="button_box"> <button class="oe_stat_button" name="action_see_move_scrap" type="object" icon="fa-arrows-v" attrs="{'invisible': [('scrap_count', '=', 0)]}"> <div class="o_field_widget o_stat_info"> @@ -198,11 +197,26 @@ <field name="operation_note" attrs="{'invisible': [('worksheet_type', '!=', 'text')]}"/> </page> </notebook> - </sheet> </form> </field> </record> + <record id="mrp_production_workorder_form_view_inherit_editable" model="ir.ui.view"> + <field name="name">mrp.production.work.order.tree</field> + <field name="model">mrp.workorder</field> + <field name="mode">primary</field> + <field name="priority" eval="10"/> + <field name="inherit_id" ref="mrp.mrp_production_workorder_form_view_inherit"/> + <field name="arch" type="xml"> + <xpath expr="//notebook" position="after"> + <footer> + <button string="Save" special="save" class="btn-primary"/> + <button string="Discard" special="cancel"/> + </footer> + </xpath> + </field> + </record> + <record id="view_mrp_production_workorder_form_view_filter" model="ir.ui.view"> <field name="name">mrp.production.work.order.select</field> <field name="model">mrp.workorder</field> @@ -443,7 +457,7 @@ <field name="res_model">mrp.workorder</field> <field name="view_mode">form</field> <field name="target">new</field> - <field name="view_id" ref="mrp_production_workorder_form_view_inherit"/> + <field name="view_id" ref="mrp_production_workorder_form_view_inherit_editable"/> </record> <record model="ir.actions.act_window" id="mrp_workorder_todo">