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-09-16 18:15
ReporteraaroncaleroView Statuspublic 
Assigned ToRetail 
PriorityhighResolutionopenFixed in Version
StatusnewFix 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
There are no notes attached to this issue.

- 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 Triggers an Emergency Pack => No


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker