Merge lp:~savoirfairelinux-openerp/openerp-fiscal-rules/7.0-fix-bug-1265067 into lp:openerp-fiscal-rules

Status: Rejected
Rejected by: Maxime Chambreuil (http://www.savoirfairelinux.com)
Proposed branch: lp:~savoirfairelinux-openerp/openerp-fiscal-rules/7.0-fix-bug-1265067
Merge into: lp:openerp-fiscal-rules
Diff against target: 11 lines (+1/-0)
1 file modified
account_fiscal_position_rule_sale/sale.py (+1/-0)
To merge this branch: bzr merge lp:~savoirfairelinux-openerp/openerp-fiscal-rules/7.0-fix-bug-1265067
Reviewer Review Type Date Requested Status
Raphaël Valyi - http://www.akretion.com Needs Information
Review via email: mp+200202@code.launchpad.net

Commit message

[MRG] Fix _fiscal_position_map() got multiple values for keyword argument 'uid'

Description of the change

[FIX] _fiscal_position_map() got multiple values for keyword argument 'uid'

To post a comment you must log in.
Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote :

Hello Maxime,

I've hit the bug too. But I suggest we apply this MP instead which fixes it also:
https://code.launchpad.net/~camptocamp/openerp-fiscal-rules/7.0-wrong-onchange-1255918-revert-hack/+merge/199144
but in a cleaner way.

In fact, after much investigation, we concluded that the way we were propagating extra arguments in the context, was specific to our localization and wasn't quite clean (it was brutaly overriding the context instead of etending it).
In the future, we will rely on web_context_tunnel in our localization to pass more extra params to these methods and we will get them back from the context at the rght place in some specific localization override. Still I advise you have a look to hit, because I propose refactoring a bit the fiscal rules to ensure we can leave on_change methods with the original signature, that play it nicer with the other modules
https://code.launchpad.net/~akretion-team/server-env-tools/web-context-tunnel/+merge/198599

Hope this helps

review: Disapprove
Revision history for this message
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) wrote :

Hello Raphaël,

I have no problem with this MP being rejected as long as your solution fixes the bug, which it doesn't seem to do:

"Note that the current code is failing is some conditions, when a 'uid' key is present in the context for instance."

Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote :

Hello Maxime,

are you sure?
I had the same bug as you reported but when I merged https://code.launchpad.net/~camptocamp/openerp-fiscal-rules/7.0-wrong-onchange-1255918-revert-hack/+merge/199144 it disappeared. Look how kwargs is defined in the MP, there is no way you'll have a uid key left.
As for web_context_tunnel, I was commenting only about how it's useful to inject extra args in the context, but in the right way (instead of just replacing the context as we were doing before), not sure you understand that, in any case what fixes the bug is this MP https://code.launchpad.net/~camptocamp/openerp-fiscal-rules/7.0-wrong-onchange-1255918-revert-hack/+merge/199144 not web_context_tunnel itself.

review: Needs Information
Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote :

Hello Maxime,

so I merged https://code.launchpad.net/~camptocamp/openerp-fiscal-rules/7.0-wrong-onchange-1255918-revert-hack/+merge/199144 and the bug doesn't occur anymore.

can we cancel this MP then?

review: Needs Information

Unmerged revisions

66. By Maxime Chambreuil (http://www.savoirfairelinux.com)

[FIX] _fiscal_position_map() got multiple values for keyword argument 'uid'

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_fiscal_position_rule_sale/sale.py'
2--- account_fiscal_position_rule_sale/sale.py 2013-12-04 07:52:33 +0000
3+++ account_fiscal_position_rule_sale/sale.py 2013-12-30 22:14:10 +0000
4@@ -54,6 +54,7 @@
5
6 values = result['value']
7 kwargs = context.copy()
8+ del kwargs['uid']
9 kwargs.update({
10 'shop_id': context['shop_id'],
11 'partner_id': partner_id,

Subscribers

People subscribed via source and target branches