Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0027999Openbravo ERPA. Platformpublic2014-10-28 10:352014-12-30 23:24
jonalegriaesarte 
reinaldoguerra 
normalmajorhave not tried
closedfixed 
5
 
3.0PR15Q1 
pramakrishnan
Core
No
0027999: Image in product created through create variants can not be changed
Image in product created through create variants can not be changed
http://wiki.openbravo.com/wiki/Product_Characteristic [^]
- Create a new product (set as isgeneric) and add a price list.
- Add a characteristc (set as varian) with some values
- Add the characteristic to the product
- Add an image to the product
- Create variant using 'Create Variants' process
- In one of the product created try to change the imagen associated (copied from the original product).
Error
Saving failed. This record cannot be deleted because it is associated with other existing elements. Please see Linked Items
No tags attached.
Issue History
2014-10-28 10:35jonalegriaesarteNew Issue
2014-10-28 10:35jonalegriaesarteAssigned To => AugustoMauch
2014-10-28 10:35jonalegriaesarteModules => Core
2014-10-28 10:35jonalegriaesarteResolution time => 1417388400
2014-10-28 10:35jonalegriaesarteTriggers an Emergency Pack => No
2014-10-28 15:09extraIssue Monitored: extra
2014-11-10 13:46alostaleNote Added: 0071530
2014-11-10 13:46alostaleAssigned ToAugustoMauch => Sandrahuguet
2014-11-13 21:50reinaldoguerraAssigned ToSandrahuguet => reinaldoguerra
2014-11-13 21:50reinaldoguerraStatusnew => scheduled
2014-11-16 20:50reinaldoguerraNote Added: 0071669
2014-11-18 11:09hgbotCheckin
2014-11-18 11:09hgbotNote Added: 0071749
2014-11-18 11:09hgbotStatusscheduled => resolved
2014-11-18 11:09hgbotResolutionopen => fixed
2014-11-18 11:09hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/657fd971187ebbcabfde6ca445b883bed698730e [^]
2014-11-18 11:09hgbotCheckin
2014-11-18 11:09hgbotNote Added: 0071750
2014-11-18 11:11pramakrishnanReview Assigned To => pramakrishnan
2014-11-18 11:11pramakrishnanNote Added: 0071751
2014-11-18 11:11pramakrishnanStatusresolved => closed
2014-12-30 23:24hudsonbotCheckin
2014-12-30 23:24hudsonbotNote Added: 0073074
2014-12-30 23:24hudsonbotCheckin
2014-12-30 23:24hudsonbotNote Added: 0073075

Notes
(0071530)
alostale   
2014-11-10 13:46   
The problem is in the Create Variants process: in case the original product has an image, the new product links to that image. It should, instead, create a new image and link the new product to that one.

Note this proposed fix will work for newly created products, but not for existent one which will continue linking to old image.
(0071669)
reinaldoguerra   
2014-11-16 20:50   
Test plan used:
1- Login into Openbravo ERP
2- Go to product characteristic window, create a new record for example: Color
3- Check variant flag, save it and ad some values in value tab.
4- Go to product window and create a new one (set as isgeneric), add an image to the product.
5- Add a price list in price tab.
6- Go to Characteristic tab and add previously created (Color)
7- Check variant flag, save record and realize that variant's values are inserted in characteristic configuration tab.
8- Create variant using 'Create Variants' process button
9- In one of the product created try to change the image associated (copied from the original product).
10- The image is changed successfuly.
11- Go to a previous created variant's product through create variants process.
12- Try to change its image and realize that now it is changed successfuly.
(0071749)
hgbot   
2014-11-18 11:09   
Repository: erp/devel/pi
Changeset: 657fd971187ebbcabfde6ca445b883bed698730e
Author: Reinaldo Guerra <reinaldo.guerra <at> peoplewalking.com>
Date: Sun Nov 16 16:30:56 2014 -0500
URL: http://code.openbravo.com/erp/devel/pi/rev/657fd971187ebbcabfde6ca445b883bed698730e [^]

Fixed bug 27999: Product's image created on create variants can not be changed.

Actual creating variants process makes a copy from the entire product's object to create the new variants and the new variant's images are the original product's image so it is not possible to update them. This behaviour was changed to also make a copy from original product image, save it and then associate it with the new variant. Now it is possible to update this new image's field as it is not related with any other variant or product.
Also a module script was created to fix this problem in already created variants through the mentioned process. When executing an ant update database, images for products with generic products associated are reinserted and then are associated with them.

---
M src/org/openbravo/materialmgmt/VariantAutomaticGenerationProcess.java
A src-util/modulescript/build/classes/org/openbravo/modulescript/UpdateVariantImage.class
A src-util/modulescript/build/classes/org/openbravo/modulescript/UpdateVariantImageData.class
A src-util/modulescript/src/org/openbravo/modulescript/UpdateVariantImage.java
A src-util/modulescript/src/org/openbravo/modulescript/UpdateVariantImage_data.xsql
---
(0071750)
hgbot   
2014-11-18 11:09   
Repository: erp/devel/pi
Changeset: 81fbb57834f4f20f63fa18c8d5efa05175e83402
Author: Pandeeswari Ramakrishnan <pandeeswari.ramakrishnan <at> openbravo.com>
Date: Tue Nov 18 15:24:31 2014 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/81fbb57834f4f20f63fa18c8d5efa05175e83402 [^]

Related to Issue 27999: Moved the preference creation outside the for loop

---
M src-util/modulescript/build/classes/org/openbravo/modulescript/UpdateVariantImage.class
M src-util/modulescript/src/org/openbravo/modulescript/UpdateVariantImage.java
---
(0071751)
pramakrishnan   
2014-11-18 11:11   
Code Review + Testing - OK.
(0073074)
hudsonbot   
2014-12-30 23:24   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/6525fe229e06 [^]
Maturity status: Test
(0073075)
hudsonbot   
2014-12-30 23:24   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/6525fe229e06 [^]
Maturity status: Test