Openbravo Issue Tracking System - Retail Modules
View Issue Details
0041270Retail ModulesCopy Retail Storepublic2019-07-04 09:142019-08-08 12:36
samuel_nicuesa 
rqueralta 
highmajoralways
closedfixed 
5
pi 
RR19Q4 
marvintm
No
0041270: Copy Store Process are copying the same POS Terminal Type Name as the Original Store copied.
Copy Store Process are copying the same POS Terminal Type Name as the Original Store copied.
It is happening because more than 1 Terminal is associated to the same Terminal Type.
[BO]

 - > Execute Copy Store process Using the following information.
See attached images

     Original Store -> Vall Blanca Store
     Original Pos Terminal Type -> VBS POS Terminal Type
 
     New store -> 31400
     New Pos Terminal Type -> VBS POS Terminal Type (The same as the original)

It is happening because more than one terminal is using the same pos terminal type.
When pos terminal types are copied these code is being executed :


public void copyTerminalTypes(TerminalType originalType, BaseOBObject newObject) {
    MutableBoolean isNew = new MutableBoolean(false);
    TerminalType selectedType = (TerminalType) getObjectInTree(originalType, isNew);
    String terminalTypeName = originalType.getName();
    if (isNew.booleanValue()) {
      if (terminalTypeName.contains(originalTerminal.getName())) {
        terminalTypeName = terminalTypeName.replace(originalTerminal.getName(),
            newObject.get("name").toString());
      } else {
        terminalTypeName += "-" + newObject.get("name");
      }
    }
    selectedType.setName(terminalTypeName);
    newObject.set("obposTerminaltype", selectedType);
    if (isNew.booleanValue()) {
      copyPaymentMethods(originalType, selectedType);
    }
  }

In the first execution if (isNew.booleanValue()) { is TRUE and the pos terminal type is copied fine using :

1) Replace
or
2)terminalTypeName += "-" + newObject.get("name");

In the second execution, this terminal type is not new because it is used by more than 1 terminal and
if (isNew.booleanValue()) is FALSE.
The new terminal types created are overwritten by the original Pos Terminal Type :

 -> String terminalTypeName = originalType.getName();

 -> selectedType.setName(terminalTypeName);
This problem comes from these issues, think if it is the expected behavior or is necessary revert this part of the code.

https://issues.openbravo.com/view.php?id=39091 [^]
https://issues.openbravo.com/view.php?id=39377 [^]
No tags attached.
related to defect 0039377 closed rqueralta The Copy Terminal process does not work 
related to defect 0039091 closed rqueralta 'Copy Retail Store' copied names for some windows can be problematic 
png CopyRetailStore.png (79,798) 2019-07-12 10:48
https://issues.openbravo.com/file_download.php?file_id=13115&type=bug
png

png CopyStoreParametrization.png (90,883) 2019-07-12 10:49
https://issues.openbravo.com/file_download.php?file_id=13116&type=bug
png

png SamePosterminalType1.png (82,545) 2019-07-12 10:49
https://issues.openbravo.com/file_download.php?file_id=13117&type=bug
png

png SamePosterminalType2.png (85,734) 2019-07-12 10:49
https://issues.openbravo.com/file_download.php?file_id=13118&type=bug
png
Issue History
2019-07-04 09:14samuel_nicuesaNew Issue
2019-07-04 09:14samuel_nicuesaAssigned To => Retail
2019-07-04 09:14samuel_nicuesaFile Added: PossibleSolution.diff
2019-07-04 09:14samuel_nicuesaResolution time => 1564005600
2019-07-04 09:14samuel_nicuesaTriggers an Emergency Pack => No
2019-07-04 09:15samuel_nicuesaRelationship addeddepends on 0039377
2019-07-04 09:15samuel_nicuesaRelationship deleteddepends on 0039377
2019-07-04 09:15samuel_nicuesaRelationship addedrelated to 0039377
2019-07-04 09:59marvintmNote Added: 0113167
2019-07-04 09:59marvintmAssigned ToRetail => samuel_nicuesa
2019-07-04 09:59marvintmStatusnew => feedback
2019-07-12 10:46samuel_nicuesaResolution time1564005600 => 1564696800
2019-07-12 10:46samuel_nicuesaReproducibilityunable to reproduce => always
2019-07-12 10:46samuel_nicuesaversionRR18Q3 => pi
2019-07-12 10:46samuel_nicuesaSummaryIn some circumstances the Copy Store Process are copying the same POS Terminal Type as the Original Store copied. => Copy Store Process are copying the same POS Terminal Type as the Original Store copied.
2019-07-12 10:46samuel_nicuesaDescription Updatedbug_revision_view_page.php?rev_id=19115#r19115
2019-07-12 10:46samuel_nicuesaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=19117#r19117
2019-07-12 10:46samuel_nicuesaProposed Solution updated
2019-07-12 10:46samuel_nicuesaFile Deleted: PossibleSolution.diff
2019-07-12 10:48samuel_nicuesaRelationship addedrelated to 0039091
2019-07-12 10:48samuel_nicuesaFile Added: CopyRetailStore.png
2019-07-12 10:49samuel_nicuesaFile Added: CopyStoreParametrization.png
2019-07-12 10:49samuel_nicuesaFile Added: SamePosterminalType1.png
2019-07-12 10:49samuel_nicuesaFile Added: SamePosterminalType2.png
2019-07-12 10:54samuel_nicuesaSummaryCopy Store Process are copying the same POS Terminal Type as the Original Store copied. => Copy Store Process are copying the same POS Terminal Type Name as the Original Store copied.
2019-07-12 10:54samuel_nicuesaDescription Updatedbug_revision_view_page.php?rev_id=19118#r19118
2019-07-12 12:48samuel_nicuesaStatusfeedback => new
2019-07-12 13:51samuel_nicuesaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=19119#r19119
2019-07-24 14:20ngarciaAssigned Tosamuel_nicuesa => Retail
2019-07-30 20:35rqueraltaAssigned ToRetail => rqueralta
2019-07-30 20:36rqueraltaStatusnew => scheduled
2019-08-01 21:04hgbotCheckin
2019-08-01 21:04hgbotNote Added: 0113764
2019-08-01 21:04hgbotStatusscheduled => resolved
2019-08-01 21:04hgbotResolutionopen => fixed
2019-08-01 21:04hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.copystore/rev/e8d56b27c953e64a8aa5634d36571cc6dfbb97aa [^]
2019-08-08 12:36marvintmReview Assigned To => marvintm
2019-08-08 12:36marvintmStatusresolved => closed
2019-08-08 12:36marvintmFixed in Version => RR19Q4

Notes
(0113167)
marvintm   
2019-07-04 09:59   
Cannot be reproduced in current version of Copy Store
(0113764)
hgbot   
2019-08-01 21:04   
Repository: erp/pmods/org.openbravo.retail.copystore
Changeset: e8d56b27c953e64a8aa5634d36571cc6dfbb97aa
Author: Rafael Queralta <rafaelcuba81 <at> gmail.com>
Date: Thu Aug 01 15:03:51 2019 -0400
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.copystore/rev/e8d56b27c953e64a8aa5634d36571cc6dfbb97aa [^]

Fixed issue 41270: Copy Store Process are copying the same POS Terminal Type
Name as the Original Store copied

- Now Copy Store Process is not copying the same POS Terminal Type Name
as the Original Store copied, if not the new name of the POS Terminal Type

---
M src/org/openbravo/retail/copystore/process/CopyStoreProcess.java
---