[6.0] stock: stock.partial.picking wizard has a function with '__' prefix which prevents inheritance

Bug #1050957 reported by Niels Huylebroeck on 2012-09-14
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Committed
Low
OpenERP Publisher's Warranty Team

Bug Description

http://bazaar.launchpad.net/~openerp/openobject-addons/6.0/view/head:/stock/wizard/stock_partial_picking.py#L119

The function definition here uses the __ prefix which prevents inheritance in Python.

This was already fixed in trunk and 6.1 code, please backport the fix.

Related branches

Niels Huylebroeck (red15) wrote :

This is the fix I have applied myself

Amit Parik (amit-parik) on 2012-09-17
Changed in openobject-addons:
assignee: nobody → OpenERP Publisher's Warranty Team (openerp-opw)
importance: Undecided → Low
status: New → Confirmed
tags: added: maintenance

Hello Niels,

It is very risky to change the method name for stable version. It may create problem
for production users.

Code has been improved and re-factored for partial picking wizard in 6.1 and trunk versions
but for 6.0 we can not change it.

Thanks for your understanding,
Rifakat

Changed in openobject-addons:
status: Confirmed → Won't Fix

On lun. 17 sept. 2012 12:58:58 CEST, Rifakat (OpenERP) wrote:
> Hello Niels,
>
> It is very risky to change the method name for stable version. It may create problem
> for production users.
>
> Code has been improved and re-factored for partial picking wizard in 6.1 and trunk versions
> but for 6.0 we can not change it.

In this context, I'd daresay the risk is very low : it's a Python
private method, which means that any code calling it is already doing
some very dirty trick.

If you're concerned about breaking 3rd party code, follow the following
path:

1. rename the method by removing 1 underscore
2. create a method with the old name which will call the new
implementation.

--
Alexandre Fayolle
Chef de Projet
Tel : + 33 (0)4 79 26 57 94

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac Cedex
http://www.camptocamp.com

Changed in openobject-addons:
status: Won't Fix → Confirmed

Hi Niels and Alexandre,

I agree that the method won't be able to use by any other class and it will not be inherited,
and also the risk is very low for the changes.

I am gonna propose a merge for this soon.

Thanks,
Rifakat

Changed in openobject-addons:
status: Confirmed → In Progress

Hi,
Just proposed merge for lp:~openerp-dev/openobject-addons/6.0-opw-579221-rha,
r5344, Revision ID: <email address hidden>

Thank you very much.

Changed in openobject-addons:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers