Openbravo Issue Tracking System - Retail Modules
View Issue Details
0027431Retail ModulesWeb POSpublic2014-08-23 12:392015-06-10 20:07
Orekaria 
Retail 
normalcriticalalways
closedsuspended 
5
 
RR15Q3 
Orekaria
No
0027431: Sometimes the business partner is empty when the WebPOS loads
Sometimes the business partner is empty when the WebPOS loads. This seems to happen only the first time the WebPOS loads.

Reproduced in Q4:

When this happens:

The WebPOS is inoperative:
    - fails to add some products whilst others can be added
    - some added products can be deleted whilst others can't
    - the total to pay is always '0.00'
    - the sale can't be finished
    - the receipt can't be deleted


This console errors are shown:

    - when trying to delete a product from the receipt
        Uncaught TypeError: Cannot read property 'get' of null (cause: this.get('bp') === null)
    
        this.receipt.calculateTaxes = function (callback) {
            var me = this,
                bpTaxCategory = this.get('bp').get('taxCategory'),

    - when trying to delete the receipt:
        Uncaught TypeError: Cannot read property 'constructor' of null (cause: model.constructor === null)

            OB.Dal.remove = function (model, success, error) {
                var modelDefinition = OB.Model[model.constructor.prototype.modelName],

        Uncaught TypeError: Cannot read property 'get' of undefined

            if (OB.POS.modelterminal.hasPermission('OBPOS_receipt.invoice')) {
                if (OB.POS.modelterminal.hasPermission('OBPOS_retail.restricttaxidinvoice') && !OB.POS.modelterminal.get('businessPartner').get('taxID')) {

    - when trying to create a new receipt:
        Uncaught TypeError: Cannot read property 'get' of undefined (cause: OB.POS.modelterminal.get('businessPartner') === undefined)

            if (OB.POS.modelterminal.hasPermission('OBPOS_receipt.invoice')) {
                if (OB.POS.modelterminal.hasPermission('OBPOS_retail.restricttaxidinvoice') && !OB.POS.modelterminal.get('businessPartner').get('taxID')) {


Console trace when loading the WebPOS:

    Adding master entry to Application Cache with manifest http://localhost:8080/openbravo/org.openbravo.client.kernel/OBPOS_Main/AppCacheManifest?_appName=WebPOS [^] localhost:8080/openbravo/web/org.openbravo.retail.posterminal/?terminal=VBS-1:1
    Application Cache NoUpdate event localhost:8080/openbravo/web/org.openbravo.retail.posterminal/?terminal=VBS-1:1
    'webkitRequestAnimationFrame' is vendor-specific. Please use the standard 'requestAnimationFrame' instead.
    'webkitCancelRequestAnimationFrame' is vendor-specific. Please use the standard 'cancelAnimationFrame' instead.
    OB.UTIL.Debug 0.1 is available
    Deprecated (since RR14Q4.0): OB.UTILS namespace has been removed
    TestRegistry 1.0.2 is available
    Failed to load resource: the server responded with a status of 401 (Unauthorized) http://localhost:8080/openbravo/org.openbravo.mobile.core.service.jsonrest/ [^]…value%22:true,%22type%22:%22boolean%22%7D%7D,%22appName%22:%22WebPOS%22%7D
    Starting to load properties based on properties loaders
    Array[12]
     http://localhost:8080/openbravo/web/js/gen/5c49b50dd84da3791191799b11c2d010.js:2964: [^]
    Loading... terminal http://localhost:8080/openbravo/web/js/gen/5c49b50dd84da3791191799b11c2d010.js:17079:1 [^]
    Loading... context http://localhost:8080/openbravo/web/js/gen/5c49b50dd84da3791191799b11c2d010.js:17142:1 [^]
    loading... payments http://localhost:8080/openbravo/web/js/gen/5c49b50dd84da3791191799b11c2d010.js:17159:1 [^]
    loading... cashMgmtDepositEvents
    loading... cashMgmtDropEvents
    loading... businesspartner http://localhost:8080/openbravo/web/js/gen/5c49b50dd84da3791191799b11c2d010.js:17202:1 [^]
    loading... location http://localhost:8080/openbravo/web/js/gen/5c49b50dd84da3791191799b11c2d010.js:17217:1 [^]
    loading... pricelist http://localhost:8080/openbravo/web/js/gen/5c49b50dd84da3791191799b11c2d010.js:17231:1 [^]
    loading... warehouses http://localhost:8080/openbravo/web/js/gen/5c49b50dd84da3791191799b11c2d010.js:17245:1 [^]
    loading... writableOrganizations http://localhost:8080/openbravo/web/js/gen/5c49b50dd84da3791191799b11c2d010.js:17262:1 [^]
    loading... pricelistversion http://localhost:8080/openbravo/web/js/gen/5c49b50dd84da3791191799b11c2d010.js:17276:1 [^]
    loading... currency http://localhost:8080/openbravo/web/js/gen/5c49b50dd84da3791191799b11c2d010.js:17294:1 [^]
    "context" "is/are loaded" "http://localhost:8080/openbravo/web/js/gen/5c49b50dd84da3791191799b11c2d010.js:2931:" [^]
    "writableOrganizations" "is/are loaded" "http://localhost:8080/openbravo/web/js/gen/5c49b50dd84da3791191799b11c2d010.js:2931:" [^]
    "location" "is/are loaded" "http://localhost:8080/openbravo/web/js/gen/5c49b50dd84da3791191799b11c2d010.js:2931:" [^]
    "pricelist" "is/are loaded" "http://localhost:8080/openbravo/web/js/gen/5c49b50dd84da3791191799b11c2d010.js:2931:" [^]
    "businesspartner" "is/are loaded" "http://localhost:8080/openbravo/web/js/gen/5c49b50dd84da3791191799b11c2d010.js:2931:" [^]
    "warehouses" "is/are loaded" "http://localhost:8080/openbravo/web/js/gen/5c49b50dd84da3791191799b11c2d010.js:2931:" [^]
    "cashMgmtDepositEvents" "is/are loaded" "http://localhost:8080/openbravo/web/js/gen/5c49b50dd84da3791191799b11c2d010.js:2931:" [^]
    "cashMgmtDropEvents" "is/are loaded" "http://localhost:8080/openbravo/web/js/gen/5c49b50dd84da3791191799b11c2d010.js:2931:" [^]
    "pricelistversion" "is/are loaded" "http://localhost:8080/openbravo/web/js/gen/5c49b50dd84da3791191799b11c2d010.js:2931:" [^]
    "currency" "is/are loaded" "http://localhost:8080/openbravo/web/js/gen/5c49b50dd84da3791191799b11c2d010.js:2931:" [^]
    "payments" "is/are loaded" "http://localhost:8080/openbravo/web/js/gen/5c49b50dd84da3791191799b11c2d010.js:2931:" [^]
    "terminal" "is/are loaded" "http://localhost:8080/openbravo/web/js/gen/5c49b50dd84da3791191799b11c2d010.js:2931:" [^]
    DiscountFilterBusinessPartner is/are loaded http://localhost:8080/openbravo/web/js/gen/5c49b50dd84da3791191799b11c2d010.js:1952:1 [^]
    DiscountFilterBusinessPartnerGroup is/are loaded http://localhost:8080/openbravo/web/js/gen/5c49b50dd84da3791191799b11c2d010.js:1952:1 [^]
    DiscountFilterProductCategory is/are loaded http://localhost:8080/openbravo/web/js/gen/5c49b50dd84da3791191799b11c2d010.js:1952:1 [^]
    DiscountFilterProduct is/are loaded http://localhost:8080/openbravo/web/js/gen/5c49b50dd84da3791191799b11c2d010.js:1952:1 [^]
    TaxRate is/are loaded http://localhost:8080/openbravo/web/js/gen/5c49b50dd84da3791191799b11c2d010.js:1952:1 [^]
    Discount is/are loaded http://localhost:8080/openbravo/web/js/gen/5c49b50dd84da3791191799b11c2d010.js:1952:1 [^]
    DiscountFilterRole is/are loaded http://localhost:8080/openbravo/web/js/gen/5c49b50dd84da3791191799b11c2d010.js:1952:1 [^]
    properties has been loaded successfully:
        appDisplayName: "Openbravo Mobile"
        appModuleId: "FF808181326CC34901326D53DBCF0018"
        appName: "WebPOS"
        applicationFormatUrl: "../../org.openbravo.client.kernel/OBPOS_Main/ApplicationFormats"
        businesspartner: "ABD91C9D3BC94175B876FBBE9CACA008"
        cashMgmtDepositEvents: Array[1]
        cashMgmtDropEvents: Array[2]
        connectedToERP: true
        context: Object
        currency: Object
        dataSyncModels: Array[5]
        documentsequence: 84
        isDisableDiscount: false
        isLoggingIn: false
        lastPaneShown: "scan"
        localDB: Object
        location: Object
        logConfiguration: Object
        logDBStmtThreshold: 1000
        logDBTrxThreshold: 300
        loggedOffline: false
        loginHandlerUrl: "../../org.openbravo.retail.posterminal/POSLoginHandler"
        loginUtilsParams: Object
        loginUtilsUrl: "../../org.openbravo.retail.posterminal.service.loginutils"
        logoutUrlParams: Object
        orgUserId: "3073EDF96A3C42CC86C7069E379522D2"
        paymentcash: "OBPOS_payment.cash"
        payments: Array[4]
        permissions: Object
        pricelist: Object
        pricelistversion: Object
        profileOptions: Object
        propertiesLoaders: Array[12]
        quotationDocumentSequence: 3
        session: "0BB285BA40B287D5CD410FAB1ED51779"
        supportsOffline: true
        terminal: Object
        terminalName: "VBS-1"
        useBarcode: false
        warehouses: Array[2]
        windows: null
        writableOrganizations: Array[2]
        __proto__: Object
     
    The 'x-webkit-speech' input field attribute is deprecated. Please use the JavaScript API instead.
    Total time to log in: 4449



chrome://appcache-internals [^]


Manifest: http://localhost:8080/openbravo/org.openbravo.client.kernel/OBPOS_Main/AppCacheManifest?_appName=WebPOS [^]

Remove View Entries
Size: 9.5 kB
Creation Time: Thursday, August 28, 2014 20:10:11 PM
Last Update Time: Friday, August 29, 2014 8:54:23 AM
Last Access Time: Friday, August 29, 2014 9:10:43 AM

Flags URL Size (headers and data)
Manifest, http://localhost:8080/openbravo/org.openbravo.client.kernel/OBPOS_Main/AppCacheManifest?_appName=WebPOS [^] 316 B
Master, http://localhost:8080/openbravo/web/org.openbravo.retail.posterminal/?terminal=CMS-1 [^] 4.6 kB
Master, http://localhost:8080/openbravo/web/org.openbravo.retail.posterminal/?terminal=VBS-1 [^] 4.6 kB


TestRegistry.registry('payment_paymentTabContent').enyoObject.model.get('order'):

    child {attributes: Object, _escapedAttributes: Object, cid: "c31", changed: Object, _silent: Object…}
    _callbacks: Object
    _changing: false
    _escapedAttributes: Object
    _pending: Object
    _previousAttributes: Object
    _silent: Object
    attributes: Object
    approvals: Array[0]
    bp: null
    change: 0
    client: null
    createdBy: null
    currency: null
    currency$_identifier: null
    description: ""
    documentNo: ""
    documentType: null
    generateInvoice: false
    gross: 0
    hasbeenpaid: "N"
    id: null
    isEditable: true
    isLayaway: false
    isPaid: false
    isQuotation: false
    isbeingprocessed: "N"
    lines: child
    net: 0
    oldId: null
    openDrawer: false
    orderDate: Fri Aug 29 2014 08:54:30 GMT+0200 (CEST)
    orderType: 0
    organization: null
    paidOnCredit: false
    payment: 0
    payments: child
    posTerminal: null
    posTerminal$_identifier: null
    priceIncludesTax: null
    priceList: null
    print: true
    qty: 0
    salesRepresentative: null
    salesRepresentative$_identifier: null
    sendEmail: false
    session: null
    taxes: null
    totalamount: null
    undo: null
    updatedBy: null
    warehouse: null
    __proto__: Object
    calculateTaxes: function (callback) {
    changed: Object
    cid: "c31"


Installed modules:

    org.openbravo.advpaymentmngt/
    org.openbravo.agingbalance/
    org.openbravo.base.weld/
    org.openbravo.client.application/
    org.openbravo.client.htmlwidget/
    org.openbravo.client.kernel/
    org.openbravo.client.myob/
    org.openbravo.client.querylist/
    org.openbravo.client.widgets/
    org.openbravo.financial.cashflowforecast/
    org.openbravo.financial.paymentreport/
    org.openbravo.mobile.core/
    org.openbravo.mobile.warehouse/
    org.openbravo.reports.ordersawaitingdelivery/
    org.openbravo.retail.config/
    org.openbravo.retail.copystore/ (!)
    org.openbravo.retail.discounts/
    org.openbravo.retail.giftcards/
    org.openbravo.retail.pack/
    org.openbravo.retail.poshwmanager/
    org.openbravo.retail.posterminal/
    org.openbravo.retail.returns/
    org.openbravo.retail.sampledata/
    org.openbravo.service.datasource/
    org.openbravo.service.integration.google/
    org.openbravo.service.integration.openid/
    org.openbravo.service.json/
    org.openbravo.userinterface.selector/
    org.openbravo.userinterface.skin.250to300Comp/
    org.openbravo.userinterface.smartclient/
    org.openbravo.utility.multiplebpselector/
    org.openbravo.v3/
    org.openbravo.v3.datasets/
    org.openbravo.v3.framework/
How to reproduce it:
Log into the WebPOS
Select the business partner 'Arturo Montoro'
In the menu, select 'Invoice this receipt'
Refresh the web page
Verify that the attached screenshot is shown


Deprecated:

If one can reproduce this issue, please backup the Web SQL database before fixing it (clear cache seems to do the trick)

Try this:

Downgrade core, posterminal and giftcards to Q2.2
install.source
clear cache
Load the WebPOS
Log in

Upgrade to Q4
install.source
Do not clear cache
Load the WebPOS
Log in


Or this:

Install copyStore module and its dependencies
Copy the VBS store into another one
Load the WebPOS
Log in as VallBlanca

In a terminal suffering this issue:

Remove chrome://appcache-internals/ [^]
Reload the WebPOS
Verify that this action does not fix the issue

Clear the cache
Reload the WebPOS
Verify that the WebPOS is working again
No tags attached.
related to defect 0027808RR14Q4 closed migueldejuana At webpos, when i login both Business partner and Business partner address details shown as blank and also warning message appea 
depends on feature request 0027267RR14Q4 closed Orekaria Stabilization: Core async calls should be watched by the SynchronizationHelper 
depends on feature request 0026894RR14Q4 closed Orekaria Stabilization: Improve the synchronization management 
depends on defect 0026740RR14Q3 closed malsasua Disable the pay button until the discounts have been applied 
depends on defect 0027268RR14Q4 closed Orekaria Stabilization: Improve the enabling/disabling of the pay button 
depends on feature request 0027505 new Retail Support: Backup/Restore of the browser's WebSQL database 
depends on defect 0027413 new Retail Stabilization: It should never ever be necessary to clear cache. 
depends on defect 0027506RR14Q4 closed Orekaria Stabilization: The 'pay' button should not be enabled if the order can't be payed 
related to feature request 0027526RR14Q4 closed Orekaria Tests: Fix the Business Partner modal to support ScrollableTable test functions 
related to defect 0028428RR15Q3 closed aaroncalero Improve master data loading of WebPOS 
Not all the children of this issue are yet resolved or closed.
patch Issue 27431: The business partner is required to pay a receipt.patch (2,217) 2014-08-27 22:55
https://issues.openbravo.com/file_download.php?file_id=7169&type=bug
png businessPartnerNotShown.png (120,465) 2014-08-29 08:57
https://issues.openbravo.com/file_download.php?file_id=7173&type=bug
png

? 5c49b50dd84da3791191799b11c2d010.js (1,467,545) 2014-08-29 09:15
https://issues.openbravo.com/file_download.php?file_id=7174&type=bug
Issue History
2014-08-23 12:39OrekariaNew Issue
2014-08-23 12:39OrekariaAssigned To => Orekaria
2014-08-23 12:39OrekariaTriggers an Emergency Pack => No
2014-08-23 12:40OrekariaRelationship addedblocks 0027329
2014-08-23 12:44OrekariaDescription Updatedbug_revision_view_page.php?rev_id=6433#r6433
2014-08-23 12:44OrekariaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=6435#r6435
2014-08-23 12:45OrekariaFile Added: CashUp_18.JPG
2014-08-23 12:46OrekariaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=6436#r6436
2014-08-23 14:44OrekariaDescription Updatedbug_revision_view_page.php?rev_id=6437#r6437
2014-08-23 14:44OrekariaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=6438#r6438
2014-08-23 14:54OrekariaAssigned ToOrekaria => marvintm
2014-08-23 14:54OrekariaSummaryStabilization: If a ticket is created with a null business partner, the user is unable to make the cashup => If a ticket is created with a null business partner, the user is unable to make the cashup
2014-08-23 15:22OrekariaProposed Solution updated
2014-08-23 15:25OrekariaRelationship deletedblocks 0027329
2014-08-25 11:35dmitry_mezentsevNote Added: 0069704
2014-08-25 11:36dmitry_mezentsevRelationship addedrelated to 0027228
2014-08-25 14:20jonalegriaesarteResolution time => 1409004000
2014-08-25 15:42OrekariaRelationship addeddepends on 0027267
2014-08-25 16:05jecharriIssue Monitored: jecharri
2014-08-25 16:38OrekariaNote Added: 0069715
2014-08-25 16:47dmitry_mezentsevNote Added: 0069716
2014-08-25 17:10OrekariaNote Edited: 0069715bug_revision_view_page.php?bugnote_id=0069715#r6454
2014-08-25 17:10OrekariaRelationship addeddepends on 0026894
2014-08-26 11:15OrekariaRelationship addeddepends on 0027287
2014-08-26 13:12OrekariaRelationship addeddepends on 0026740
2014-08-26 18:37OrekariaSummaryIf a ticket is created with a null business partner, the user is unable to make the cashup => Sometimes the business partner is empty when the WebPOS loads
2014-08-26 18:37OrekariaDescription Updatedbug_revision_view_page.php?rev_id=6464#r6464
2014-08-26 18:37OrekariaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=6465#r6465
2014-08-26 18:37OrekariaProposed Solution updated
2014-08-27 14:37OrekariaTarget VersionRR14Q4 => RR14Q3
2014-08-27 14:40OrekariaRelationship addeddepends on 0027268
2014-08-27 21:16OrekariaTypedefect => backport
2014-08-27 22:55OrekariaFile Added: Issue 27431: The business partner is required to pay a receipt.patch
2014-08-27 22:56OrekariaNote Added: 0069817
2014-08-27 22:56OrekariaStatusnew => scheduled
2014-08-27 22:56OrekariaAssigned Tomarvintm => Orekaria
2014-08-27 22:56Orekariafix_in_branch => pi
2014-08-27 22:57OrekariaNote Deleted: 0069817
2014-08-27 22:57OrekariaNote Added: 0069818
2014-08-27 22:57OrekariaStatusscheduled => resolved
2014-08-27 22:57OrekariaFixed in Version => RR14Q3
2014-08-27 22:57OrekariaResolutionopen => fixed
2014-08-29 08:56OrekariaStatusresolved => new
2014-08-29 08:56OrekariaResolutionfixed => open
2014-08-29 08:56OrekariaFixed in VersionRR14Q3 =>
2014-08-29 08:57OrekariaFile Added: businessPartnerNotShown.png
2014-08-29 09:07Orekariafix_in_branchpi =>
2014-08-29 09:07OrekariaDescription Updatedbug_revision_view_page.php?rev_id=6477#r6477
2014-08-29 09:07OrekariaFile Deleted: CashUp_18.JPG
2014-08-29 09:12OrekariaDescription Updatedbug_revision_view_page.php?rev_id=6478#r6478
2014-08-29 09:15OrekariaFile Added: 5c49b50dd84da3791191799b11c2d010.js
2014-08-29 09:30OrekariaDescription Updatedbug_revision_view_page.php?rev_id=6479#r6479
2014-08-29 09:49OrekariaFile Added: eclipse.png
2014-08-29 09:54OrekariaDescription Updatedbug_revision_view_page.php?rev_id=6480#r6480
2014-08-29 09:55OrekariaDescription Updatedbug_revision_view_page.php?rev_id=6481#r6481
2014-08-29 10:32OrekariaDescription Updatedbug_revision_view_page.php?rev_id=6482#r6482
2014-08-29 10:44OrekariaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=6483#r6483
2014-08-29 10:44OrekariaProposed Solution updated
2014-08-29 10:46OrekariaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=6484#r6484
2014-08-29 10:49OrekariaRelationship addeddepends on 0027505
2014-08-29 10:59OrekariaRelationship addeddepends on 0027413
2014-08-29 11:00OrekariaRelationship deletedrelated to 0027228
2014-08-29 11:02OrekariaRelationship deleteddepends on 0027287
2014-08-29 11:09OrekariaRelationship addeddepends on 0027506
2014-09-02 11:49OrekariaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=6514#r6514
2014-09-02 11:50OrekariaFile Deleted: eclipse.png
2014-09-02 13:05OrekariaRelationship addedrelated to 0027526
2014-09-02 20:07OrekariaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=6517#r6517
2014-10-08 14:28adrianromeroNote Added: 0070815
2014-11-11 18:15OrekariaRelationship addedrelated to 0027808
2015-06-10 17:33OrekariaTarget VersionRR14Q3 =>
2015-06-10 17:33OrekariaAssigned ToOrekaria => Retail
2015-06-10 20:07OrekariaReview Assigned To => Orekaria
2015-06-10 20:07OrekariaNote Added: 0078198
2015-06-10 20:07OrekariaStatusnew => closed
2015-06-10 20:07OrekariaNote Added: 0078199
2015-06-10 20:07OrekariaResolutionopen => suspended
2015-06-10 20:07OrekariaFixed in Version => RR15Q3
2015-06-10 20:12OrekariaRelationship addedrelated to 0028428

Notes
(0069704)
dmitry_mezentsev   
2014-08-25 11:35   
As for me the real issue here is that there is an option to create a ticket without a BP. It should not be possible at all (similar like it is not possible in the backoffice). And the issue is related with 27228.
(0069715)
Orekaria   
2014-08-25 16:38   
(edited on: 2014-08-25 17:10)
The issue is fixed in Q4 with the fix 27267 and its dependent issues (26894: new SynchronizationHelper)

I found that it happens in slow/unstable networks. The models are loaded slowly but the WebPOS is operative

The backport of the fix implies several files and changes as it is now

(0069716)
dmitry_mezentsev   
2014-08-25 16:47   
Can we think on some very "light" solution till we have the proper fix to avoid this case from happening?
(0069818)
Orekaria   
2014-08-27 22:57   
Attached the patch. Should not be applied on Q4 and later
(0070815)
adrianromero   
2014-10-08 14:28   
Right now in a Q3 instance we are reproducing this issue consistently. It is not possible to operate with the POS because of this problem. It is an amazon instance with a lot of data. The patch attached does not help.

Problem is located in:
org.openbravo.retail.posterminal/js/pointofsale/model/pointofsale-model.js
in the line:
var partnerAddressId = OB.MobileApp.model.get('terminal').partnerAddress,

And the error is raised because OB.MobileApp.model.get('terminal') is null...
(0078198)
Orekaria   
2015-06-10 20:07   
This issue is rejected
The improvements introduced in RR15Q3 should fix the issue
If the issue is reproduced again, please create another issue with updated 'Steps to reproduce'
(0078199)
Orekaria   
2015-06-10 20:07   
This issue is rejected
The improvements introduced in RR15Q3 should fix the issue
If the issue is reproduced again, please create another issue with updated 'Steps to reproduce'