[MERGE] pso: yml => if cash register already open

bzr revid: mra@mra-laptop-20110113045111-srbam4bdblr0siu7
This commit is contained in:
Mustufa Rangwala
2011-01-13 10:21:11 +05:30
@@ -327,9 +327,17 @@
I open the statement.
-
!python {model: pos.open.statement}: |
self.open_statement(cr, uid, [ref("pos_open_statement_0")], {"lang": "en_US", "active_model":
"ir.ui.menu", "active_ids": [ref("point_of_sale.menu_open_statement")], "tz":
False, "active_id": ref("point_of_sale.menu_open_statement"), })
jou_obj = self.pool.get('account.journal')
statement_obj = self.pool.get('account.bank.statement')
cr.execute("SELECT DISTINCT journal_id FROM pos_journal_users "
"WHERE user_id = %s ORDER BY journal_id"% (uid, ))
jou_ids = map(lambda x1: x1[0], cr.fetchall())
journal_ids = jou_obj.search(cr, uid, [('auto_cash', '=', True), ('type', '=', 'cash'), ('id', 'in', jou_ids)], context=context)
ids = statement_obj.search(cr, uid, [('state', '=', 'open'), ('user_id', '=', uid), ('journal_id', 'in', journal_ids)], context=context)
if not ids:
self.open_statement(cr, uid, [ref("pos_open_statement_0")], {"lang": "en_US", "active_model":
"ir.ui.menu", "active_ids": [ref("point_of_sale.menu_open_statement")], "tz":
False, "active_id": ref("point_of_sale.menu_open_statement"), })
-
I click on the "Make Payment" wizard.
-