Merge lp:~txerpa/account-payment/7.0-account_payment-call-move-post into lp:~account-payment-team/account-payment/7.0

Proposed by Biel - txerpa.com on 2013-12-10
Status: Merged
Merged at revision: 108
Proposed branch: lp:~txerpa/account-payment/7.0-account_payment-call-move-post
Merge into: lp:~account-payment-team/account-payment/7.0
Diff against target: 13 lines (+1/-3)
1 file modified
account_payment_extension/account_payment.py (+1/-3)
To merge this branch: bzr merge lp:~txerpa/account-payment/7.0-account_payment-call-move-post
Reviewer Review Type Date Requested Status
Pedro Manuel Baeza 2013-12-10 Approve on 2014-01-31
Omar (Pexego) code review Needs Fixing on 2013-12-13
xavi (community) Approve on 2013-12-11
Review via email: mp+198433@code.launchpad.net

Description of the change

When creating an order with the direct payment option and the entry_posted option of the journal is chosen, it changes the status to posted of the move when it should call the post method.

http://bazaar.launchpad.net/~account-payment-team/account-payment/7.0/view/head:/account_payment_extension/account_payment.py#L317

 # Post the move
 if order.mode.journal.entry_posted:
     move_obj.write(cr, uid, [move_id], {
        'state':'posted',
        }, context)

It should be:
if order.mode.journal.entry_posted:
    move_obj.post()

To post a comment you must log in.
Pedro Manuel Baeza (pedro.baeza) wrote :

Thanks for the MP! In 6.1, it has been also changed in revision 111. It would be desirable to put context as a keyword argument (context=context), to avoid incompatibilities if the signature of post method changes.

Regards.

review: Approve (code review and test)
xavi (xgilest) :
review: Approve
Omar (Pexego) (omar7r) wrote :

Need fixing status, while don't update it with context=context as Pedro said.

Thanks

review: Needs Fixing (code review)
106. By Biel - txerpa.com on 2014-01-31

context as a keyword argument

I set this MP as Work in progress as it is in "Needs Fixing" since weeks. Please set it back to "Need Review" once you think you are done.

Pedro Manuel Baeza (pedro.baeza) wrote :

As the change is trivial, I'm going to make it on merge time, so I proceed with the merge.

Regards

review: Approve
Pedro Manuel Baeza (pedro.baeza) wrote :

Sorry, it was made already, but not notified with any comment.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_payment_extension/account_payment.py'
2--- account_payment_extension/account_payment.py 2013-09-24 15:15:21 +0000
3+++ account_payment_extension/account_payment.py 2014-01-31 09:52:16 +0000
4@@ -316,9 +316,7 @@
5 }, context)
6 # Post the move
7 if order.mode.journal.entry_posted:
8- move_obj.write(cr, uid, [move_id], {
9- 'state':'posted',
10- }, context)
11+ move_obj.post(cr, uid, [move_id], context=context)
12
13 return result
14