Skip to content

Commit

Permalink
[IMP] pricelist_share_companies - use orm.Model instead of alias osv.osv
Browse files Browse the repository at this point in the history
  • Loading branch information
yvaucher committed May 2, 2013
1 parent f0f1109 commit b9ff488
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
9 changes: 3 additions & 6 deletions pricelist_share_companies/company.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand All @@ -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:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
12 changes: 4 additions & 8 deletions pricelist_share_companies/pricelist.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

0 comments on commit b9ff488

Please sign in to comment.