[IMP] point_of_sale: Removed company dependancy from Cash Registers being selected in the Make Payment wizard.

bzr revid: uco@tinyerp.com-20100917054237-6pya3ck7iz0xoupv
This commit is contained in:
uco (Open ERP)
2010-09-17 11:12:37 +05:30
parent 55116a7379
commit a87e3171aa
2 changed files with 6 additions and 4 deletions
@@ -36,8 +36,9 @@ def get_journal(self, cr, uid, context):
obj = self.pool.get('account.journal')
statement_obj = self.pool.get('account.bank.statement')
user = self.pool.get('res.users').browse(cr, uid, uid)
ids = obj.search(cr, uid, [('type', '=', 'cash'), ('company_id', '=', user.company_id.id)])
cr.execute("""select DISTINCT journal_id from pos_journal_users where user_id=%d order by journal_id"""%(uid))
j_ids = map(lambda x1: x1[0], cr.fetchall())
ids = obj.search(cr, uid, [('type', '=', 'cash'), ('id', 'in', j_ids)])
obj_ids= statement_obj.search(cr, uid, [('state', '!=', 'confirm'), ('user_id', '=', uid), ('journal_id', 'in', ids)])
res_obj = obj.read(cr, uid, ids, ['journal_id'], context)
res_obj = [(r1['id'])for r1 in res_obj]
+3 -2
View File
@@ -47,8 +47,9 @@ class pos_make_payment(osv.osv_memory):
active_id = context and context.get('active_id',False)
if active_id:
j_obj = self.pool.get('account.journal')
company_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.id
journal = j_obj.search(cr, uid, [('type', '=', 'cash'), ('company_id', '=', company_id)])
cr.execute("""select DISTINCT journal_id from pos_journal_users where user_id=%d order by journal_id"""%(uid))
j_ids = map(lambda x1: x1[0], cr.fetchall())
journal = j_obj.search(cr, uid, [('type', '=', 'cash'), ('id', 'in', j_ids)])
if journal:
journal = journal[0]