From f5cea07b866d18cd4ef20de39bcbcef4834acf0f Mon Sep 17 00:00:00 2001 From: pso Date: Tue, 28 Dec 2010 17:44:59 +0530 Subject: [PATCH] [ADD] product_multi_company: Added new module for several prices, one for each company bzr revid: pso@tinyerp.com-20101228121459-9yyaxxqlm5h59ie1 --- addons/product_multi_company/__init__.py | 24 ++++++++ addons/product_multi_company/__openerp__.py | 39 +++++++++++++ addons/product_multi_company/i18n/en_US.po | 32 +++++++++++ addons/product_multi_company/i18n/fr.po | 32 +++++++++++ .../i18n/product_multi_company.pot | 32 +++++++++++ .../product_multi_company.py | 56 +++++++++++++++++++ 6 files changed, 215 insertions(+) create mode 100644 addons/product_multi_company/__init__.py create mode 100644 addons/product_multi_company/__openerp__.py create mode 100644 addons/product_multi_company/i18n/en_US.po create mode 100644 addons/product_multi_company/i18n/fr.po create mode 100644 addons/product_multi_company/i18n/product_multi_company.pot create mode 100644 addons/product_multi_company/product_multi_company.py diff --git a/addons/product_multi_company/__init__.py b/addons/product_multi_company/__init__.py new file mode 100644 index 00000000000..34163abb1a2 --- /dev/null +++ b/addons/product_multi_company/__init__.py @@ -0,0 +1,24 @@ +# -*- 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 . +# +############################################################################## + +import product_multi_company + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/product_multi_company/__openerp__.py b/addons/product_multi_company/__openerp__.py new file mode 100644 index 00000000000..1697331e56f --- /dev/null +++ b/addons/product_multi_company/__openerp__.py @@ -0,0 +1,39 @@ +# -*- 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 . +# +############################################################################## + +{ + "name" : "Product multi company ", + "version" : "1.1", + "author" : "OpenERP SA", + "category" : "Generic Modules/Inventory Control", + "depends" : [ "product"], + "init_xml" : [], + "demo_xml" : [], + "description": """ + This module defines several prices, one for each company. + """, + 'update_xml': [], + 'test':[], + 'installable': True, + 'active': False, +} + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/product_multi_company/i18n/en_US.po b/addons/product_multi_company/i18n/en_US.po new file mode 100644 index 00000000000..e8510fe0bcd --- /dev/null +++ b/addons/product_multi_company/i18n/en_US.po @@ -0,0 +1,32 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * product_multi_company +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 6.0.0-rc1\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2010-12-28 12:10:13+0000\n" +"PO-Revision-Date: 2010-12-28 12:10:13+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: product_multi_company +#: model:ir.model,name:product_multi_company.model_product_template +msgid "Product Template" +msgstr "" + +#. module: product_multi_company +#: constraint:product.template:0 +msgid "Error: The default UOM and the purchase UOM must be in the same category." +msgstr "" + +#. module: product_multi_company +#: model:ir.model,name:product_multi_company.model_pricelist_partnerinfo +msgid "pricelist.partnerinfo" +msgstr "" + diff --git a/addons/product_multi_company/i18n/fr.po b/addons/product_multi_company/i18n/fr.po new file mode 100644 index 00000000000..e8510fe0bcd --- /dev/null +++ b/addons/product_multi_company/i18n/fr.po @@ -0,0 +1,32 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * product_multi_company +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 6.0.0-rc1\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2010-12-28 12:10:13+0000\n" +"PO-Revision-Date: 2010-12-28 12:10:13+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: product_multi_company +#: model:ir.model,name:product_multi_company.model_product_template +msgid "Product Template" +msgstr "" + +#. module: product_multi_company +#: constraint:product.template:0 +msgid "Error: The default UOM and the purchase UOM must be in the same category." +msgstr "" + +#. module: product_multi_company +#: model:ir.model,name:product_multi_company.model_pricelist_partnerinfo +msgid "pricelist.partnerinfo" +msgstr "" + diff --git a/addons/product_multi_company/i18n/product_multi_company.pot b/addons/product_multi_company/i18n/product_multi_company.pot new file mode 100644 index 00000000000..e8510fe0bcd --- /dev/null +++ b/addons/product_multi_company/i18n/product_multi_company.pot @@ -0,0 +1,32 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * product_multi_company +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 6.0.0-rc1\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2010-12-28 12:10:13+0000\n" +"PO-Revision-Date: 2010-12-28 12:10:13+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: product_multi_company +#: model:ir.model,name:product_multi_company.model_product_template +msgid "Product Template" +msgstr "" + +#. module: product_multi_company +#: constraint:product.template:0 +msgid "Error: The default UOM and the purchase UOM must be in the same category." +msgstr "" + +#. module: product_multi_company +#: model:ir.model,name:product_multi_company.model_pricelist_partnerinfo +msgid "pricelist.partnerinfo" +msgstr "" + diff --git a/addons/product_multi_company/product_multi_company.py b/addons/product_multi_company/product_multi_company.py new file mode 100644 index 00000000000..1b1166cbc41 --- /dev/null +++ b/addons/product_multi_company/product_multi_company.py @@ -0,0 +1,56 @@ +# -*- 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 osv, fields + +class product_template(osv.osv): + _inherit = "product.template" + _columns={ + 'list_price': fields.property('product.template', + type='float', + string='Public Price', + method=True, + view_load=True, + required=True, size=64), + 'standard_price': fields.property('product.template', + type='float', + string='Standard Price', + method=True, + view_load=True, + required=True, size=64, + help="Product's cost for accounting stock valuation. It is the base price for the supplier price."), + } +product_template() + +class pricelist_partnerinfo(osv.osv): + _inherit = 'pricelist.partnerinfo' + _columns = { + 'price': fields.property('pricelist.partnerinfo', + type='float', + string='Seller Price', + method=True, + view_load=True, + required=True, size=64, + help="This price will be considered as a price for the supplier UoM if any or the default Unit of Measure of the product otherwise"), + } +pricelist_partnerinfo() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file