Files
odoo_source/addons/mrp/wizard/mrp_consumption_warning_views.xml
T
brsy-odoo 281e1a57b3 [IMP] mrp: MO/WO UI Improvements
Improve the UI for the MO and the WO with some new features, better readability and usability

- The forecast for the MO in draft makes the preparation of a MO easier. The behavior of `forecast_availability` depend of the state of the move
- The sum of expected duration and real duration in the MO, make the MO visually clearer
- The field Scheduled Date is rounding up to the next hour for less manipulation
- The automatic reference in a BOM if there is already a BOM for this product allows making less manipulation. I'm using this variable `number_of_bom_of_this_product` with the result of the query inside so I didn't need to do the query twice and the query doesn't take the current bom.
- A rounded value is better for the OEE in WO summary
- Have a tag for a workcenter can be a good idea to add more information to it. I'm using a random value for the color of the tag, we are doing it frequently to have a random color on multiple think.
- Knowing the final product of a WO is clearer
- To notify the user when creating a product with a reference that are already existing is a good idea.
- Change some color in the MO view for better readability
- And more minor tweak (like to align some part in the view)

--- Links ---
The PR: https://github.com/odoo/odoo/pull/74540
The PR on enterprise: https://github.com/odoo/enterprise/pull/20006
Task related: 2442895

closes odoo/odoo#74540

Related: odoo/enterprise#20006
Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
2021-08-25 07:50:36 +00:00

58 lines
3.3 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- MO Consumption Warning -->
<record id="view_mrp_consumption_warning_form" model="ir.ui.view">
<field name="name">Consumption Warning</field>
<field name="model">mrp.consumption.warning</field>
<field name="arch" type="xml">
<form string="Consumption Warning">
<field name="mrp_production_ids" invisible="1"/>
<field name="consumption" invisible="1"/>
<field name="mrp_production_count" invisible="1"/>
<div class="m-2">
You consumed a different quantity than expected for the following products.
<b attrs="{'invisible': [('consumption', '=', 'strict')]}">
Please confirm it has been done on purpose.
</b>
<b attrs="{'invisible': [('consumption', '!=', 'strict')]}">
Please review your component consumption or ask a manager to validate
<span attrs="{'invisible':[('mrp_production_count', '!=', 1)]}">this manufacturing order</span>
<span attrs="{'invisible':[('mrp_production_count', '=', 1)]}">these manufacturing orders</span>.
</b>
</div>
<field name="mrp_consumption_warning_line_ids" nolabel="1">
<tree create="0" delete="0" editable="top">
<field name="mrp_production_id" attrs="{'column_invisible':[('parent.mrp_production_count', '=', 1)]}" force_save="1"/>
<field name="consumption" invisible="1" force_save="1"/>
<field name="product_id" force_save="1"/>
<field name="product_uom_id" groups="uom.group_uom" force_save="1"/>
<field name="product_expected_qty_uom" force_save="1"/>
<field name="product_consumed_qty_uom" force_save="1"/>
</tree>
</field>
<footer>
<button name="action_confirm" string="Force" data-hotkey="q"
groups="mrp.group_mrp_manager" attrs="{'invisible': [('consumption', '!=', 'strict')]}"
colspan="1" type="object" class="btn-primary"/>
<button name="action_confirm" string="Confirm" attrs="{'invisible': [('consumption', '=', 'strict')]}" data-hotkey="q"
colspan="1" type="object" class="btn-primary"/>
<button name="action_cancel" string="Discard" data-hotkey="w"
colspan="1" type="object" class="btn-secondary"/>
</footer>
</form>
</field>
</record>
<record id="action_mrp_consumption_warning" model="ir.actions.act_window">
<field name="name">Consumption Warning</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.consumption.warning</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
</data>
</odoo>