Tryton - Issues

 

Issue9017

Title Template with Product Suppliers can't be duplicated
Priority bug Status resolved
Superseder Nosy List carlos.galvez, ced, pokoli, resteve, reviewbot, roundup-bot
Type behavior Components purchase, sale_product_customer
Assigned To pokoli Keywords patch, review
Reviews 315221002
View: 315221002

Created on 2020-01-29.13:50:48 by carlos.galvez, last changed by roundup-bot.

Files
File name Uploaded Type Edit Remove
issue9017.diff carlos.galvez, 2020-01-29.13:50:47 text/plain
Messages
New changeset f415efd9a3af by Sergi Almacellas Abellana in branch '5.4':
Prevent domain error when copy products with product suppliers on variants
https://hg.tryton.org/modules/purchase/rev/f415efd9a3af

New changeset b94ba405e0c2 by Sergi Almacellas Abellana in branch '5.2':
Prevent domain error when copy products with product suppliers on variants
https://hg.tryton.org/modules/purchase/rev/b94ba405e0c2

New changeset d2cbe546e08c by Sergi Almacellas Abellana in branch '5.0':
Prevent domain error when copy products with product suppliers on variants
https://hg.tryton.org/modules/purchase/rev/d2cbe546e08c
New changeset 6fdb793f53e2 by Sergi Almacellas Abellana in branch 'default':
Prevent domain error when copy products with product suppliers on variants
https://hg.tryton.org/tryton-env/rev/6fdb793f53e2
New changeset 3bef7a63ee9c by Sergi Almacellas Abellana in branch 'default':
Prevent domain error when copy products with product customers on variants
https://hg.tryton.org/modules/sale_product_customer/rev/3bef7a63ee9c

New changeset b9f0c4001c11 by Sergi Almacellas Abellana in branch 'default':
Add test for product customers copy
https://hg.tryton.org/modules/sale_product_customer/rev/b9f0c4001c11
New changeset c43a5ec13cf7 by Sergi Almacellas Abellana in branch 'default':
Prevent domain error when copy products with product suppliers on variants
https://hg.tryton.org/modules/purchase/rev/c43a5ec13cf7

New changeset 5ad1972d3f00 by Sergi Almacellas Abellana in branch 'default':
Add test for product suppliers copy
https://hg.tryton.org/modules/purchase/rev/5ad1972d3f00
review315221002 updated at https://codereview.tryton.org/315221002/#ps311421002
review315221002 updated at https://codereview.tryton.org/315221002/#ps299551002
review315221002 updated at https://codereview.tryton.org/315221002/#ps321231002
review315221002 updated at https://codereview.tryton.org/315221002/#ps299511002
review315221002 updated at https://codereview.tryton.org/315221002/#ps307381002
msg57182 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2020-04-15.17:58:00
Here is review315221002 which manages duplication with variants and also fixes it for sale_product_customer
msg57013 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2020-04-11.14:55:17
The same should also happen with sale_product_customer.
msg55161 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2020-01-31.12:42:01
> I agree with the first part, but IHMO we can't be sure that duplicated suppliers are really a suppliers for the duplicated product.

You can say that for any data of the product. If you do not want to duplicate, just do not duplicate.
msg55160 (view) Author: [hidden] (carlos.galvez) Date: 2020-01-31.12:37:01
I agree with the first part, but IHMO we can't be sure that duplicated suppliers are really a suppliers for the duplicated product. In both cases we force the user to maintain the relationships, in the first case perhaps by missing information of which the user is already aware because he knows that he is creating a new product, in the second case perhaps due to incorrect information.
msg55159 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2020-01-31.11:57:10
For me, we should find a solution that keep the duplication of suppliers.
It should probably be done in two pass, a first that duplicate without the suppliers and second that duplicate the suppliers with the template and product updated.
New review278491002 at https://codereview.tryton.org/278491002/#ps282861002
msg55102 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2020-01-29.13:53:52
I'm wondering if it won't be better to update the product suppliers to match the newly created product. 

BTW, if you want to propose a patch please follow: 

https://www.tryton.org/develop
msg55100 (view) Author: [hidden] (carlos.galvez) Date: 2020-01-29.13:50:47
Templates with Product Suppliers can't be duplicated.

When you try to do it this message is raised:
The value for field "Variant" in "Product Supplier" is not valid according to its domain.

e.g:
http://demo5.4.tryton.org/#demo5.4/model/product.template/1;name=%22Products%22&views=%5B272%2C271%5D

Maybe in the purchase module, the 'copy' method of the models product and the template  should set the value of product_suppliers to None.
History
Date User Action Args
2020-05-09 00:45:12roundup-botsetmessages: + msg57903
keyword: - backport
2020-05-01 20:34:52roundup-botsetmessages: + msg57774
2020-05-01 20:34:36roundup-botsetmessages: + msg57773
2020-05-01 20:34:19roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg57772
2020-05-01 20:28:09pokolisetkeyword: + backport
2020-04-30 15:34:51reviewbotsetmessages: + msg57746
2020-04-30 14:09:54reviewbotsetmessages: + msg57741
2020-04-20 12:05:12reviewbotsetmessages: + msg57322
2020-04-19 19:10:52reviewbotsetmessages: + msg57309
2020-04-15 18:09:06reviewbotsetmessages: + msg57183

Showing 10 items. Show all history (warning: this could be VERY long)