openerp-india team mailing list archive
-
openerp-india team
-
Mailing list archive
-
Message #08351
[Bug 942699] Re: Unable to set a new default name for product.product via copy() call
Hello Niels Huylebroeck,,
Thanks for your reply,
That would indeed be a useful improvement, and technically relatively easy to
do but It may be for your customization . I have tried with
default['name'] = "My desired new name" and tried to copy / duplicated the record and it's work.
However the cases where you need to perform creates a product by
searching for a correct template then copying that and altering certain
aspects while copying by using wizard .
Current behavior of copy() method is as per expected so we can't implement it currently so I set this issue as 'won't fix' Also It would be a nice idea for a improvement that's why I am setting this issue as 'wishlist'.
Thanks.
** Changed in: openobject-addons
Importance: Undecided => Wishlist
** Changed in: openobject-addons
Status: Incomplete => Won't Fix
--
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/942699
Title:
Unable to set a new default name for product.product via copy() call
Status in OpenERP Addons (modules):
Won't Fix
Bug description:
Due to how the code is written in product.product method copy[1] we
cannot call copy method with default['name'] = 'My New product name'
because the value in default['name'] is unconditionally overwritten
with the product name + '(copy)'.
A workaround is to do copy() and then a write to update the name to
the calculated name.
However I would find it a lot more logical if you would just do a
simple test like:
if 'name' not in default or default['name'] == product['name']:
default['name'] = product['name'] + _(' (copy)')
Which would then enable people to properly copy products and replace the name at the same time.
I checked also the trunk version (r6646) and it seems the same issue is still there[2] as well as on the 6.1 r6637 [3]
[1] http://bazaar.launchpad.net/~openerp/openobject-addons/6.0/view/head:/product/product.py#L617
[2] http://bazaar.launchpad.net/~openerp/openobject-addons/trunk/view/head:/product/product.py#L660
[3] http://bazaar.launchpad.net/~openerp/openobject-addons/6.1/view/head:/product/product.py#L673
To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/942699/+subscriptions
References