Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0028908
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 02. Master data managementminoralways2015-02-10 14:032015-05-11 21:53
ReportercaristuView Statuspublic 
Assigned Tojorge-garcia 
PriorityhighResolutionfixedFixed in Versionpi
StatusclosedFix in branchFixed in SCM revision50fe70db3a66
ProjectionnoneETAnoneTarget Version3.0PR15Q3
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionpiSCM revision 
Review Assigned Toumartirena
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0028908: Not possible to delete a variant if the generic product has an image

DescriptionNot possible to delete a variant if it was created from a generic product that has an image. The following error appears in the log:

2015-02-10 14:01:11,461 [ajp-localhost%2F127.0.0.1-8809-7] ERROR org.hibernate.util.JDBCExceptionReporter - Batch entry 0 delete from AD_Image where AD_Image_ID='image_UUID' was aborted. Call getNextException to see the cause.
2015-02-10 14:01:11,461 [ajp-localhost%2F127.0.0.1-8809-7] ERROR org.hibernate.util.JDBCExceptionReporter - ERROR: update or delete on table "ad_image" violates foreign key constraint "m_product_ad_image" on table "m_product"
  Detail: Key (ad_image_id)=(image_UUID) is still referenced from table "m_product".
Steps To Reproduce1) Go to the [Product Characteristic] window. Create a new variant characteristic with one value at least
2) In the [Product] window create a new generic product and set an image for it
3) Assign the characteristic created in 1) to the generic product
4) Generate some variants, for example using the Manage Variants process
5) Try to delete one of the variants
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0077050)
jorge-garcia (reporter)
2015-05-06 13:05

Test Plan

1) Go to the [Product Characteristic] window.
  Create a new variant characteristic with one value at least
2) In the [Product] window create a new generic product and set an image for it
3) Search the image in the ad_image table in the database.
4) Assign the characteristic created in step 1) to the generic product.
5) Generate some variants, using the Manage Variants process.
6) Try to delete one of the variants.
7) Check that the generic product and the rest of the variants still have the associated image.
8) Keep deleting the variants and checking the image is still associated.
9) Finally, delete the generic product you created in step 2) and check the image is deleted in the database.
(0077098)
hgbot (developer)
2015-05-07 16:46

Repository: erp/devel/pi
Changeset: 50fe70db3a66713b3795e6f21a2481e37553d14e
Author: Jorge Garcia <jorge.garcia <at> openbravo.com>
Date: Tue May 05 11:44:51 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/50fe70db3a66713b3795e6f21a2481e37553d14e [^]

Fixed issue 28908: Not possible to delete a variant if has an image

Not possible to delete a variant if the generic product has an image.

The problem was that the image is shared among the generic product and
its variants.

The solution is to check if other products has the same image_id when deleting
 a record. In case that this check is true, the image isn't deleted from the
database, otherwise, the image is deleted from the database.

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/event/RemoveImagesEventHandler.java
---
(0077099)
hgbot (developer)
2015-05-07 16:46

Repository: erp/devel/pi
Changeset: 3689ff974394155d3194670a1d854a89fd22aa3e
Author: Unai Martirena <unai.martirena <at> openbravo.com>
Date: Thu May 07 16:45:23 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/3689ff974394155d3194670a1d854a89fd22aa3e [^]

Related to bug 28908: Fix copyright and format

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/event/RemoveImagesEventHandler.java
---
(0077100)
umartirena (reporter)
2015-05-07 16:46

Code Review + Testing OK
(0077225)
hgbot (developer)
2015-05-08 11:16

Repository: erp/devel/pi
Changeset: 387af567776f559ad30a170319726bbf403ee590
Author: Unai Martirena <unai.martirena <at> openbravo.com>
Date: Fri May 08 11:11:43 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/387af567776f559ad30a170319726bbf403ee590 [^]

Related to bug 28908: Code Review

[1]: Only check if any other product is using the image, if current product has an image.
[2]: Make method 'checkImageUtilization' more understandable returning a boolean value instead of a Product object that is not used later on.

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/event/RemoveImagesEventHandler.java
---
(0077248)
hudsonbot (developer)
2015-05-08 15:39

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/d5cb256a6a8a [^]
Maturity status: Test
(0077249)
hudsonbot (developer)
2015-05-08 15:39

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/d5cb256a6a8a [^]
Maturity status: Test
(0077309)
hudsonbot (developer)
2015-05-11 21:53

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/a55bc3c14e8c [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2015-02-10 14:03 caristu New Issue
2015-02-10 14:03 caristu Assigned To => Sandrahuguet
2015-02-10 14:03 caristu Modules => Core
2015-02-10 14:03 caristu Resolution time => 1430172000
2015-02-10 14:03 caristu Triggers an Emergency Pack => No
2015-02-23 13:30 jonalegriaesarte Target Version 3.0PR15Q2 => 3.0PR15Q3
2015-03-09 17:34 jonalegriaesarte Resolution time 1430172000 =>
2015-04-01 16:53 jorge-garcia Status new => scheduled
2015-04-01 16:53 jorge-garcia Assigned To Sandrahuguet => jorge-garcia
2015-05-06 13:05 jorge-garcia Note Added: 0077050
2015-05-07 16:46 hgbot Checkin
2015-05-07 16:46 hgbot Note Added: 0077098
2015-05-07 16:46 hgbot Status scheduled => resolved
2015-05-07 16:46 hgbot Resolution open => fixed
2015-05-07 16:46 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/50fe70db3a66713b3795e6f21a2481e37553d14e [^]
2015-05-07 16:46 hgbot Checkin
2015-05-07 16:46 hgbot Note Added: 0077099
2015-05-07 16:46 umartirena Review Assigned To => umartirena
2015-05-07 16:46 umartirena Note Added: 0077100
2015-05-07 16:46 umartirena Status resolved => closed
2015-05-07 16:46 umartirena Fixed in Version => pi
2015-05-08 11:16 hgbot Checkin
2015-05-08 11:16 hgbot Note Added: 0077225
2015-05-08 15:39 hudsonbot Checkin
2015-05-08 15:39 hudsonbot Note Added: 0077248
2015-05-08 15:39 hudsonbot Checkin
2015-05-08 15:39 hudsonbot Note Added: 0077249
2015-05-11 21:53 hudsonbot Checkin
2015-05-11 21:53 hudsonbot Note Added: 0077309


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker