Openbravo Issue Tracking System - Retail Modules
View Issue Details
0045040Retail ModulesWeb POSpublic2020-09-14 11:382020-09-25 14:49
gorka_gil 
gorka_gil 
urgentminoralways
closedfixed 
5
 
RR20Q4 
No
0045040: Implement pending part of support remote bp discounts
DiscountFilterBussinessPartner supports remote through preference OBPOS_remote.discount.bp.

But it is pending to implement in the new code the requests to the backend for this code.
Test CreateOTFWithDiscounts:
- In the last part that change to carl studson bp, it don't apply the discount that it should.
There is a function (OB.Discounts.Pos.addDiscountsByBusinessPartnerFilter) that reads the discounts from the db and store in the discounts cache,this function should be splitted in two parts one for read from the db and other to save in the discounts cache.

Check change bp method from where it is called, and also compare with all the requests of bp to the backend from where are done, in general when requesting to the backend for the bp it is needed to request also for the bp discounts.

When we get the data of the bp discounts from the backend we needed to save it to the db, so it is needed to create a masterdata endpoint for that, and since we don't know when it will be saved, we will use the splitted previous function to add directly to the discounts cache.
No tags attached.
depends on backport 0045136RR20Q3.2 closed gorka_gil Implement pending part of support remote bp discounts 
Issue History
2020-09-14 11:38gorka_gilNew Issue
2020-09-14 11:38gorka_gilAssigned To => Retail
2020-09-14 11:38gorka_gilTriggers an Emergency Pack => No
2020-09-14 12:06hgbotNote Added: 0123017
2020-09-23 00:11hgbotNote Added: 0123300
2020-09-23 00:12hgbotNote Added: 0123301
2020-09-23 00:16hgbotNote Added: 0123302
2020-09-23 02:22gorka_gilAssigned ToRetail => gorka_gil
2020-09-23 02:22gorka_gilStatusnew => scheduled
2020-09-24 22:20gorka_gilStatusscheduled => acknowledged
2020-09-24 22:20gorka_gilStatusacknowledged => scheduled
2020-09-25 14:37hgbotNote Added: 0123382
2020-09-25 14:49hgbotResolutionopen => fixed
2020-09-25 14:49hgbotStatusscheduled => closed
2020-09-25 14:49hgbotFixed in Version => RR20Q4
2020-09-25 14:49hgbotNote Added: 0123383
2020-09-25 14:49hgbotNote Added: 0123384
2020-09-25 14:49hgbotNote Added: 0123385
2020-09-25 14:49hgbotNote Added: 0123386
2020-09-25 14:49hgbotNote Added: 0123387
2020-09-25 14:49hgbotNote Added: 0123388
2020-09-25 14:49hgbotNote Added: 0123389
2020-09-25 14:49hgbotNote Added: 0123390
2020-09-25 14:49hgbotNote Added: 0123391
2020-09-25 14:49hgbotNote Added: 0123392
2020-09-25 14:49hgbotNote Added: 0123393
2020-09-25 14:49hgbotNote Added: 0123394

Notes
(0123017)
hgbot   
2020-09-14 12:06   
Repository: https://gitlab.com/openbravo/ci/mobile-test [^]
Changeset: 030352f624ca8343e4188e91b08dcb7222db5e1f
Author: Gorka Gil <gorka.gil@openbravo.com>
Date: 2020-09-14T12:06:00+02:00
URL: https://gitlab.com/openbravo/ci/mobile-test/-/commit/030352f624ca8343e4188e91b08dcb7222db5e1f [^]

Related to ISSUE-45040: Disable test CreateOTFWithDiscounts till bp.discounts remote is ready

---
M src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/productonfly/CreateOTFWithDiscounts.java
---
(0123300)
hgbot   
2020-09-23 00:11   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts/-/merge_requests/4 [^]
(0123301)
hgbot   
2020-09-23 00:12   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/106 [^]
(0123302)
hgbot   
2020-09-23 00:16   
Merge Request created: https://gitlab.com/openbravo/ci/mobile-test/-/merge_requests/46 [^]
(0123382)
hgbot   
2020-09-25 14:37   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/merge_requests/78 [^]
(0123386)
hgbot   
2020-09-25 14:49   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts [^]
Changeset: d295d712f4b8f4995e97fc85d34dfedd38aeaceb
Author: Gorka Gil <gorka.gil@openbravo.com>
Date: 2020-09-24T22:15:17+02:00
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts/-/commit/d295d712f4b8f4995e97fc85d34dfedd38aeaceb [^]

Related to ISSUE-45040: code review

Avoid the use of old apis in the new code

