Initial commit: Odoo 18.0-20251222 extra-addons
This commit is contained in:
62
sale_order_secondary_unit/views/product_secondary_unit_views.xml
Executable file
62
sale_order_secondary_unit/views/product_secondary_unit_views.xml
Executable file
@@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<record id="product_secondary_unit_view_search" model="ir.ui.view">
|
||||
<field name="name">product.secondary.unit.view.search</field>
|
||||
<field name="model">product.secondary.unit</field>
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<field name="product_tmpl_id" />
|
||||
<field name="code" />
|
||||
<field name="name" />
|
||||
<group expand="1" string="Group By">
|
||||
<filter
|
||||
string="Product Template"
|
||||
name="product_tmpl_id"
|
||||
context="{'group_by':'product_tmpl_id'}"
|
||||
/>
|
||||
<filter
|
||||
string="Product Variant"
|
||||
name="product_id"
|
||||
context="{'group_by':'product_id'}"
|
||||
groups="product.group_product_variant"
|
||||
/>
|
||||
<filter
|
||||
string="UoM"
|
||||
name="uom_id"
|
||||
context="{'group_by':'uom_id'}"
|
||||
/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="product_secondary_unit_view_tree" model="ir.ui.view">
|
||||
<field name="name">product.secondary.unit.sale.view.list</field>
|
||||
<field name="model">product.secondary.unit</field>
|
||||
<field name="arch" type="xml">
|
||||
<list editable="top" multi_edit="1">
|
||||
<field name="product_tmpl_id" />
|
||||
<field
|
||||
name="product_id"
|
||||
domain="[('product_tmpl_id', '=', product_tmpl_id)]"
|
||||
/>
|
||||
<field name="code" />
|
||||
<field name="name" />
|
||||
<field name="uom_id" />
|
||||
<field name="factor" />
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
<record id="product_secondary_unit_action" model="ir.actions.act_window">
|
||||
<field name="name">Secondary Unit</field>
|
||||
<field name="res_model">product.secondary.unit</field>
|
||||
<field name="view_mode">list,form</field>
|
||||
</record>
|
||||
<menuitem
|
||||
id="product_secondary_unit_menu"
|
||||
name="Secondary Units of Measure"
|
||||
action="product_secondary_unit_action"
|
||||
parent="sale.next_id_16"
|
||||
groups="uom.group_uom"
|
||||
/>
|
||||
</odoo>
|
||||
19
sale_order_secondary_unit/views/product_views.xml
Executable file
19
sale_order_secondary_unit/views/product_views.xml
Executable file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!-- Copyright 2018-2020 Tecnativa - Sergio Teruel
|
||||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
||||
<odoo>
|
||||
<record id="product_template_form_view" model="ir.ui.view">
|
||||
<field name="name">Product template Secondary Unit</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="product.product_template_form_view" />
|
||||
<field name="arch" type="xml">
|
||||
<div name="list_price_uom" position="after">
|
||||
<field
|
||||
name="sale_secondary_uom_id"
|
||||
options="{'no_create': True}"
|
||||
groups="uom.group_uom"
|
||||
/>
|
||||
</div>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
75
sale_order_secondary_unit/views/sale_order_views.xml
Executable file
75
sale_order_secondary_unit/views/sale_order_views.xml
Executable file
@@ -0,0 +1,75 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!-- Copyright 2018-2020 Tecnativa - Carlos Dauden
|
||||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
||||
<odoo>
|
||||
<record id="view_order_form" model="ir.ui.view">
|
||||
<field name="name">Sale Order Secondary Unit</field>
|
||||
<field name="model">sale.order</field>
|
||||
<field name="inherit_id" ref="sale.view_order_form" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath
|
||||
expr="//field[@name='order_line']/form//field[@name='price_subtotal']"
|
||||
position="after"
|
||||
>
|
||||
<label for="secondary_uom_qty" groups="uom.group_uom" />
|
||||
<div class="o_row" name="secondary_uom_qty" groups="uom.group_uom">
|
||||
<field
|
||||
name="secondary_uom_qty"
|
||||
class="oe_inline oe_no_button"
|
||||
widget="numeric_step"
|
||||
options="{'auto_select': True}"
|
||||
readonly="state in ['done', 'cancel']"
|
||||
/>
|
||||
|
||||
<field
|
||||
name="secondary_uom_id"
|
||||
class="oe_inline oe_no_button"
|
||||
domain="product_id and ['|', ('product_id', '=', product_id),
|
||||
'&', ('product_tmpl_id.product_variant_ids', 'in', [product_id]),
|
||||
('product_id', '=', False)] or [(0, '=', 1)]"
|
||||
options="{'no_create': True, 'no_open': True}"
|
||||
readonly="product_uom_readonly"
|
||||
required="secondary_uom_qty != 0.0"
|
||||
/>
|
||||
</div>
|
||||
</xpath>
|
||||
<xpath
|
||||
expr="//field[@name='order_line']/list//field[@name='product_uom_qty']"
|
||||
position="before"
|
||||
>
|
||||
<field
|
||||
name="secondary_uom_qty"
|
||||
column_invisible="parent.state in ('done', 'cancel')"
|
||||
groups="uom.group_uom"
|
||||
/>
|
||||
|
||||
<field
|
||||
name="secondary_uom_id"
|
||||
domain="product_id and ['|', ('product_id', '=', product_id),
|
||||
'&', ('product_tmpl_id.product_variant_ids', 'in', [product_id]),
|
||||
('product_id', '=', False)] or [(0, '=', 1)]"
|
||||
options="{'no_create': True}"
|
||||
readonly="product_uom_readonly"
|
||||
required="secondary_uom_qty != 0.0"
|
||||
groups="uom.group_uom"
|
||||
/>
|
||||
</xpath>
|
||||
<xpath
|
||||
expr="//field[@name='order_line']/kanban//field[@name='currency_id']"
|
||||
position="after"
|
||||
>
|
||||
<field name="secondary_uom_id" invisible="1" />
|
||||
<field name="secondary_uom_qty" invisible="1" />
|
||||
</xpath>
|
||||
<xpath
|
||||
expr="//field[@name='order_line']/kanban//field[@name='product_uom_qty']"
|
||||
position="before"
|
||||
>
|
||||
<t t-if="record.secondary_uom_id.value" groups="uom.group_uom">
|
||||
<t t-esc="record.secondary_uom_qty.value" />
|
||||
<t t-esc="record.secondary_uom_id.value" />
|
||||
</t>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user