Commit 4fd64ff9 by François C.

Better time parameters to detect product prices change on POS

parent acdb9244
...@@ -7,7 +7,7 @@ odoo.define("lacagette_custom_pos.screens", function (require) { ...@@ -7,7 +7,7 @@ odoo.define("lacagette_custom_pos.screens", function (require) {
var dataModel = require('web.DataModel'); var dataModel = require('web.DataModel');
var lacagette_products = new dataModel('lacagette.products'); var lacagette_products = new dataModel('lacagette.products');
var _t = core._t; var _t = core._t;
const interval = 7 * 60 * 1000; // used for last_price_change call const interval = 5 * 60 * 1000; // used for last_price_change call
var reload_on_prices_change = false; var reload_on_prices_change = false;
models.load_fields("pos.config", ['reload_on_prices_change']); models.load_fields("pos.config", ['reload_on_prices_change']);
...@@ -49,6 +49,7 @@ odoo.define("lacagette_custom_pos.screens", function (require) { ...@@ -49,6 +49,7 @@ odoo.define("lacagette_custom_pos.screens", function (require) {
if (reload_on_prices_change) { if (reload_on_prices_change) {
posmodel.pos_session.load_at = Date.now(); posmodel.pos_session.load_at = Date.now();
posmodel.pos_session.needs_reload = false; posmodel.pos_session.needs_reload = false;
update_last_price_change_data(); // don't wait for timer for first time
const confirmRefresh = event => { const confirmRefresh = event => {
// Called when unload is unsafe // Called when unload is unsafe
event.preventDefault(); event.preventDefault();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment