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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0027751
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Retail Modules] Discounts and Promotionsmajorhave not tried2014-10-03 12:082014-12-30 23:22
ReportermtaalView Statuspublic 
Assigned ToOrekaria 
PrioritynormalResolutionfixedFixed in VersionRR14Q4
StatusclosedFix in branchFixed in SCM revisionb31f866bf762
ProjectionnoneETAnoneTarget VersionRR14Q4
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tomtaal
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0027751: Revert dependency on mobile core

Description
Adding dependency on mobile.core will force direct ERP users of this module to also install mobile.core.

The issue affected only prepackaged Q4

a. the dependency was added because the javascript generated file had the discounts code inserted before the mobile.core code, and thus, the discounts code being out of reach of the mobile.core APIs and functions

b. when the dependency was added, the problem was that direct ERP users of this module were forced to install mobile.core

c. after removing the dependency, the discounts stopped working because enyo was the one initializing the methods that discounts needed to work (instead of mobile.core as its now in Q4)

A fix has been made so the discounts javascript code is appended after the mobile.core
Steps To Reproduce.
Proposed SolutionSolution is to revert this changeset:
https://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts/rev/7a87fa636987 [^]
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0070690)
hgbot (developer)
2014-10-03 13:02

Repository: erp/pmods/org.openbravo.retail.discounts
Changeset: a4d4091b3673dba49dd1258ce0ad103cba463f5b
Author: Rafa Alonso <rafael.alonso <at> openbravo.com>
Date: Fri Oct 03 13:01:42 2014 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts/rev/a4d4091b3673dba49dd1258ce0ad103cba463f5b [^]

Backed out issue 27341 changeset: 7a87fa636987. Fixes issue 27751

Adding dependency on mobile.core forces direct ERP users of this module to also install mobile.core

---
M src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
---
(0070691)
mtaal (manager)
2014-10-03 13:41

Reviewed
(0070710)
Orekaria (administrator)
2014-10-04 17:02

Discounts have stopped working in the WebPOS
(0070711)
hgbot (developer)
2014-10-04 17:14

Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 1330a04d606c6f32eb8e06c7142e91ce9d8dbf15
Author: Rafa Alonso <rafael.alonso <at> openbravo.com>
Date: Sat Oct 04 17:13:48 2014 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/1330a04d606c6f32eb8e06c7142e91ce9d8dbf15 [^]

Fixes issue 27751: discounts is enforced to be dependent of mobile.core

a. If the discounts module is dependent of mobile.core, the ERP is forced to install mobile.core, which is unwanted.
b. If the discounts module is not dependent of mobile.core, the javascript files are inserted before the mobile.core javascript files. This behavior prevent discounts to be computed

A hack has been inserted until better decoupling of mobile from the ERP is made

---
M src/org/openbravo/mobile/core/MobileCoreComponentServlet.java
A src/org/openbravo/mobile/core/MobileCoreKernelUtils.java
---
(0070712)
hgbot (developer)
2014-10-04 17:14

Repository: erp/devel/pi
Changeset: 9e26e16a3877d87ce79a7bf85a5a919b24cd7c1d
Author: Rafa Alonso <rafael.alonso <at> openbravo.com>
Date: Sat Oct 04 17:13:51 2014 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/9e26e16a3877d87ce79a7bf85a5a919b24cd7c1d [^]

Fixes issue 27751: discounts is enforced to be dependent of mobile.core

a. If the discounts module is dependent of mobile.core, the ERP is forced to install mobile.core, which is unwanted.
b. If the discounts module is not dependent of mobile.core, the javascript files are inserted before the mobile.core javascript files. This behavior prevent discounts to be computed

A hack has been inserted until better decoupling of mobile from the ERP is made

---
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelUtils.java
---
(0070715)
mtaal (manager)
2014-10-05 10:13
edited on: 2014-10-05 11:03

Some changes:
- make the id's of the modules static private final and declare them in the beginning of the class using capital names (see example of usage below)
- in the overridden method only keep the if-part you added
- add a return at the end of your if statement
- in kernelutils make ModuleDependencyCycleException private again
- add a call to super at the end of the overridden method

So then the overriding method in MobileCoreKernelUtils becomes something like this:
protected int computeLowLevelCode(Module module, List<Module> modules) {
    // Note: doesn't do the if in case the module is already in the modules list
    // this is a dependency cycle handled by the super implementation
   if (module.getId().equals(DISCOUNTS_MOD_ID) && !modules.contains(module)) {
       Module core = OBDal.getInstance().get(Module.class, MOBILE_CORE_MOD_ID);
       return 1 + computeLowLevelCode(core, new ArrayList<Module>());
    }
    super.computeLowLevelCode(module, modules);
}

(0070725)
hgbot (developer)
2014-10-06 09:45

Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 1dc9dc1c4a2e4d5069ba23fc0b673efeeacc7f38
Author: Rafa Alonso <rafael.alonso <at> openbravo.com>
Date: Mon Oct 06 09:44:57 2014 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/1dc9dc1c4a2e4d5069ba23fc0b673efeeacc7f38 [^]

Fixes issue 27751: discounts module dependent on mobile.core (refactor)
- refactored the overriden computeLowLevelCode method
- public class made private

---
M src/org/openbravo/mobile/core/MobileCoreKernelUtils.java
---
(0070726)
hgbot (developer)
2014-10-06 09:45

Repository: erp/devel/pi
Changeset: 04065681d156f159f421dc981b776f0e1e1d87f2
Author: Rafa Alonso <rafael.alonso <at> openbravo.com>
Date: Mon Oct 06 09:44:38 2014 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/04065681d156f159f421dc981b776f0e1e1d87f2 [^]

Fixes issue 27751: discounts module dependent on mobile.core (refactor)
- refactored the overriden computeLowLevelCode method
- public class made private

---
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelUtils.java
---
(0070727)
mtaal (manager)
2014-10-06 10:23

[10:17:47] Martin Taal: thanks the code can be more simplified
[10:17:57] Martin Taal: the static instance member can go
[10:18:01] Martin Taal: the getInstance also
[10:18:09] Martin Taal: and then in the MobileCoreComponentServlet
[10:18:18] Martin Taal: do new MobileCoreKernelUtils()
[10:18:23] Martin Taal: instead of MobileCoreKernelUtils.getInstance()
[10:18:30] Martin Taal: also there are some comment lines in the MobileCoreKernelUtils
[10:18:34] Martin Taal: which can go
[10:18:46] Martin Taal: the commented static and log member
(0070731)
hgbot (developer)
2014-10-06 10:55

Repository: erp/pmods/org.openbravo.mobile.core
Changeset: b31f866bf762e7fc3b7c2f9b34ff3a0a1d2108f3
Author: Rafa Alonso <rafael.alonso <at> openbravo.com>
Date: Mon Oct 06 10:54:47 2014 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/b31f866bf762e7fc3b7c2f9b34ff3a0a1d2108f3 [^]

Fixes issue 27751: discounts module dependent on mobile.core (refactor II)

---
M src/org/openbravo/mobile/core/MobileCoreComponentServlet.java
M src/org/openbravo/mobile/core/MobileCoreKernelUtils.java
---
(0070744)
hgbot (developer)
2014-10-06 16:03

Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 4ef52af25de15a48bc9db3e0e94ab5caede4b01f
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Mon Oct 06 16:03:20 2014 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/4ef52af25de15a48bc9db3e0e94ab5caede4b01f [^]

Related to issue 27751, discounts module dependent on mobile.core (refactor), cosmetic change
Small cosmetic change, removed unneeded code

---
M src/org/openbravo/mobile/core/MobileCoreKernelUtils.java
---
(0070747)
mtaal (manager)
2014-10-06 17:12

Reviewed and tested
(0072895)
hudsonbot (developer)
2014-12-30 23:22

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
(0072898)
hudsonbot (developer)
2014-12-30 23:22

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

