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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0045074
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Retail Modules] Loyalty Programs for Web POSmajorrandom2020-09-16 18:152020-10-09 07:37
ReporteraaroncaleroView Statuspublic 
Assigned Toranjith_qualiantech_com 
PriorityhighResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0045074: Random JS error after creating a customer

DescriptionWhen the Loyalty programs for WebPOS module is installed, sometimes after creating a customer a js error is raised.
Remote mode for customers must be enabled.

The error occurs when the customer is rendered in the ticket. A call is done to the server to refresh the subscription information, but it fails if the customer has not been created yet.
Steps To ReproduceIn an environment with Loyalty programs for WebPOS installed.
Log in backend, go to the preference window and make sure that Enable remote for customers is defined with value Y
Log in WebPOS
Click on the Customer button > New Customer
Add the required fields and click on Save.
Finally assign the customer to the ticket.

If the import entry processing is slow, the customer is assigned to the ticket, the refresh code is triggered, but since the customer is not present yet in the database, a null is returned to webpos, and the js error is raised
Proposed SolutionThe code causing the issue is the function OBRLP.Util.refreshCustomer defined in the obrlputils.js file. After doing the remote find:
    OB.Dal.find(OB.Model.BusinessPartner, criteria, function(bps) {
      const bpRefresh = bps.at(0);
      callback(bpRefresh);
    });
It assumes that the bp will exist and calls the callback anyway.

Two possible solutions:
1) Don't execute the callback if there is no customer
2) Check the points in code where OBRLP.Util.refreshCustomer is used (afaik there is just 1 call) and fix that code to prevent the js error if the bp is null.

TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0123559)
hgbot (developer)
2020-10-06 06:41

Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.loyalty.programs/-/merge_requests/8 [^]
(0123633)
hgbot (developer)
2020-10-09 07:37

Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.loyalty.programs/-/merge_requests/8 [^]
(0123634)
hgbot (developer)
2020-10-09 07:37

Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.loyalty.programs [^]
Changeset: 175d71d2264256833e2a224ddd5a90caea5c0821
Author: Ranjith S R <ranjith@qualiantech.com>
Date: 2020-10-09T05:37:42+00:00
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.loyalty.programs/-/commit/175d71d2264256833e2a224ddd5a90caea5c0821 [^]

Fixed ISSUE-45074: Added Customer validation when assigned to the receipt
* Added validation in showing loyalty points when customer assigned to the receipt

---
M web/org.openbravo.retail.loyalty.programs/js/utils/obrlputils.js
M web/org.openbravo.retail.loyalty.programs/js/view/businesspartner-selectors.js
---

- Issue History
Date Modified Username Field Change
2020-09-16 18:15 aaroncalero New Issue
2020-09-16 18:15 aaroncalero Assigned To => Retail
2020-09-16 18:15 aaroncalero Resolution time => 1602021600
2020-09-16 18:15 aaroncalero Triggers an Emergency Pack => No
2020-10-05 12:50 ranjith_qualiantech_com Assigned To Retail => ranjith_qualiantech_com
2020-10-05 12:50 ranjith_qualiantech_com Status new => scheduled
2020-10-06 06:41 hgbot Note Added: 0123559
2020-10-09 07:37 hgbot Note Added: 0123633
2020-10-09 07:37 hgbot Resolution open => fixed
2020-10-09 07:37 hgbot Status scheduled => closed
2020-10-09 07:37 hgbot Note Added: 0123634


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker