[MERGE] fix multi-company for pos
bzr revid: fp@openerp.com-20121103172128-rx5lvo5xzmsj9ay1
This commit is contained in:
commit
974ca267cf
|
@ -61,7 +61,7 @@ class account_bank_statement(osv.osv):
|
|||
return res
|
||||
|
||||
def _get_period(self, cr, uid, context=None):
|
||||
periods = self.pool.get('account.period').find(cr, uid)
|
||||
periods = self.pool.get('account.period').find(cr, uid,context=context)
|
||||
if periods:
|
||||
return periods[0]
|
||||
return False
|
||||
|
|
|
@ -308,6 +308,7 @@ class pos_session(osv.osv):
|
|||
# the .xml files as the CoA is not yet installed.
|
||||
jobj = self.pool.get('pos.config')
|
||||
pos_config = jobj.browse(cr, uid, config_id, context=context)
|
||||
context.update({'company_id': pos_config.shop_id.company_id.id})
|
||||
if not pos_config.journal_id:
|
||||
jid = jobj.default_get(cr, uid, ['journal_id'], context=context)['journal_id']
|
||||
if jid:
|
||||
|
@ -334,6 +335,7 @@ class pos_session(osv.osv):
|
|||
bank_values = {
|
||||
'journal_id' : journal.id,
|
||||
'user_id' : uid,
|
||||
'company_id' : pos_config.shop_id.company_id.id
|
||||
}
|
||||
statement_id = self.pool.get('account.bank.statement').create(cr, uid, bank_values, context=context)
|
||||
bank_statement_ids.append(statement_id)
|
||||
|
|
Loading…
Reference in New Issue