Skip to content

Commit

Permalink
[FIX] pos_partner_deselection: исправили снятие партнера раньше времени
Browse files Browse the repository at this point in the history
Для воспроизводства
1. Выставляем интервал на 30 секунд
2. Открываем кассу
3. Выбираем клиента
4. Через 25 секунд выбираем другого клиента
5. Через 5 секунд другой клиент снимается
  • Loading branch information
em230418 committed Jan 29, 2025
1 parent 32aeb91 commit 826bff1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pos_partner_deselection/static/src/js/partner_deselection.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ odoo.define("pos_partner_deselection.partner_deselection", [], function (require
},

setupCustomerDeselection(interval) {
setTimeout(() => {
if (this.partner_deselect_timer) {
clearTimeout(this.partner_deselect_timer);
}
this.partner_deselect_timer = setTimeout(() => {
if (!this.finalized) {
this.set_partner(null);
}
Expand All @@ -25,8 +28,11 @@ odoo.define("pos_partner_deselection.partner_deselection", [], function (require

const customer_deselection_interval =
this.pos.config.customer_deselection_interval;

if (customer_deselection_interval && partner && !this.finalized) {
this.setupCustomerDeselection(customer_deselection_interval);
} else if (!partner && this.partner_deselect_timer) {
clearTimeout(this.partner_deselect_timer);
}
},
});
Expand Down

0 comments on commit 826bff1

Please sign in to comment.