---
M web/org.openbravo.retail.discounts/app/model/business-logic/discounts-engine/interface/discount-posinterface.js
---
(0123385)
hgbot   
2020-09-25 14:49   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts [^]
Changeset: 713a6706d550d3008971dbbbc1093ada4a571758
Author: Gorka Gil <gorka.gil@openbravo.com>
Date: 2020-09-23T22:49:54+02:00
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts/-/commit/713a6706d550d3008971dbbbc1093ada4a571758 [^]

Related to ISSUE-45040: Fix bp dis remote to not fail in offline

---
M web/org.openbravo.retail.discounts/app/model/business-logic/discounts-engine/interface/discount-posinterface.js
---
(0123384)
hgbot   
2020-09-25 14:49   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts/-/merge_requests/4 [^]
(0123383)
hgbot   
2020-09-25 14:49   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts [^]
Changeset: f0a2570fe1373641f08babb785c85abc44379c9a
Author: Gorka Gil <gorka.gil@openbravo.com>
Date: 2020-09-23T00:00:18+02:00
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts/-/commit/f0a2570fe1373641f08babb785c85abc44379c9a [^]

Fixes ISSUE-45040: Fix remote bp discounts

- Split method to add the bp discounts into read masterdata and save into the cache.
- Also mantained the old method to call the both actions when bp discounts are not remote.
- Created utility function to get the bp discounts from the backend.
- Added to the load (f5 and logins) the load of the bp discounts
  - If first login after clean cache the bp is needed to read from terminal model
    instead of read from the state

---
M web/org.openbravo.retail.discounts/app/model/business-logic/discounts-engine/interface/discount-posinterface.js
---
(0123387)
hgbot   
2020-09-25 14:49   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal [^]
Changeset: 6103864c8fbb7bf943e59462f79834c2f404d515
Author: Gorka Gil <gorka.gil@openbravo.com>
Date: 2020-09-25T12:48:56+00:00
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/commit/6103864c8fbb7bf943e59462f79834c2f404d515 [^]

Related to ISSUE-45040: when changing the bp load the bp discounts if they are in remote

- re-added DiscountFilterBusinessPartner model, to allow the ob.dal.find for remote bp discounts
- call to the utility functions to load the bp from backend and adds hte cbpartners as discounts childs
  in the discounts cache

---
A web/org.openbravo.retail.posterminal/js/model/promotions.js
M src/org/openbravo/retail/posterminal/OBPOSComponentProvider.java
M web/org.openbravo.retail.posterminal/js/model/order.js
---
(0123388)
hgbot   
2020-09-25 14:49   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal [^]
Changeset: de6cd47f2cd78193b273c86fdd79b0cef2597195
Author: Gorka Gil <gorka.gil@openbravo.com>
Date: 2020-09-25T12:48:56+00:00
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/commit/de6cd47f2cd78193b273c86fdd79b0cef2597195 [^]

Related to ISSUE-45040: fix bp dis remote to not fail in offline

---
M web/org.openbravo.retail.posterminal/js/model/order.js
---
(0123389)
hgbot   
2020-09-25 14:49   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal [^]
Changeset: 62dd0c920abe80064c86a91ff382f25a6080d66f
Author: Gorka Gil <gorka.gil@openbravo.com>
Date: 2020-09-25T12:48:56+00:00
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/commit/62dd0c920abe80064c86a91ff382f25a6080d66f [^]

Related to ISSUE-45040: code review

Avoid the use of old apis

---
M web/org.openbravo.retail.posterminal/js/model/order.js
---
(0123390)
hgbot   
2020-09-25 14:49   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/106 [^]
(0123391)
hgbot   
2020-09-25 14:49   
Repository: https://gitlab.com/openbravo/ci/mobile-test [^]
Changeset: 75907f7308473fa1c15e0fd64e64d1dda333caa9
Author: Gorka Gil <gorka.gil@openbravo.com>
Date: 2020-09-23T02:19:43+02:00
URL: https://gitlab.com/openbravo/ci/mobile-test/-/commit/75907f7308473fa1c15e0fd64e64d1dda333caa9 [^]

Related to ISSUE-45040: Enable test CreateOTFWithDiscounts

---
M src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/productonfly/CreateOTFWithDiscounts.java
---
(0123392)
hgbot   
2020-09-25 14:49   
Merge request merged: https://gitlab.com/openbravo/ci/mobile-test/-/merge_requests/46 [^]
(0123393)
hgbot   
2020-09-25 14:49   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core [^]
Changeset: dd88783e138d26abc661ee667a3a840c02713282
Author: Gorka Gil <gorka.gil@openbravo.com>
Date: 2020-09-25T00:28:45+02:00
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/commit/dd88783e138d26abc661ee667a3a840c02713282 [^]

Related to ISSUE-45040: fix wrappers OB.App.DAL.remoteSearch/Get in case of error

---
M web/org.openbravo.mobile.core/app/util/DAL.js
---
(0123394)
hgbot   
2020-09-25 14:49   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/merge_requests/78 [^]