Skip to content

Commit

Permalink
[IMP] product_pricelist_item_list_view: pre-commit stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
LoisRForgeFlow committed Oct 16, 2023
1 parent f1ae206 commit 7081746
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 59 deletions.
1 change: 0 additions & 1 deletion product_pricelist_item_list_view/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
# -*- coding: utf-8 -*-
# Copyright 2016 Lorenzo Battistini - Agile Business Group
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
5 changes: 2 additions & 3 deletions product_pricelist_item_list_view/__openerp__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2016 Lorenzo Battistini - Agile Business Group
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

Expand All @@ -7,7 +6,7 @@
"summary": "View and search the list of pricelist items",
"version": "9.0.1.0.0",
"category": "Sales Management",
"website": "https://www.agilebg.com",
"website": "https://github.com/OCA/product-attribute",
"author": "Agile Business Group, Odoo Community Association (OCA)",
"license": "LGPL-3",
"application": False,
Expand All @@ -16,6 +15,6 @@
"product",
],
"data": [
'views/pricelist_view.xml',
"views/pricelist_view.xml",
],
}
151 changes: 96 additions & 55 deletions product_pricelist_item_list_view/views/pricelist_view.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<?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"/>
<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>
Expand All @@ -21,13 +21,13 @@
<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"/>
<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>
Expand All @@ -37,61 +37,98 @@
<field name="priority">99</field>
<field name="arch" type="xml">
<form string="Pricelist Items">
<h1><field name="name"/></h1>
<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"/>
<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"/>
<field name="min_quantity" />
<field name="date_start" />
<field name="date_end" />
</group>
</group>
<separator string="Price Computation"/>
<separator string="Price Computation" />
<group>
<group>
<label for="compute_price" string="Compute Price"/>
<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"/>%%
<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>
<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"/>
<group
col="6"
attrs="{'invisible':[('compute_price', '!=', 'formula')]}"
>
<field name="base" colspan="6" />

<label string="New Price ="/>
<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>
<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"/>
<label for="price_discount" />
<div class="o_row">
<field name="price_discount"/>
<field name="price_discount" />
<span>%%</span>
</div>
<label string=" + " for="price_surcharge"/>
<field name="price_surcharge" nolabel="1"/>
<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="price_round" string="Rounding Method" />
<field name="price_min_margin" string="Min. Margin" />
<field name="price_max_margin" string="Max. Margin" />

<field name="base_pricelist_id" attrs="{'invisible':[('base', '!=', 'pricelist')],'required': [('base','=', 'pricelist')], 'readonly': [('base','!=', 'pricelist')]}"/>
<field
name="base_pricelist_id"
attrs="{'invisible':[('base', '!=', 'pricelist')],'required': [('base','=', 'pricelist')], 'readonly': [('base','!=', 'pricelist')]}"
/>
</group>
</form>
</field>
Expand All @@ -115,19 +152,23 @@
</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="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="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>

<menuitem
action="product_pricelist_items_action" id="product_pricelist_items_action_menu"
parent="product.menu_product_pricelist_main" sequence="2" groups="product.group_sale_pricelist"/>
action="product_pricelist_items_action"
id="product_pricelist_items_action_menu"
parent="product.menu_product_pricelist_main"
sequence="2"
groups="product.group_sale_pricelist"
/>
</odoo>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
6 changes: 6 additions & 0 deletions setup/product_pricelist_item_list_view/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)

0 comments on commit 7081746

Please sign in to comment.