From 2fd652f2060e700fda22d9c20200a39de8a0b4dd Mon Sep 17 00:00:00 2001 From: mtr Date: Wed, 12 Jan 2011 17:13:53 +0530 Subject: [PATCH] [IMP] pos:solved yaml warning message error,which occured when bank statement are in open state bzr revid: mtr@mtr-20110112114353-falxyn72h652kysg --- addons/point_of_sale/test/point_of_sale_test.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/addons/point_of_sale/test/point_of_sale_test.yml b/addons/point_of_sale/test/point_of_sale_test.yml index 7e463b1410a..de6ca13e70a 100755 --- a/addons/point_of_sale/test/point_of_sale_test.yml +++ b/addons/point_of_sale/test/point_of_sale_test.yml @@ -327,9 +327,18 @@ 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) + for journal in jou_obj.browse(cr, uid, journal_ids, context=context): + ids = statement_obj.search(cr, uid, [('state', '=', 'open'), ('user_id', '=', uid), ('journal_id', '=', journal.id)], 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. -