Skip to content

Commit

Permalink
[MIG] product_pricelist_item_list_view: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
LoisRForgeFlow committed Oct 19, 2023
1 parent 7081746 commit a108f21
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 161 deletions.
2 changes: 0 additions & 2 deletions product_pricelist_item_list_view/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
# Copyright 2016 Lorenzo Battistini - Agile Business Group
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
# Copyright 2016 Lorenzo Battistini - Agile Business Group
# Copyright 2023 ForgeFlow S.L. (https://www.forgeflow.com)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

{
"name": "Pricelist rules list view",
"summary": "View and search the list of pricelist items",
"version": "9.0.1.0.0",
"version": "16.0.1.0.0",
"category": "Sales Management",
"website": "https://github.com/OCA/product-attribute",
"author": "Agile Business Group, Odoo Community Association (OCA)",
"author": "Agile Business Group, ForgeFlow, Odoo Community Association (OCA)",
"maintainers": ["LoisRForgeFlow"],
"development_status": "Production/Stable",
"license": "LGPL-3",
"application": False,
"installable": True,
"depends": [
"product",
"sale",
],
"data": [
"views/pricelist_view.xml",
Expand Down
182 changes: 28 additions & 154 deletions product_pricelist_item_list_view/views/pricelist_view.xml
Original file line number Diff line number Diff line change
@@ -1,174 +1,48 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="product_pricelist_item_search_view" model="ir.ui.view">
<field name="name">product.pricelist.item.search</field>
<field name="model">product.pricelist.item</field>
<field name="arch" type="xml">
<search string="Pricelist Rules">
<field name="pricelist_id" />
<field name="product_id" groups="product.group_product_variant" />
<field name="product_tmpl_id" />
<field name="categ_id" />
<field name="min_quantity" />
<field name="date_start" />
<field name="date_end" />
</search>
</field>
</record>
<record id="product_pricelist_item_tree_view" model="ir.ui.view">
<field name="name">product.pricelist.item.tree</field>
<field name="model">product.pricelist.item</field>
<field name="priority">99</field>
<field name="arch" type="xml">
<tree string="Pricelist Rules">
<field name="pricelist_id" />
<field name="product_id" groups="product.group_product_variant" />
<field name="product_tmpl_id" />
<field name="categ_id" />
<field name="min_quantity" />
<field name="date_start" />
<field name="date_end" />
</tree>
</field>
</record>

<record id="product_pricelist_item_form_view" model="ir.ui.view">
<field name="name">product.pricelist.item.form</field>
<field name="model">product.pricelist.item</field>
<field name="priority">99</field>
<field name="inherit_id" ref="product.product_pricelist_item_form_view" />
<field name="arch" type="xml">
<form string="Pricelist Items">
<h1><field name="name" /></h1>
<group>
<group>
<field name="pricelist_id" />
<field name="applied_on" widget="radio" />
<field
name="categ_id"
attrs="{'invisible':[('applied_on', '!=', '2_product_category')], 'required':[('applied_on', '=', '2_product_category')]}"
/>
<field
name="product_tmpl_id"
attrs="{'invisible':[('applied_on', '!=', '1_product')],'required':[('applied_on', '=', '1_product')]}"
string="Product"
/>
<field
name="product_id"
attrs="{'invisible':[('applied_on', '!=', '0_product_variant')],'required':[('applied_on', '=', '0_product_variant')]}"
string="Product Variant"
/>
</group>
<group>
<field name="min_quantity" />
<field name="date_start" />
<field name="date_end" />
</group>
</group>
<separator string="Price Computation" />
<group>
<group>
<label for="compute_price" string="Compute Price" />
<div>
<field name="compute_price" widget="radio" />
<field name="currency_id" invisible="1" />
<div
attrs="{'invisible':[('compute_price', '!=', 'fixed')]}"
>
<field
name="fixed_price"
nolabel="1"
widget='monetary'
options="{'currency_field': 'currency_id'}"
/></div>
<div
attrs="{'invisible':[('compute_price', '!=', 'percentage')]}"
>
<field
name="percent_price"
nolabel="1"
class="oe_inline"
/>%%
</div>
</div>
</group>
</group>
<div class="oe_grey" groups="product.group_uom">
<p
>The computed price is expressed in the default Unit of Measure of the product.</p>
</div>
<group
col="6"
attrs="{'invisible':[('compute_price', '!=', 'formula')]}"
>
<field name="base" colspan="6" />

<label string="New Price =" />
<div>
<span
attrs="{'invisible':[('base', '!=', 'list_price')]}"
>Public Price - </span>
<span
attrs="{'invisible':[('base', '!=', 'standard_price')]}"
>Cost - </span>
<span
attrs="{'invisible':[('base', '!=', 'pricelist')]}"
>Other Pricelist - </span>
</div>
<label for="price_discount" />
<div class="o_row">
<field name="price_discount" />
<span>%%</span>
</div>
<label string=" + " for="price_surcharge" />
<field name="price_surcharge" nolabel="1" />

<field name="price_round" string="Rounding Method" />
<field name="price_min_margin" string="Min. Margin" />
<field name="price_max_margin" string="Max. Margin" />

<field name="name" position="before">
<group name="pricelist">
<field
name="base_pricelist_id"
attrs="{'invisible':[('base', '!=', 'pricelist')],'required': [('base','=', 'pricelist')], 'readonly': [('base','!=', 'pricelist')]}"
name="pricelist_id"
invisible="not context.get('show_item_pricelist_id')"
/>
</group>
</form>
</field>
</field>
</record>

<record id="product_pricelist_items_action" model="ir.actions.act_window">
<field name="name">Pricelist Rules</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">product.pricelist.item</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="product_pricelist_item_search_view" />
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to create a pricelist rule.
</p><p>
Each rule include a set of applicability criteria (date range,
product category...) and a computation that easily helps to achieve
any kind of pricing.
</p>
<record id="product_pricelist_item_view_search" model="ir.ui.view">
<field name="name">product.pricelist.item.search</field>
<field name="model">product.pricelist.item</field>
<field name="inherit_id" ref="product.product_pricelist_item_view_search" />
<field name="arch" type="xml">
<field name="pricelist_id" position="after">
<field name="product_id" groups="product.group_product_variant" />
<field name="product_tmpl_id" />
<field name="categ_id" />
</field>
<filter name="Variant Rule" position="after">
<filter name="date_start" string="Start Date" date="date_start" />
<filter name="date_end" string="End Date" date="date_end" />
</filter>
</field>
</record>
<record id="product_pricelist_items_action_tree" model="ir.actions.act_window.view">
<field name="sequence" eval="1" />
<field name="act_window_id" ref="product_pricelist_items_action" />
<field name="view_id" ref="product_pricelist_item_tree_view" />
<field name="view_mode">tree</field>
</record>
<record id="product_pricelist_items_action_form" model="ir.actions.act_window.view">
<field name="sequence" eval="2" />
<field name="act_window_id" ref="product_pricelist_items_action" />
<field name="view_id" ref="product_pricelist_item_form_view" />
<field name="view_mode">form</field>

<record id="product.product_pricelist_item_action" model="ir.actions.act_window">
<field name="context">{'show_item_pricelist_id': 1}</field>
</record>

<menuitem
action="product_pricelist_items_action"
action="product.product_pricelist_item_action"
id="product_pricelist_items_action_menu"
parent="product.menu_product_pricelist_main"
sequence="2"
groups="product.group_sale_pricelist"
parent="sale.product_menu_catalog"
sequence="40"
groups="product.group_product_pricelist"
/>
</odoo>

This file was deleted.

This file was deleted.

0 comments on commit a108f21

Please sign in to comment.