From b9ff488785a5d688c4b26184a0b085d42e74cb80 Mon Sep 17 00:00:00 2001 From: Yannick Vaucher Date: Thu, 2 May 2013 17:17:56 +0200 Subject: [PATCH] [IMP] pricelist_share_companies - use orm.Model instead of alias osv.osv --- pricelist_share_companies/company.py | 9 +++------ pricelist_share_companies/pricelist.py | 12 ++++-------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/pricelist_share_companies/company.py b/pricelist_share_companies/company.py index 02340a8a79c..dd64a9111e1 100644 --- a/pricelist_share_companies/company.py +++ b/pricelist_share_companies/company.py @@ -26,10 +26,9 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # ############################################################################## +from openerp.osv import orm, fields -from osv import fields, osv - -class ResCompany(osv.osv): +class ResCompany(orm.Model): '''Override company to add the fields to use for the prices''' _inherit = 'res.company' @@ -53,6 +52,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: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/pricelist_share_companies/pricelist.py b/pricelist_share_companies/pricelist.py index 7d003a8521f..7c2065eed8f 100644 --- a/pricelist_share_companies/pricelist.py +++ b/pricelist_share_companies/pricelist.py @@ -26,15 +26,13 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # ############################################################################## +from openerp.osv import orm, fields -from osv import fields -from osv import osv - -class PriceType(osv.osv): +class PriceType(orm.Model): _inherit = 'product.price.type' _columns = { '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): @@ -78,6 +76,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: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: