-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[16.0][IMP] Merging page in mrp_bom form view, adding custom fields
- Loading branch information
1 parent
4657f27
commit 95285bd
Showing
3 changed files
with
106 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (C) 2024 - Today: GRAP (http://www.grap.coop) | ||
@author: Quentin DUPONT (quentin.dupont@grap.coop) | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
--> | ||
<odoo> | ||
|
||
<!-- ************************************************************ --> | ||
<!-- MRP Bill of Materials - Form --> | ||
<!-- ************************************************************ --> | ||
|
||
<record id="view_mrp_business_bom_form" model="ir.ui.view"> | ||
<field name="model">mrp.bom</field> | ||
<field name="inherit_id" ref="mrp_bom_widget_section_and_note_one2many.mrp_bom_form_view_section" /> | ||
<field name="arch" type="xml"> | ||
|
||
<!-- Hide fields --> | ||
|
||
<xpath expr="//field[@name='bom_line_with_sectionnote_ids']/tree/button[@name='action_see_attachments']" position="attributes"> | ||
<attribute name="invisible">1</attribute> | ||
</xpath> | ||
|
||
<xpath expr="//field[@name='bom_line_with_sectionnote_ids']/tree/field[@name='attachments_count']" position="attributes"> | ||
<attribute name="invisible">1</attribute> | ||
</xpath> | ||
|
||
<!-- Add fields --> | ||
<xpath | ||
expr="//field[@name='bom_line_with_sectionnote_ids']/tree/field[@name='product_uom_id']" | ||
position="before" | ||
> | ||
<!-- mrp_bom_line_net_qty fields --> | ||
<field name="diff_product_qty_gross_net" invisible="1" /> | ||
<button | ||
name="set_product_qty_gross" | ||
icon="fa-arrow-left" | ||
type="object" | ||
attrs="{'invisible': [('diff_product_qty_gross_net', '=', 0)]}" | ||
title="This will set product gross quantity with net quantity and loss percentage" | ||
/> | ||
<field | ||
name="loss_percentage" | ||
widget="numeric_step" | ||
options="{'step': 1}" | ||
/> | ||
<button | ||
name="set_product_qty_net" | ||
icon="fa-arrow-right" | ||
type="object" | ||
attrs="{'invisible': [('diff_product_qty_gross_net', '=', 0)]}" | ||
title="This will set product net quantity with gross quantity and loss percentage" | ||
/> | ||
<field name="product_qty_net" /> | ||
|
||
<!-- mrp_bom_product_price_margin fields --> | ||
<field name="currency_id" invisible="1" /> | ||
<field name="standard_price_unit" widget="monetary" /> | ||
<field | ||
name="standard_price_subtotal" | ||
readonly="1" | ||
sum="Total" | ||
widget="monetary" | ||
/> | ||
<field | ||
name="standard_price_subtotal_percentage" | ||
string="ST %" | ||
widget="percentage" | ||
/> | ||
</xpath> | ||
|
||
<!-- Add decoration --> | ||
<xpath expr="//field[@name='bom_line_with_sectionnote_ids']/tree" position="attributes">> | ||
<attribute | ||
name="decoration-warning" | ||
>diff_product_qty_gross_net != 0</attribute> | ||
</xpath> | ||
|
||
<!-- Rename page --> | ||
<xpath expr="//page[@name='components_w_sections_notes']" position="attributes"> | ||
<attribute name="string">Components</attribute> | ||
</xpath> | ||
|
||
<!-- Hide page --> | ||
<xpath expr="//page[@name='components']" position="attributes"> | ||
<attribute name="groups">base.group_no_one</attribute> | ||
</xpath> | ||
|
||
</field> | ||
</record> | ||
|
||
</odoo> |