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

Bug #1050957 reported by Niels Huylebroeck
6
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.

Tags: maintenance

Related branches

Revision history for this message
Niels Huylebroeck (red15) wrote :

This is the fix I have applied myself

Amit Parik (amit-parik)
Changed in openobject-addons:
assignee: nobody → OpenERP Publisher's Warranty Team (openerp-opw)
importance: Undecided → Low
status: New → Confirmed
tags: added: maintenance
Revision history for this message
Rifakat Husen (OpenERP) (rha-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.

Thanks for your understanding,
Rifakat

Changed in openobject-addons:
status: Confirmed → Won't Fix
Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote : Re: [Bug 1050957] Re: [6.0] stock: stock.partial.picking wizard has a function with '__' prefix which prevents inheritance

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
Revision history for this message
Rifakat Husen (OpenERP) (rha-openerp) wrote :

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
Revision history for this message
Rifakat Husen (OpenERP) (rha-openerp) wrote :

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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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