- Issue History
Date Modified Username Field Change
2014-10-03 12:08 mtaal New Issue
2014-10-03 12:08 mtaal Assigned To => Orekaria
2014-10-03 12:08 mtaal Triggers an Emergency Pack => No
2014-10-03 13:02 hgbot Checkin
2014-10-03 13:02 hgbot Note Added: 0070690
2014-10-03 13:02 hgbot Status new => resolved
2014-10-03 13:02 hgbot Resolution open => fixed
2014-10-03 13:02 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts/rev/a4d4091b3673dba49dd1258ce0ad103cba463f5b [^]
2014-10-03 13:41 mtaal Review Assigned To => mtaal
2014-10-03 13:41 mtaal Note Added: 0070691
2014-10-03 13:41 mtaal Status resolved => closed
2014-10-03 13:41 mtaal Fixed in Version => RR14Q4
2014-10-04 17:02 Orekaria Note Added: 0070710
2014-10-04 17:02 Orekaria Status closed => new
2014-10-04 17:02 Orekaria Resolution fixed => open
2014-10-04 17:02 Orekaria Fixed in Version RR14Q4 =>
2014-10-04 17:14 hgbot Checkin
2014-10-04 17:14 hgbot Note Added: 0070711
2014-10-04 17:14 hgbot Status new => resolved
2014-10-04 17:14 hgbot Resolution open => fixed
2014-10-04 17:14 hgbot Fixed in SCM revision http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts/rev/a4d4091b3673dba49dd1258ce0ad103cba463f5b [^] => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/1330a04d606c6f32eb8e06c7142e91ce9d8dbf15 [^]
2014-10-04 17:14 hgbot Checkin
2014-10-04 17:14 hgbot Note Added: 0070712
2014-10-04 17:14 hgbot Fixed in SCM revision http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/1330a04d606c6f32eb8e06c7142e91ce9d8dbf15 [^] => http://code.openbravo.com/erp/devel/pi/rev/9e26e16a3877d87ce79a7bf85a5a919b24cd7c1d [^]
2014-10-05 10:13 mtaal Note Added: 0070715
2014-10-05 10:13 mtaal Status resolved => new
2014-10-05 10:13 mtaal Resolution fixed => open
2014-10-05 10:38 mtaal Note Edited: 0070715 View Revisions
2014-10-05 11:02 mtaal Note Edited: 0070715 View Revisions
2014-10-05 11:03 mtaal Note Edited: 0070715 View Revisions
2014-10-06 09:45 hgbot Checkin
2014-10-06 09:45 hgbot Note Added: 0070725
2014-10-06 09:45 hgbot Status new => resolved
2014-10-06 09:45 hgbot Resolution open => fixed
2014-10-06 09:45 hgbot Fixed in SCM revision http://code.openbravo.com/erp/devel/pi/rev/9e26e16a3877d87ce79a7bf85a5a919b24cd7c1d [^] => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/1dc9dc1c4a2e4d5069ba23fc0b673efeeacc7f38 [^]
2014-10-06 09:45 hgbot Checkin
2014-10-06 09:45 hgbot Note Added: 0070726
2014-10-06 09:45 hgbot Fixed in SCM revision http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/1dc9dc1c4a2e4d5069ba23fc0b673efeeacc7f38 [^] => http://code.openbravo.com/erp/devel/pi/rev/04065681d156f159f421dc981b776f0e1e1d87f2 [^]
2014-10-06 10:23 mtaal Note Added: 0070727
2014-10-06 10:55 hgbot Checkin
2014-10-06 10:55 hgbot Note Added: 0070731
2014-10-06 10:55 hgbot Fixed in SCM revision http://code.openbravo.com/erp/devel/pi/rev/04065681d156f159f421dc981b776f0e1e1d87f2 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/b31f866bf762e7fc3b7c2f9b34ff3a0a1d2108f3 [^]
2014-10-06 16:03 hgbot Checkin
2014-10-06 16:03 hgbot Note Added: 0070744
2014-10-06 17:12 mtaal Note Added: 0070747
2014-10-06 17:12 mtaal Status resolved => closed
2014-10-06 17:12 mtaal Fixed in Version => RR14Q4
2014-10-06 22:06 mtaal Description Updated View Revisions
2014-10-06 22:06 mtaal Proposed Solution updated
2014-12-30 23:22 hudsonbot Checkin
2014-12-30 23:22 hudsonbot Note Added: 0072895
2014-12-30 23:22 hudsonbot Checkin
2014-12-30 23:22 hudsonbot Note Added: 0072898


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker