diff options
| author | sbh (Open ERP) <sbh@tinyerp.com> | 2010-05-06 18:08:34 +0530 |
|---|---|---|
| committer | sbh (Open ERP) <sbh@tinyerp.com> | 2010-05-06 18:08:34 +0530 |
| commit | 56ded53b7c4ecc641bb26ee15d6f0d72b900ebed (patch) | |
| tree | 59388ffe97d2b89024aab7a75c67409388e80ac1 | |
| parent | 163d2bb69d252a60385326fe21f98dc4609254d0 (diff) | |
[Fix] point_of_sale: Fix the problem of active_id in pos_payment
bzr revid: sbh@tinyerp.com-20100506123834-e72pyj3ahb9d0jvl
| -rw-r--r-- | addons/point_of_sale/wizard/pos_payment.py | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/addons/point_of_sale/wizard/pos_payment.py b/addons/point_of_sale/wizard/pos_payment.py index 2b64d06d440..f5bc1ea9d8c 100644 --- a/addons/point_of_sale/wizard/pos_payment.py +++ b/addons/point_of_sale/wizard/pos_payment.py @@ -105,20 +105,23 @@ class pos_make_payment(osv.osv_memory): active_model = context.get('active_model') if not active_model and active_model != 'pos.order': return result - active_id = context.get('active_id', False) + active_id = context.get('active_id', False) if active_id: - order = self.pool.get('pos.order').browse(cr, uid, active_id) - if order.amount_total == order.amount_paid: - res['arch'] = """ <form string="Make Payment" colspan="4"> - <group col="2" colspan="2"> - <label string="Do you want to print the Receipt?" colspan="4"/> - <separator colspan="4"/> - <button icon="gtk-cancel" special="cancel" string="No" readonly="0"/> - <button name="print_report" string="Print Receipt" type="object" icon="gtk-print"/> - </group> - </form> - """ - return res + try: + order = self.pool.get('pos.order').browse(cr, uid, active_id) + if order.amount_total == order.amount_paid: + res['arch'] = """ <form string="Make Payment" colspan="4"> + <group col="2" colspan="2"> + <label string="Do you want to print the Receipt?" colspan="4"/> + <separator colspan="4"/> + <button icon="gtk-cancel" special="cancel" string="No" readonly="0"/> + <button name="print_report" string="Print Receipt" type="object" icon="gtk-print"/> + </group> + </form> + """ + except: + return result + return result def check(self, cr, uid, ids, context=None): |
