summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUjjvala Collins (OpenERP) <uco@tinyerp.com>2012-03-12 15:57:02 +0530
committerUjjvala Collins (OpenERP) <uco@tinyerp.com>2012-03-12 15:57:02 +0530
commite2c8783f1b48c90e22f23202a45eaec9aafd1d18 (patch)
treeb3187e1a695474be6c993dd86dc58d0ba771baed
parentabfa7ea5559caa2ecf224cc27cf5b80ea616ceee (diff)
[ADD]: Added common configuration for UoM per product group.
bzr revid: uco@tinyerp.com-20120312102702-xp63smj3qcn1eu31
-rw-r--r--addons/product/__init__.py1
-rw-r--r--addons/product/partner_view.xml2
-rw-r--r--addons/product/pricelist_view.xml5
-rw-r--r--addons/product/product_view.xml18
-rw-r--r--addons/product/res_config.py41
-rw-r--r--addons/product/security/product_security.xml15
-rw-r--r--addons/product/wizard/product_price_view.xml1
7 files changed, 71 insertions, 12 deletions
diff --git a/addons/product/__init__.py b/addons/product/__init__.py
index 4247b49d41b..a7e0be09dc5 100644
--- a/addons/product/__init__.py
+++ b/addons/product/__init__.py
@@ -23,5 +23,6 @@ import pricelist
import report
import partner
import wizard
+import res_config
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/product/partner_view.xml b/addons/product/partner_view.xml
index 51d012b8577..f40c5ab8032 100644
--- a/addons/product/partner_view.xml
+++ b/addons/product/partner_view.xml
@@ -9,7 +9,7 @@
<field name="arch" type="xml">
<page string="Sales &amp; Purchases" position="inside">
<newline/>
- <group col="2" colspan="2" groups="base.group_extended">
+ <group col="2" colspan="2" groups="base.group_sale_pricelist_per_customer">
<separator string="Sales Properties" colspan="2"/>
<field name="property_product_pricelist"/>
</group>
diff --git a/addons/product/pricelist_view.xml b/addons/product/pricelist_view.xml
index 3ddfe1e6900..47031878768 100644
--- a/addons/product/pricelist_view.xml
+++ b/addons/product/pricelist_view.xml
@@ -4,7 +4,8 @@
<menuitem id="base.menu_sale_config_sales" name="Sales"
parent="base.menu_base_config" sequence="0" groups="base.group_extended"/>
- <menuitem groups="base.group_extended" id="menu_product_pricelist_main" name="Pricelists" parent="base.menu_base_config" sequence="50"/>
+ <menuitem id="menu_product_pricelist_main" name="Pricelists"
+ parent="base.menu_base_config" groups="base.group_sale_pricelist_per_customer" sequence="50"/>
<record id="product_pricelist_version_form_view" model="ir.ui.view">
<field name="name">product.pricelist.version.form</field>
@@ -195,7 +196,7 @@
</form>
</field>
</record>
-
+
<record id="product_price_type_action" model="ir.actions.act_window">
<field name="name">Price Types</field>
<field name="type">ir.actions.act_window</field>
diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml
index a1857748b9d..d2fea171345 100644
--- a/addons/product/product_view.xml
+++ b/addons/product/product_view.xml
@@ -20,7 +20,7 @@
<field name="categ_id" widget="selection" operator="child_of" groups="base.group_extended"/>
<newline/>
<group expand="0" string="Context..." groups="base.group_extended">
- <field name="pricelist_id" widget="selection" context="{'pricelist': self}" />
+ <field name="pricelist_id" widget="selection" context="{'pricelist': self}" groups="base.group_sale_pricelist_per_customer"/>
<separator orientation="vertical" groups="base.group_multi_company" />
<field name="company_id" widget="selection" groups="base.group_multi_company" />
</group>
@@ -50,7 +50,7 @@
<field name="name"/>
<field name="categ_id" invisible="1"/>
<field name="variants" groups="product.group_product_variant"/>
- <field name="uom_id" string="UoM"/>
+ <field name="uom_id" string="UoM" groups="base.group_sale_uom_per_product"/>
<field name="type"/>
<field name="qty_available"/>
<field name="virtual_available"/>
@@ -87,7 +87,7 @@
</group>
<group colspan="1" col="1">
<field name="product_image" widget='image' nolabel="1"/>
- </group>
+ </group>
</group>
<notebook colspan="4">
@@ -125,11 +125,11 @@
<group colspan="2" col="2" name="uom">
<separator string="Unit of Measure" colspan="2"/>
- <field name="uom_id" on_change="onchange_uom(uom_id,uom_po_id)"/>
+ <field name="uom_id" on_change="onchange_uom(uom_id,uom_po_id)" groups="base.group_sale_uom_per_product"/>
<field name="uom_po_id" groups="base.group_extended"/>
</group>
- <group colspan="2" col="2" name="uos" groups="product.group_uos">
+ <group colspan="2" col="2" name="uos" groups="base.group_sale_uom_per_product">
<separator string="Second UoM" colspan="2"/>
<field name="uos_id"/>
<field name="uos_coeff"/>
@@ -440,7 +440,7 @@
<field name="view_id" ref="product_uom_tree_view"/>
<field name="help">Create and manage the units of measure you want to be used in your system. You can define a conversion rate between several Units of Measure within the same category.</field>
</record>
- <menuitem id="next_id_16" name="Units of Measure" parent="prod_config_main" sequence="65"/>
+ <menuitem id="next_id_16" name="Units of Measure" parent="prod_config_main" sequence="65" groups="base.group_sale_uom_per_product"/>
<menuitem action="product_uom_form_action" id="menu_product_uom_form_action" parent="next_id_16"/>
<record id="product_uom_categ_form_view" model="ir.ui.view">
@@ -552,7 +552,7 @@
<field name="product_uom"/>
<field name="delay"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
- <field colspan="4" groups="base.group_extended" name="pricelist_ids" nolabel="1" widget="one2many_list">
+ <field colspan="4" groups="base.group_sale_pricelist_per_customer" name="pricelist_ids" nolabel="1" widget="one2many_list">
<tree editable="bottom" string="Pricelist">
<field name="min_quantity"/>
<field name="price"/>
@@ -674,11 +674,11 @@
<group colspan="2" col="2" name="uom">
<separator string="UOM" colspan="2"/>
- <field name="uom_id" on_change="onchange_uom(uom_id,uom_po_id)"/>
+ <field name="uom_id" on_change="onchange_uom(uom_id,uom_po_id)" groups="base.group_sale_uom_per_product"/>
<field name="uom_po_id" groups="base.group_extended"/>
</group>
- <group colspan="2" col="2" name="uos" groups="product.group_uos">
+ <group colspan="2" col="2" name="uos" groups="base.group_sale_uom_per_product">
<separator string="Second UoM" colspan="2"/>
<field name="uos_id"/>
<field name="uos_coeff"/>
diff --git a/addons/product/res_config.py b/addons/product/res_config.py
new file mode 100644
index 00000000000..78d5e4caac9
--- /dev/null
+++ b/addons/product/res_config.py
@@ -0,0 +1,41 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from osv import fields, osv
+
+class product_groups_configuration(osv.osv_memory):
+ _inherit = 'res.config.settings'
+
+ _columns = {
+ 'group_sale_pricelist_per_customer':fields.boolean("Pricelist per customer",
+ group='base.group_user', implied_group='base.group_sale_pricelist_per_customer',
+ help="""Allows to manage different prices based on rules per category of customers.
+ Example: 10% for retailers, promotion of 5 EUR on this product, etc.
+ It assigns the "Pricelist" group to all employees."""),
+ 'group_sale_uom_per_product':fields.boolean("UOM per product",
+ group='base.group_user', implied_group='base.group_sale_uom_per_product',
+ help="""
+ Allows you to select and maintain different unit of measures per product.
+ It assigns the "UOM per product" group to all employees.
+ """),
+}
+
+product_groups_configuration() \ No newline at end of file
diff --git a/addons/product/security/product_security.xml b/addons/product/security/product_security.xml
index 5c993b9cd61..4fb1331201b 100644
--- a/addons/product/security/product_security.xml
+++ b/addons/product/security/product_security.xml
@@ -19,6 +19,21 @@
<field name="category_id" ref="base.module_category_usability"/>
</record>
+ <record id="base.group_sale_pricelist_per_customer" model="res.groups">
+ <field name="name">Sales Pricelists</field>
+ <field name="category_id" ref="base.module_category_hidden"/>
+ </record>
+
+ <record id="base.group_sale_uom_per_product" model="res.groups">
+ <field name="name">Product UOM</field>
+ <field name="category_id" ref="base.module_category_hidden"/>
+ </record>
+
+ <record id="base.group_user" model="res.groups">
+ <field name="implied_ids" eval="[(6,0,[ref('base.group_sale_pricelist_per_customer'),
+ ref('base.group_sale_uom_per_product')])]"/>
+ </record>
+
<record model="ir.rule" id="product_pricelist_comp_rule">
<field name="name">product pricelist company rule</field>
<field name="model_id" ref="model_product_pricelist"/>
diff --git a/addons/product/wizard/product_price_view.xml b/addons/product/wizard/product_price_view.xml
index 91fb931b6fa..63ffc6e033c 100644
--- a/addons/product/wizard/product_price_view.xml
+++ b/addons/product/wizard/product_price_view.xml
@@ -31,6 +31,7 @@
name="Price List"
res_model="product.price_list"
src_model="product.product"
+ groups="base.group_sale_pricelist_per_customer"
view_mode="form" target="new" view_type="form" />
</data>