Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0031866Openbravo ERP01. General setuppublic2016-01-12 18:432016-03-17 10:55
ngarcia 
nonofrancisco 
urgentmajoralways
closedfixed 
5
 
 
vmromanos
Core
No
0031866: Cannot manage variants if Multilingual Documents selected at Client level because it is trying to create duplicated translation
Cannot manage variants if Multilingual Documents selected at Client level because it is trying to create duplicated translation. The ManageVariants process copies the product with the DalUtil.copy function and the m_product_trg trigger tries to insert a new record in the m_product_trl table
As system admin role:
   Check at least one language is Active and set as System Language
As group admin role:
   Go to Client window and select the Multilingual Documents window
   Create a Product Characteristic, set it as Variant and add a Value to it
   Create a Product, set it as Generic and add the previously created Characteristic
   Click on Manage Variants button, select one record and OK
   Check the following error message is shown:
      There is already a Product Translation with the same (Language, Product). (Language, Product) must be unique. You must change the values entered.

   The log shows:
      ERROR org.hibernate.util.JDBCExceptionReporter - ERROR: duplicate key value violates unique constraint "m_product_trl_product_langu_un"
  Detail: Key (m_product_id, ad_language)=(B5EB4CEAC81748C69CAF5E661FDC7D4E, en_US) already exists.
      ERROR org.openbravo.materialmgmt.actionhandler.ManageVariants - Error in Manage Variants Action Handler
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
No tags attached.
related to defect 00281363.0PR15Q2 closed fsoto82 Error duplicate key value violates unique constraint "m_product_trl_product_langu_un" trying to create product variants 
Issue History
2016-01-12 18:43ngarciaNew Issue
2016-01-12 18:43ngarciaAssigned To => Triage Finance
2016-01-12 18:43ngarciaModules => Core
2016-01-12 18:43ngarciaResolution time => 1455318000
2016-01-12 18:43ngarciaTriggers an Emergency Pack => No
2016-01-12 18:44ngarciaRelationship addedrelated to 0028136
2016-01-12 18:44ngarciaIssue Monitored: networkb
2016-01-22 21:43nonofranciscoAssigned ToTriage Finance => nonofrancisco
2016-01-22 21:44nonofranciscoStatusnew => scheduled
2016-01-22 21:44nonofranciscoNote Added: 0083572
2016-01-31 12:53hgbotCheckin
2016-01-31 12:53hgbotNote Added: 0083758
2016-01-31 12:53hgbotStatusscheduled => resolved
2016-01-31 12:53hgbotResolutionopen => fixed
2016-01-31 12:53hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/5af9f355ad36eff792c928ec5cd55f09fa1fbd7c [^]
2016-01-31 12:53hgbotCheckin
2016-01-31 12:53hgbotNote Added: 0083759
2016-01-31 12:53hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/5af9f355ad36eff792c928ec5cd55f09fa1fbd7c [^] => http://code.openbravo.com/erp/devel/pi/rev/b6f6e3509b632b71b1bd4398a02ae12f03cc6d0b [^]
2016-01-31 12:53vmromanosReview Assigned To => vmromanos
2016-01-31 12:53vmromanosNote Added: 0083760
2016-01-31 12:53vmromanosStatusresolved => closed
2016-03-17 10:55hudsonbotCheckin
2016-03-17 10:55hudsonbotNote Added: 0085097
2016-03-17 10:55hudsonbotCheckin
2016-03-17 10:55hudsonbotNote Added: 0085098

Notes
(0083572)
nonofrancisco   
2016-01-22 21:44   
Test Plan

As Openbravo / System Administrator

In Language window check at least one language is Active and set as System Language

As Openbravo / F&B International Group Admin

In Client window
  Multilingual Documents: checked
  
In Product Characteristics window
  Create a new Record
    Variant: checked
    Active: checked
    Save the record
    In Value tab
      Create two records
        Active: checked
      
In Product window
  Create a new record
    is Generic: checked
    Save the record
    In Characteristics tab
      Add a new record
        Characteristics: the one previously created
        Save the record

Click on Manage Variants button
Select one of the variants
Click Done button

A success message is shown

In Client window
  Multilingual Documents: not checked

In Product window
  Select the generic product previously created

Click on Manage Variants button
Select the variant with "Variant Created" field set to No
Click Done button

A success message is shown

Review the definition of the new crated products and realize all values are correct
(0083758)
hgbot   
2016-01-31 12:53   
Repository: erp/devel/pi
Changeset: 5af9f355ad36eff792c928ec5cd55f09fa1fbd7c
Author: Nono <f.carballo <at> nectus.com>
Date: Thu Jan 21 15:36:07 2016 -0500
URL: http://code.openbravo.com/erp/devel/pi/rev/5af9f355ad36eff792c928ec5cd55f09fa1fbd7c [^]

Fixes Issue 31866: Emptied Translation List after copying generic product

If Multilingual Document is checked in Client window, when managing variants,
after copying the generic product, the translation list is emptied, the
m_product_trg trigger will insert the proper values when inserting
the new product.

---
M src/org/openbravo/materialmgmt/actionhandler/ManageVariants.java
---
(0083759)
hgbot   
2016-01-31 12:53   
Repository: erp/devel/pi
Changeset: b6f6e3509b632b71b1bd4398a02ae12f03cc6d0b
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Sun Jan 31 12:49:38 2016 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/b6f6e3509b632b71b1bd4398a02ae12f03cc6d0b [^]

Fixed bug 31866: code review improvements

Applied Openbravo format style
Updated copyright

---
M src/org/openbravo/materialmgmt/actionhandler/ManageVariants.java
---
(0083760)
vmromanos   
2016-01-31 12:53   
Code review + testing OK
(0085097)
hudsonbot   
2016-03-17 10:55   
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/b22fb0500156 [^]
Maturity status: Test
(0085098)
hudsonbot   
2016-03-17 10:55   
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/b22fb0500156 [^]
Maturity status: Test