Openbravo Issue Tracking System - Retail Modules
View Issue Details
0036114Retail ModulesWeb POSpublic2017-05-26 09:502017-06-12 09:22
Asantos9 
rqueralta 
highmajoralways
closedfixed 
5
 
RR17Q3 
marvintm
No
0036114: Save customer in Web POS is only allowed for the business partners selected on the tickets
In order to modify a customer different from the one selected on the ticket, it is not possible to use saveCustomer method. In this point it is not the event necessary to save the customer.
- Add a breakpoint in the client side in the following code:

    this.customer.on('customerSaved', function () {
      OB.DATA.executeCustomerSave(this.customer); <- here
    }, this);

- Open the customer selector, and then in the context menu select "Edit"
- Change the name of the customer, and click on Save. Notice that the flow stops in the breakpoint. This is correct, as the executeCustomerSave call will ensure that the customer is correctly saved.

However, this trigger doesn't happen if you get a customer in code, and try to execute saveCustomer to it:

OB.Dal.find(OB.Model.BusinessPartner, {
    id: 'D5BF95FA079B4248B2CA2E2DA477D1B8'
}, function(bps) {
    console.log(bps.at(0));
    bps.at(0).saveCustomer(function() {
        console.log('fin')
    })
})

We need to think on the best solution for this, but maybe one possibility is to modify the saveCustomer function so that it calls OB.DATA.executeCustomerSave(this.customer) directly instead of delegating on the trigger for that.
No tags attached.
Issue History
2017-05-26 09:50Asantos9New Issue
2017-05-26 09:50Asantos9Assigned To => Retail
2017-05-26 09:50Asantos9Resolution time => 1496959200
2017-05-26 09:50Asantos9Triggers an Emergency Pack => No
2017-05-29 15:51rqueraltaAssigned ToRetail => rqueralta
2017-05-29 15:51rqueraltaStatusnew => scheduled
2017-05-30 09:08marvintmSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=15237#r15237
2017-05-30 09:08marvintmProposed Solution updated
2017-06-07 22:26hgbotCheckin
2017-06-07 22:26hgbotNote Added: 0097197
2017-06-07 22:26hgbotStatusscheduled => resolved
2017-06-07 22:26hgbotResolutionopen => fixed
2017-06-07 22:26hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/98e87f3b39b60df54dc7c55e01096439f926c925 [^]
2017-06-12 09:22marvintmReview Assigned To => marvintm
2017-06-12 09:22marvintmStatusresolved => closed
2017-06-12 09:22marvintmFixed in Version => RR17Q3

Notes
(0097197)
hgbot   
2017-06-07 22:26   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 98e87f3b39b60df54dc7c55e01096439f926c925
Author: Rafael Queralta Pozo <rqueralta <at> nauta.cu>
Date: Thu Jun 01 09:23:15 2017 -0400
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/98e87f3b39b60df54dc7c55e01096439f926c925 [^]

Fixed issue 36114: Save customer in Web POS is only allowed for the business
partners selected on the tickets

---
M web/org.openbravo.retail.posterminal/js/model/businesspartner.js
---