[FIX] product_sale_price_from_pricelist: Fix view syntax for Odoo 18
- Replace attrs syntax with new invisible attribute format - Fix settings view inheritance to use sale.res_config_settings_view_form - Add configuration setting in Sales > Pricing section - Place automatic price pricelist setting after standard pricelist config
This commit is contained in:
parent
fe137dc265
commit
ec9f5a572c
1 changed files with 42 additions and 25 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<data>
|
<data>
|
||||||
|
|
||||||
|
|
@ -9,16 +9,23 @@
|
||||||
<field name="inherit_id" ref="product.product_template_form_view" />
|
<field name="inherit_id" ref="product.product_template_form_view" />
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<field name="standard_price" position="attributes">
|
<field name="standard_price" position="attributes">
|
||||||
<attribute name="readonly">last_purchase_price_compute_type != 'manual_update'</attribute>
|
<attribute
|
||||||
|
name="readonly"
|
||||||
|
>last_purchase_price_compute_type != 'manual_update'</attribute>
|
||||||
</field>
|
</field>
|
||||||
<field name="standard_price" position="before">
|
<field name="standard_price" position="before">
|
||||||
<group string="Automatic Price Update" colspan="2" attrs="{'invisible': [('last_purchase_price_compute_type', '!=', 'automatic_update')]}">
|
<group
|
||||||
<field name="last_purchase_price_compute_type" readonly="1"/>
|
string="Automatic Price Update"
|
||||||
<field name="last_purchase_price_received"
|
colspan="2"
|
||||||
widget="monetary"
|
invisible="last_purchase_price_compute_type != 'automatic_update'"
|
||||||
options="{'currency_field': 'currency_id', 'field_digits': True}"
|
>
|
||||||
readonly="1"
|
<field name="last_purchase_price_compute_type" readonly="1" />
|
||||||
/>
|
<field
|
||||||
|
name="last_purchase_price_received"
|
||||||
|
widget="monetary"
|
||||||
|
options="{'currency_field': 'currency_id', 'field_digits': True}"
|
||||||
|
readonly="1"
|
||||||
|
/>
|
||||||
<field name="list_price_theoritical" readonly="1" />
|
<field name="list_price_theoritical" readonly="1" />
|
||||||
<field name="last_purchase_price_updated" readonly="1" />
|
<field name="last_purchase_price_updated" readonly="1" />
|
||||||
</group>
|
</group>
|
||||||
|
|
@ -29,29 +36,38 @@
|
||||||
<record id="product_view_inherit_tree_price_auto" model="ir.ui.view">
|
<record id="product_view_inherit_tree_price_auto" model="ir.ui.view">
|
||||||
<field name="name">product.template.tree.price.automatic</field>
|
<field name="name">product.template.tree.price.automatic</field>
|
||||||
<field name="model">product.template</field>
|
<field name="model">product.template</field>
|
||||||
<field name="inherit_id" ref="product.product_template_tree_view"/>
|
<field name="inherit_id" ref="product.product_template_tree_view" />
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//field[@name='list_price']" position="after">
|
<xpath expr="//field[@name='list_price']" position="after">
|
||||||
<field name="list_price_theoritical" optional="hide"/>
|
<field name="list_price_theoritical" optional="hide" />
|
||||||
<field name="last_purchase_price_received" optional="hide"/>
|
<field name="last_purchase_price_received" optional="hide" />
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="res_config_settings_view_form_pricelists" model="ir.ui.view">
|
<record id="res_config_settings_view_form_pricelists" model="ir.ui.view">
|
||||||
<field name="name">product.print.supermarket.res.config.settings.form</field>
|
<field
|
||||||
|
name="name"
|
||||||
|
>product.sale.price.pricelist.res.config.settings.form</field>
|
||||||
<field name="model">res.config.settings</field>
|
<field name="model">res.config.settings</field>
|
||||||
<field name="priority" eval="100" />
|
|
||||||
<field name="inherit_id" ref="sale.res_config_settings_view_form" />
|
<field name="inherit_id" ref="sale.res_config_settings_view_form" />
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//block[@id='pricing_setting_container']" position="inside">
|
<setting id="pricelist_configuration" position="after">
|
||||||
<setting name="supermarket_settings_container">
|
<setting
|
||||||
<div class="o_setting_right_pane">
|
id="automatic_price_calculation"
|
||||||
<label for="product_pricelist_automatic" string="Sale Price Pricelist" />
|
string="Automatic Price from Purchase"
|
||||||
<field name="product_pricelist_automatic" />
|
help="Automatically calculate product sale prices from purchase prices using a pricelist"
|
||||||
</div>
|
>
|
||||||
|
<field
|
||||||
|
name="product_pricelist_automatic"
|
||||||
|
invisible="not group_product_pricelist"
|
||||||
|
domain="[('active', '=', True)]"
|
||||||
|
/>
|
||||||
|
<div class="text-muted">
|
||||||
|
Select the pricelist used to calculate sale prices from last purchase prices
|
||||||
|
</div>
|
||||||
</setting>
|
</setting>
|
||||||
</xpath>
|
</setting>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|
@ -64,7 +80,8 @@
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//filter[@name='services']" position="before">
|
<xpath expr="//filter[@name='services']" position="before">
|
||||||
<separator />
|
<separator />
|
||||||
<filter string="To update sales price"
|
<filter
|
||||||
|
string="To update sales price"
|
||||||
name="products_updated_filter"
|
name="products_updated_filter"
|
||||||
domain="[('last_purchase_price_updated', '=', True), ('last_purchase_price_compute_type', '!=', 'manual_update')]"
|
domain="[('last_purchase_price_updated', '=', True), ('last_purchase_price_compute_type', '!=', 'manual_update')]"
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue