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
1=== modified file 'purchase_early_payment_discount/purchase.py'
2--- purchase_early_payment_discount/purchase.py 2012-03-02 19:27:50 +0000
3+++ purchase_early_payment_discount/purchase.py 2012-12-11 09:31:43 +0000
4@@ -148,13 +148,14 @@
5 res['early_payment_discount'] = False
6 return {'value': res}
7
8- def action_invoice_create(self, cr, uid, ids, *args):
9+ def action_invoice_create(self, cr, uid, ids, context=None):
10 """
11 Inherited method for writing early_payment_discount value in
12 created invoice
13 """
14- invoice_id = super(purchase_order, self).action_invoice_create(cr,
15- uid, ids, args)
16+ invoice_id = super(purchase_order, self).action_invoice_create(
17+ cr, uid, ids,
18+ context=context)
19 invoice_obj = self.pool.get('account.invoice')
20 current_purchase = self.browse(cr, uid, ids)[0]
21 if current_purchase.early_payment_discount:
22
23=== modified file 'purchase_payment/purchase_payment.py'
24--- purchase_payment/purchase_payment.py 2012-03-21 13:06:14 +0000
25+++ purchase_payment/purchase_payment.py 2012-12-11 09:31:43 +0000
26@@ -69,13 +69,15 @@
27 result['value']['partner_bank'] = False
28 return result
29
30- def action_invoice_create(self, cr, uid, ids, *args):
31+ def action_invoice_create(self, cr, uid, ids, context=None):
32 """
33 Extend the invoice creation action to preset the payment options.
34 """
35 # Create the invoice as usual.
36- invoice_id = super(purchase_order, self).action_invoice_create(cr, uid, ids, args)
37-
38+ invoice_id = super(purchase_order, self).action_invoice_create(
39+ cr, uid,
40+ ids, context=context)
41+
42 #
43 # Check if the order has payment info.
44 #