[ADD]: Added common configuration for UoM per product group.

bzr revid: uco@tinyerp.com-20120312102702-xp63smj3qcn1eu31
This commit is contained in:
Ujjvala Collins (OpenERP)
2012-03-12 15:57:02 +05:30
parent abfa7ea555
commit e2c8783f1b
7 changed files with 71 additions and 12 deletions
+1
View File
@@ -23,5 +23,6 @@ import pricelist
import report
import partner
import wizard
import res_config
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+1 -1
View File
@@ -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>
+3 -2
View File
@@ -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>
+9 -9
View File
@@ -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"/>
+41
View File
@@ -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()
@@ -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"/>
@@ -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>