[7.0] [ocb] Method _get_lines signature changed

Bug #1269965 reported by Pedro Manuel Baeza
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenERP Community Backports (Addons)
Confirmed
Undecided
Yannick Vaucher @ Camptocamp

Bug Description

In revision 9599 (http://bazaar.launchpad.net/~ocb/ocb-addons/7.0/revision/9599), Yannick made a change in the signature of the method, adding a positional argument called 'target_move'.

I know that this method is internal, but we are using it in Spain to get taxes values for vat reports easily. The problem is not the change itself, but the difference with the official branch, so we cannot use the same code for both branches. For now, I'm going to use a workaround catching the exception or reading method definition, but please fix this ASAP.

I think one possible solution is to put the argument as keyword argument with default value None, but I have to test if it's correct, because I don't know that code.

Another thing that it's important is to prevent this kind of changes that provokes side effects, so maybe positional arguments must be forbidden. What do you think? Do I talk this on the community list?

Regards.

Changed in ocb-addons:
assignee: nobody → Yannick Vaucher @ Camptocamp (yvaucher-c2c)
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

I must say I had not expected anyone to call a method from this report from somewhere else, so I guess this demonstrates that signature changes are a bad idea in general indeed. Maybe in OCB the parameter can be passed in the context?

summary: - [7.0] Method _get_lines signature changed
+ [7.0] [ocb] Method _get_lines signature changed
Changed in ocb-addons:
status: New → Confirmed
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

https://bugs.launchpad.net/ocb-addons/+bug/1220732

Here is the bug report for which my fix was made there is the same fix waiting for official branch more or less made by the support team.

Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Yeah, I see. We can make this change in OCB and I'm going to write on that bug report to avoid positional argument, so that they change their MP. Do you agree with that?

BTW, I have made a workaround in the module that we are using to work with both versions.

Regards.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.