openerp-india team mailing list archive
-
openerp-india team
-
Mailing list archive
-
Message #21536
[Bug 1098557] Re: Can't set a default origin for stock pickings at duplication time
Dear Amit Parik,
I hate to insist but it's not a matter of opinion. As per the ORM's API, the copy method MUST accept a dictionary of defaults values to be used instead of the current values when the record is copied.
>From the doc:
"default: dictionary of field values to override in the original values of the copied record, e.g: {'field_name': overriden_value, ...}"
Now in stock.picking, several keys in default are not honored (for good reasons !) but origin is reset too and that's not necessary.
Lionel
** Changed in: openobject-addons
Status: Opinion => New
** Summary changed:
- Can't set a default origin for stock pickings at duplication time
+ Can't set a default origin for stock pickings when duplicating from Python code
--
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/1098557
Title:
Can't set a default origin for stock pickings when duplicating from
Python code
Status in OpenERP Addons (modules):
New
Bug description:
In the Python code of custom addons, it would sometimes be useful to be able to copy a picking while setting the origin field.
For example:
defaults={'origin': 'test', 'type': 'internal'}
id = self.pool.get('stock.picking').copy(cr, uid, 1, defaults, context={})
However, in v6.0 and up to the current trunk, the method copy() of stock.picking resets the field "origin" as soon as no default name is set.
I suggest the origin be reset only if it's not passed in the dict of default values.
Lionel Sausin
To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/1098557/+subscriptions
References