Files
odoo-usability/mrp_usability_akretion/views/mrp_production.xml
Alexis de Lattre 13744fc404 Initialize v18 branch
Rename *_usability modules to *_usability_akretion
2024-12-24 10:11:21 +01:00

49 lines
2.5 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2016-2022 Akretion (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
<record id="mrp_production_form_view" model="ir.ui.view">
<field name="name">usability.mrp.production.form</field>
<field name="model">mrp.production</field>
<field name="inherit_id" ref="mrp.mrp_production_form_view"/>
<field name="arch" type="xml">
<field name="user_id" position="before">
<!-- I can't use position="move" because it would match another field in an embedded tree view -->
<field name="location_src_id" groups="stock.group_stock_multi_locations" options="{'no_create': True}" attrs="{'readonly': [('state', '!=', 'draft')]}"/>
<field name="location_dest_id" groups="stock.group_stock_multi_locations" options="{'no_create': True}" attrs="{'readonly': [('state', 'in', ('done', 'cancel'))]}"/>
</field>
<!-- It is important to remove the original field location_dest_id
and not just set it as invisible because it cancels the changes -->
<xpath expr="//page[@name='miscellaneous']/group/group/field[@name='location_dest_id']" position="replace"/>
<xpath expr="//page[@name='miscellaneous']/group/group/field[@name='location_src_id']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//page[@name='miscellaneous']/group/group/field[@name='date_deadline']" position="after">
<field name="date_start"/>
<field name="date_finished"/>
</xpath>
<button name="action_cancel" type="object" attrs="{'invisible': ['|', '|', ('id', '=', False), ('state', 'in', ('done', 'cancel')), ('confirm_cancel', '=', True)]}" position="attributes">
<attribute name="confirm">Are you sure you want to cancel this manufacturing order?</attribute>
</button>
</field>
</record>
<record id="mrp_production_tree_view" model="ir.ui.view">
<field name="model">mrp.production</field>
<field name="inherit_id" ref="mrp.mrp_production_tree_view"/>
<field name="arch" type="xml">
<field name="reservation_state" position="after">
<field name="location_src_id" optional="hide" groups="stock.group_stock_multi_locations"/>
<field name="location_dest_id" optional="hide" groups="stock.group_stock_multi_locations"/>
</field>
</field>
</record>
</odoo>