Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0046278Openbravo ERP02. Master data managementpublic2021-04-15 21:382021-06-02 09:51
gsuarez 
rqueralta 
highmajoralways
closedunable to reproduce 
5
 
 
marvintm
Core
No
0046278: Move retail modulescript to core
In an environment WITHOUT having the WhiteValley dataset applied, upgrade to 20Q4.1. When doing update.database, it fails.
1. Environment 20Q4.1 without retail module installed.
2. Execute ant update.database.
3. View that the compilation fails.
[java] 52337 [main] ERROR org.openbravo.retail.posterminal.modulescript.ConvertBrandIntoCharacteristicData - SQL error in query: INSERT INTO m_characteristic( m_characteristic_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, name, description, ad_tree_id, isvariant, isexplodeconf, em_obpos_filteronwebpos, em_obpos_useonwebpos) VALUES (?, ?,'0', 'Y', now(), '100', now(), '100', 'Brand', null, '899D83A7B7E24F57911A91AE82DCA496','N', 'Y', 'Y', 'Y') :org.postgresql.util.PSQLException: ERROR: inserción o actualización en la tabla «m_characteristic» viola la llave foránea «m_product_tree»
[java] Detail: La llave (ad_tree_id)=(899D83A7B7E24F57911A91AE82DCA496) no está presente en la tabla «ad_tree».
[java] 52340 [main] ERROR org.openbravo.retail.posterminal.modulescript.ConvertBrandIntoCharacteristic - Errors converting brand into characteristic
No tags attached.
Issue History
2021-04-15 21:38gsuarezNew Issue
2021-04-15 21:38gsuarezAssigned To => Triage Finance
2021-04-15 21:38gsuarezModules => Core
2021-04-15 21:38gsuarezResolution time => 1620252000
2021-04-15 21:38gsuarezTriggers an Emergency Pack => No
2021-04-19 11:51vmromanosAssigned ToTriage Finance => Retail
2021-04-19 12:01vmromanosNote Added: 0127367
2021-04-26 14:59rqueraltaAssigned ToRetail => rqueralta
2021-06-02 09:51marvintmReview Assigned To => marvintm
2021-06-02 09:51marvintmNote Added: 0128928
2021-06-02 09:51marvintmStatusnew => closed
2021-06-02 09:51marvintmResolutionopen => unable to reproduce

Notes
(0127367)
vmromanos   
2021-04-19 12:01   
This module script can't be moved to Core because it has dependencies to the POS:

INSERT INTO m_characteristic( m_characteristic_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, name, description, ad_tree_id, isvariant, isexplodeconf, *em_obpos_filteronwebpos, em_obpos_useonwebpos*)

Anyway, I think the issue is not well reported.
The error says that the ad_tree_id '899D83A7B7E24F57911A91AE82DCA496' is not present in the DB, however the module script did insert it (https://gitlab.com/openbravo/devel/pmods/org.openbravo.retail.posterminal/-/blame/master/src-util/modulescript/src/org/openbravo/retail/posterminal/modulescript/ConvertBrandIntoCharacteristic_data.xsql#L178 [^]) if it's not available.

Assigned issue to Retail team, as the module script belongs to them. Things I have researched:
1. The ad_tree_id '899D83A7B7E24F57911A91AE82DCA496' is available in the white valley sampledata. Why using the same ID?
2. Maybe the problem is when deleting this sampledata, I mean maybe the module script works fine in a default installation, but if you try to run it after deleting the sampledata it fails (just guessing).
(0128928)
marvintm   
2021-06-02 09:51   
We haven't been able to reproduce this problem.