Merge lp:~vivekimsit/openobject-addons/extra_addons_changes into lp:openobject-addons/extra-6.0

Proposed by Vivek poddar
Status: Superseded
Proposed branch: lp:~vivekimsit/openobject-addons/extra_addons_changes
Merge into: lp:openobject-addons/extra-6.0
Diff against target: 44 lines (+9/-6)
2 files modified
purchase_early_payment_discount/purchase.py (+4/-3)
purchase_payment/purchase_payment.py (+5/-3)
To merge this branch: bzr merge lp:~vivekimsit/openobject-addons/extra_addons_changes
Reviewer Review Type Date Requested Status
Stefan Rijnhart (Opener) Needs Fixing
Review via email: mp+139147@code.launchpad.net

This proposal has been superseded by a proposal from 2012-12-11.

Description of the change

The modules[purchase_early_payment_discount and purchase_payment] were broken due to the wrong context params, also it produced errors on confirming a purchase order. My merge resolves the issue.

To post a comment you must log in.
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Alright, as this should fix the problem. But perhaps you could also fix the indentation of the function arguments while you are at it? See the 'Indentation' section of pep8 (http://www.python.org/dev/peps/pep-0008/#id10)

review: Needs Fixing
Revision history for this message
Vivek poddar (vivekimsit) wrote :

Hi,

You are talking of every functions's or just the one which I corrected.

Thanks and Regards!

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

No just these two!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'purchase_early_payment_discount/purchase.py'
--- purchase_early_payment_discount/purchase.py 2012-03-02 19:27:50 +0000
+++ purchase_early_payment_discount/purchase.py 2012-12-11 09:31:43 +0000
@@ -148,13 +148,14 @@
148 res['early_payment_discount'] = False148 res['early_payment_discount'] = False
149 return {'value': res}149 return {'value': res}
150150
151 def action_invoice_create(self, cr, uid, ids, *args):151 def action_invoice_create(self, cr, uid, ids, context=None):
152 """152 """
153 Inherited method for writing early_payment_discount value in153 Inherited method for writing early_payment_discount value in
154 created invoice154 created invoice
155 """155 """
156 invoice_id = super(purchase_order, self).action_invoice_create(cr,156 invoice_id = super(purchase_order, self).action_invoice_create(
157 uid, ids, args)157 cr, uid, ids,
158 context=context)
158 invoice_obj = self.pool.get('account.invoice')159 invoice_obj = self.pool.get('account.invoice')
159 current_purchase = self.browse(cr, uid, ids)[0]160 current_purchase = self.browse(cr, uid, ids)[0]
160 if current_purchase.early_payment_discount:161 if current_purchase.early_payment_discount:
161162
=== modified file 'purchase_payment/purchase_payment.py'
--- purchase_payment/purchase_payment.py 2012-03-21 13:06:14 +0000
+++ purchase_payment/purchase_payment.py 2012-12-11 09:31:43 +0000
@@ -69,13 +69,15 @@
69 result['value']['partner_bank'] = False69 result['value']['partner_bank'] = False
70 return result70 return result
7171
72 def action_invoice_create(self, cr, uid, ids, *args):72 def action_invoice_create(self, cr, uid, ids, context=None):
73 """73 """
74 Extend the invoice creation action to preset the payment options.74 Extend the invoice creation action to preset the payment options.
75 """75 """
76 # Create the invoice as usual.76 # Create the invoice as usual.
77 invoice_id = super(purchase_order, self).action_invoice_create(cr, uid, ids, args)77 invoice_id = super(purchase_order, self).action_invoice_create(
7878 cr, uid,
79 ids, context=context)
80
79 #81 #
80 # Check if the order has payment info.82 # Check if the order has payment info.
81 #83 #