From e2c8783f1b48c90e22f23202a45eaec9aafd1d18 Mon Sep 17 00:00:00 2001 From: "Ujjvala Collins (OpenERP)" Date: Mon, 12 Mar 2012 15:57:02 +0530 Subject: [PATCH 1/2] [ADD]: Added common configuration for UoM per product group. bzr revid: uco@tinyerp.com-20120312102702-xp63smj3qcn1eu31 --- addons/product/__init__.py | 1 + addons/product/partner_view.xml | 2 +- addons/product/pricelist_view.xml | 5 ++- addons/product/product_view.xml | 18 ++++----- addons/product/res_config.py | 41 ++++++++++++++++++++ addons/product/security/product_security.xml | 15 +++++++ addons/product/wizard/product_price_view.xml | 1 + 7 files changed, 71 insertions(+), 12 deletions(-) create mode 100644 addons/product/res_config.py 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 @@ - + 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 @@ - + product.pricelist.version.form @@ -195,7 +196,7 @@ - + Price Types ir.actions.act_window 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 @@ - + @@ -50,7 +50,7 @@ - + @@ -87,7 +87,7 @@ - + @@ -125,11 +125,11 @@ - + - + @@ -440,7 +440,7 @@ 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. - + @@ -552,7 +552,7 @@ - + @@ -674,11 +674,11 @@ - + - + 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 (). +# +# 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 . +# +############################################################################## + +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 @@ + + Sales Pricelists + + + + + Product UOM + + + + + + + product pricelist company rule 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" /> From 65d466b4fea6b19504b932fdf53e53ce8ae3fc5f Mon Sep 17 00:00:00 2001 From: "Ujjvala Collins (OpenERP)" Date: Mon, 12 Mar 2012 16:26:55 +0530 Subject: [PATCH 2/2] [ADD]: Added remaining groups for suppliers and stock packaging. bzr revid: uco@tinyerp.com-20120312105655-gzs4nci80gzlsnld --- addons/product/res_config.py | 9 ++++++++- addons/product/security/product_security.xml | 14 +++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/addons/product/res_config.py b/addons/product/res_config.py index 78d5e4caac9..4db8af75781 100644 --- a/addons/product/res_config.py +++ b/addons/product/res_config.py @@ -25,7 +25,7 @@ class product_groups_configuration(osv.osv_memory): _inherit = 'res.config.settings' _columns = { - 'group_sale_pricelist_per_customer':fields.boolean("Pricelist per customer", + '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. @@ -36,6 +36,13 @@ class product_groups_configuration(osv.osv_memory): Allows you to select and maintain different unit of measures per product. It assigns the "UOM per product" group to all employees. """), + 'group_purchase_pricelist_per_supplier':fields.boolean("Pricelist per Supplier", group='base.group_user', xml_id='base.group_purchase_pricelist_per_supplier', + help="""Allows to manage different prices based on rules per category of Supplier. + Example: 10% for retailers, promotion of 5 EUR on this product, etc. + It assigns the "Pricelist" group to all employees."""), + 'group_stock_packaging':fields.boolean("Manage packaging by products", group='base.group_user', implied_group='base.group_stock_packaging', + help=""" Allows you to create and manage your packaging dimensions and types you want to be maintained in your system. + It assigns the "Packaging" group to employee."""), } 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 4fb1331201b..17938251af4 100644 --- a/addons/product/security/product_security.xml +++ b/addons/product/security/product_security.xml @@ -23,15 +23,27 @@ Sales Pricelists + + + Purchase Pricelists + + Product UOM + + + Packaging + + + ref('base.group_sale_uom_per_product'), + ref('base.group_purchase_pricelist_per_supplier'), + ref('base.group_stock_packaging')])]"/>