Skip to Content
Menu
This question has been flagged
1 Reply
2301 Views

Hello guys,


i am getting error when open kitchen login in odoo12 pos.

please help

my error,

TypeError: this._callLocalStorage is not a function http://localhost:8069/web/content/701-6678b2e/point_of_sale.pos_assets_backend.js:2539 Traceback: _heartbeat@http://localhost:8069/web/content/701-6678b2e/point_of_sale.pos_assets_backend.js:2539:576 


Avatar
Discard
Best Answer

odoo\addons\bus\static\src\js
crosstab_bus.js
_heartbeat: function () {...} lin 181

remplace par 

_heartbeat: function () {

try {

var now = new Date().getTime();

var heartbeatValue = parseInt(this._callLocalStorage('getItem', 'heartbeat', 0));
var peers = this._callLocalStorage('getItem', 'peers', {});

if ((heartbeatValue + this.HEARTBEAT_OUT_OF_DATE_PERIOD) < now) {
// Heartbeat is out of date. Electing new master
this._startElection();
heartbeatValue = parseInt(this._callLocalStorage('getItem', 'heartbeat', 0));
}

if (this._isMasterTab) {
//walk through all peers and kill old
var cleanedPeers = {};
for (var peerName in peers) {
if (peers[peerName] + this.HEARTBEAT_KILL_OLD_PERIOD > now) {
cleanedPeers[peerName] = peers[peerName];
}
}

if (heartbeatValue !== this.lastHeartbeat) {
// someone else is also master...
// it should not happen, except in some race condition situation.
this._isMasterTab = false;
this.lastHeartbeat = 0;
peers[this._id] = now;
this._callLocalStorage('setItem', 'peers', peers);
this.stopPolling();
this.trigger('no_longer_master');
} else {
this.lastHeartbeat = now;
this._callLocalStorage('setItem', 'heartbeat', now);
this._callLocalStorage('setItem', 'peers', cleanedPeers);
}
} else {
//update own heartbeat
peers[this._id] = now;
this._callLocalStorage('setItem', 'peers', peers);
}

// Write lastPresence in local storage if it has been updated since last heartbeat
var hbPeriod = this._isMasterTab ? this.MASTER_TAB_HEARTBEAT_PERIOD : this.TAB_HEARTBEAT_PERIOD;
if (this._lastPresenceTime + hbPeriod > now) {
this._callLocalStorage('setItem', 'lastPresence', this._lastPresenceTime);
}

this._heartbeatTimeout = setTimeout(this._heartbeat, hbPeriod);
} catch (error) {
console.log(error);
// expected output: ReferenceError: nonExistentFunction is not defined
// Note - error messages will vary depending on browser
}},

Avatar
Discard