diff --git a/pricelist_share_companies/__init__.py b/pricelist_share_companies/__init__.py
index 7677c585491..64678f58866 100644
--- a/pricelist_share_companies/__init__.py
+++ b/pricelist_share_companies/__init__.py
@@ -1,29 +1,21 @@
# -*- coding: utf-8 -*-
##############################################################################
#
-# Copyright (c) 2010 Camtocamp SA
-# @author Joël Grand-Guillaume
+# Author: Joël Grand-Guillaume
+# Copyright 2010 Camptocamp SA
#
-# WARNING: This program as such is intended to be used by professional
-# programmers who take the whole responsability of assessing all potential
-# consequences resulting from its eventual inadequacies and bugs
-# End users who are looking for a ready-to-use solution with commercial
-# garantees and support are strongly adviced to contract a Free Software
-# Service Company
+# 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 Free Software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# 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.
#
-# 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 General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
#
##############################################################################
import pricelist
diff --git a/pricelist_share_companies/__openerp__.py b/pricelist_share_companies/__openerp__.py
index 3032d271cf6..9275e6db407 100644
--- a/pricelist_share_companies/__openerp__.py
+++ b/pricelist_share_companies/__openerp__.py
@@ -1,37 +1,30 @@
# -*- coding: utf-8 -*-
##############################################################################
#
-# @author Grand-Guillaume Joel
-# WARNING: This program as such is intended to be used by professional
-# programmers who take the whole responsability of assessing all potential
-# consequences resulting from its eventual inadequacies and bugs
-# End users who are looking for a ready-to-use solution with commercial
-# garantees and support are strongly adviced to contract a Free Software
-# Service Company
+# Author: Joël Grand-Guillaume
+# Copyright 2010 Camptocamp SA
#
-# This program is Free Software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
+# 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 General Public License for more details.
+# 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 General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
#
##############################################################################
{
- "name" : "Share pricelist between compagnies, not product",
- "version" : "1.0",
- "author" : "Camptocamp",
- "category" : "Generic Modules/Projects & Services",
- "description":
-"""
+ 'name' : 'Share pricelist between compagnies, not product',
+ 'version' : '1.0',
+ 'category' : 'Generic Modules/Projects & Services',
+ 'description':
+'''
In OpenERP, product prices (cost, list) are expressed in the currency of the price_type (by default the same than your company currency).
The idea here is to have the same products between compagnies (with each one their own currency through different price_type and different costs) but
@@ -40,9 +33,9 @@
Concretely, to have a different cost price for a second company, you have to :
- Create a new standard price on product.template
- - Create a new "Price Type" on this new field, with the desired currency and assigned to the new currency
- - Assign the existing "Cost Price" to your main company
- - On the setup of each company, in the "Configuration"'s Tab, select the product field used for the cost
+ - Create a new 'Price Type' on this new field, with the desired currency and assigned to the new currency
+ - Assign the existing 'Cost Price' to your main company
+ - On the setup of each company, in the 'Configuration''s Tab, select the product field used for the cost
The Price Type used is the first one found for the cost field configured on the company. To ensure the right Price Type
is selected, you have to put the company on the Price Types, and according to the security rule created, you will have access
@@ -62,18 +55,20 @@
Product A in company B: The cost price is 70 * currency rate
-""",
- "website": "http://camptocamp.com",
- "depends" : [
- "product",
- ],
- "init_xml" : [],
- "demo_xml" : [],
- "update_xml" : [
- "pricelist_view.xml",
- "company_view.xml",
- "security/pricelist_security.xml",
- ],
- "active": False,
- 'installable': False
+''',
+ 'author' : 'Camptocamp',
+ 'website': 'http://camptocamp.com',
+ 'depends' : ['product',],
+ 'data' : [
+ 'pricelist_view.xml',
+ 'company_view.xml',
+ 'security/pricelist_security.xml',
+ ],
+ 'demo' : [],
+ 'test': [],
+ 'installable': True,
+ 'auto_install': False,
+ 'application': False
}
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/pricelist_share_companies/company.py b/pricelist_share_companies/company.py
index 17d5c22dc05..fd5c0922243 100644
--- a/pricelist_share_companies/company.py
+++ b/pricelist_share_companies/company.py
@@ -1,40 +1,32 @@
# -*- coding: utf-8 -*-
##############################################################################
#
-# Copyright (c) 2011 Camtocamp SA
-# @author Guewen Baconnier
+# Author: Guewen Baconnier
+# Copyright 2011 Camptocamp SA
#
-# WARNING: This program as such is intended to be used by professional
-# programmers who take the whole responsability of assessing all potential
-# consequences resulting from its eventual inadequacies and bugs
-# End users who are looking for a ready-to-use solution with commercial
-# garantees and support are strongly adviced to contract a Free Software
-# Service Company
+# 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 Free Software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# 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.
#
-# 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 General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
#
##############################################################################
+from openerp.osv import orm, fields
-from osv import fields, osv
-
-
-class ResCompany(osv.osv):
- """Override company to add the fields to use for the prices"""
+class ResCompany(orm.Model):
+ '''Override company to add the fields to use for the prices'''
_inherit = 'res.company'
def _price_field_get(self, cr, uid, context=None):
+ if context is None:
+ context = {}
mf = self.pool.get('ir.model.fields')
ids = mf.search(cr, uid,
[('model','in', (('product.product'),('product.template'))),
@@ -52,4 +44,4 @@ def _price_field_get(self, cr, uid, context=None):
"on the search of a Cost Price's Price Type.")
}
-ResCompany()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/pricelist_share_companies/company_view.xml b/pricelist_share_companies/company_view.xml
index 9e672aff8d9..35929157b60 100644
--- a/pricelist_share_companies/company_view.xml
+++ b/pricelist_share_companies/company_view.xml
@@ -1,22 +1,22 @@
-
+
-
- res.company.form.inherit
- res.company
-
- form
-
-
-
-
-
-
-
-
-
-
+
+ res.company.form.inherit
+ res.company
+
+
+
+
+
+
+
+
+
+
+
+
-
+
diff --git a/pricelist_share_companies/pricelist.py b/pricelist_share_companies/pricelist.py
index d4ea58c49c7..f2a3a61355c 100644
--- a/pricelist_share_companies/pricelist.py
+++ b/pricelist_share_companies/pricelist.py
@@ -1,42 +1,30 @@
# -*- coding: utf-8 -*-
##############################################################################
#
-# Copyright (c) 2011 Camtocamp SA
-# @author Guewen Baconnier
+# Author: Guewen Baconnier
+# Copyright 2011 Camptocamp SA
#
-# WARNING: This program as such is intended to be used by professional
-# programmers who take the whole responsability of assessing all potential
-# consequences resulting from its eventual inadequacies and bugs
-# End users who are looking for a ready-to-use solution with commercial
-# garantees and support are strongly adviced to contract a Free Software
-# Service Company
+# 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 Free Software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# 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.
#
-# 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 General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
#
##############################################################################
+from openerp.osv import orm, fields
-from osv import fields
-from osv import osv
-
-
-class PriceType(osv.osv):
- _inherit = "product.price.type"
-
+class PriceType(orm.Model):
+ _inherit = 'product.price.type'
_columns = {
- "company_id" : fields.many2one('res.company', "Company"),
- }
+ 'company_id' : fields.many2one('res.company', 'Company'),
+ }
def _check_unicity_per_company(self, cr, uid, ids, context=None):
for price_type in self.browse(cr, uid, ids, context=context):
@@ -80,5 +68,4 @@ def replace_args(search_args, ptype, company):
return super(PriceType, self).search(cr, uid, args1, offset, limit, order, context=context, count=count)
-
-PriceType()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/pricelist_share_companies/pricelist_view.xml b/pricelist_share_companies/pricelist_view.xml
index 4e8432d8a94..9be7cceb8f1 100644
--- a/pricelist_share_companies/pricelist_view.xml
+++ b/pricelist_share_companies/pricelist_view.xml
@@ -1,18 +1,17 @@
-
+
-
- product.price.type.form
- product.price.type
-
- form
-
-
-
-
-
-
+
+ product.price.type.form
+ product.price.type
+
+
+
+
+
+
+
-
+
diff --git a/pricelist_share_companies/security/pricelist_security.xml b/pricelist_share_companies/security/pricelist_security.xml
index 4e92c218f3c..a8cb8a8baeb 100644
--- a/pricelist_share_companies/security/pricelist_security.xml
+++ b/pricelist_share_companies/security/pricelist_security.xml
@@ -1,13 +1,13 @@
-
+
- Product price type multi-company
-
-
- ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
+ Product price type multi-company
+
+
+ ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
-
+