[FIX] sale, sale_stock: fixed calls to get_company taking an extra uid
bzr revid: tde@openerp.com-20130614143317-65mbgfugskxqnxp7
This commit is contained in:
parent
1a51e9b88d
commit
e738adfafe
|
@ -152,7 +152,7 @@ class sale_order(osv.osv):
|
|||
return result.keys()
|
||||
|
||||
def _get_default_company(self, cr, uid, context=None):
|
||||
company_id = self.pool.get('res.users')._get_company(cr, uid, uid, context=context)
|
||||
company_id = self.pool.get('res.users')._get_company(cr, uid, context=context)
|
||||
if not company_id:
|
||||
raise osv.except_osv(_('Error!'), _('There is no default company for the current user!'))
|
||||
return company_id
|
||||
|
|
|
@ -67,7 +67,7 @@ class sale_order(osv.osv):
|
|||
return order
|
||||
|
||||
def _get_default_warehouse(self, cr, uid, context=None):
|
||||
company_id = self.pool.get('res.users')._get_company(cr, uid, uid, context=context)
|
||||
company_id = self.pool.get('res.users')._get_company(cr, uid, context=context)
|
||||
warehouse_ids = self.pool.get('stock.warehouse').search(cr, uid, [('company_id', '=', company_id)], context=context)
|
||||
if not warehouse_ids:
|
||||
raise osv.except_osv(_('Error!'), _('There is no warehouse defined for current company.'))
|
||||
|
|
Loading…
Reference in New Issue