Can't set a default origin for stock pickings when duplicating from Python code
Bug #1098557 reported by
Numérigraphe
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Fix Committed
|
Low
|
OpenERP R&D Addons Team 2 | ||
OpenERP Community Backports (Addons) |
Fix Released
|
Wishlist
|
Lionel Sausin - Initiatives/Numérigraphe |
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:
id = self.pool.
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
Related branches
lp:~numerigraphe-team/ocb-addons/7.0-picking-custom-default-origin
- Guewen Baconnier @ Camptocamp: Approve (code review)
- Loïc Bellier - Numérigraphe (community): Approve (code review)
- Holger Brunn (Therp): Approve (code review)
-
Diff: 14 lines (+2/-1)1 file modifiedstock/stock.py (+2/-1)
On hold
for merging
into
lp:openobject-addons
- OpenERP Core Team: Pending requested
-
Diff: 14 lines (+2/-1)1 file modifiedstock/stock.py (+2/-1)
Changed in ocb-addons: | |
assignee: | nobody → Lionel Sausin - Numérigraphe (lionel-sausin) |
importance: | Undecided → Low |
importance: | Low → Wishlist |
Changed in ocb-addons: | |
status: | New → Fix Committed |
Changed in ocb-addons: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Hello Numérigraphe,
I have checked your scenario. As per the our architecture when create the new record at that time default value will be set,
but when you duplicate the record at that time copy method will called.
So, obviously default value cant be set at that time. That's why I am set into Question.
Thanks