openerp-india team mailing list archive
-
openerp-india team
-
Mailing list archive
-
Message #26523
[Bug 1244544] Re: Loosing context in some methods
** Changed in: openobject-addons
Importance: Undecided => Low
** Changed in: openobject-addons
Status: New => Confirmed
** Changed in: openobject-addons
Assignee: (unassigned) => OpenERP R&D Addons Team 2 (openerp-dev-addons2)
--
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/1244544
Title:
Loosing context in some methods
Status in OpenERP Addons (modules):
Confirmed
Bug description:
Hello,
In mrp module we have some methods which don't pass the context. For
example force_production:
def force_production(self, cr, uid, ids, *args):
""" Assigns products.
@param *args: Arguments
@return: True
"""
pick_obj = self.pool.get('stock.picking')
##### !!! FIXME: here context isn't passed, but force_assign method in stock.picking has the attribute 'context'!!! #####
pick_obj.force_assign(cr, uid, [prod.picking_id.id for prod in self.browse(cr, uid, ids)])
return True
That way, if we need to inherit force_assign method of stock.picking,
we also must inherit all the methods which don't pass the context to
force_assign and I think this is very bad practice, because if context
would be passed everywhere, we wouldn't have these problems and it
would be clear, perfect way to inherit only one method that we really
need to inherit.
To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/1244544/+subscriptions
References