Commit 37d90424 by Thibault Grandjean

change method to check if meal voucher is activated on pos

parent 0b42a4c6
......@@ -67,18 +67,13 @@ odoo.define("pos_meal_voucher.screens", function (require) {
screens.OrderWidget.include({
//check if POS if configured to accept payment in meal voucher
meal_voucher_activated: function() {
var payment_methods = this.pos.cashregisters.map(
function(method) {
return method.journal_id[1]
var is_meal_voucher_method = this.pos.cashregisters.map(function(cash_register) {
if (cash_register.journal.meal_voucher_type === "paper" || cash_register.journal.meal_voucher_type === "dematerialized") {
return true
}
);
var is_meal_voucher_method = payment_methods.map(
function(method_name) {
var regex = new RegExp('Déj')
return regex.test(method_name)
}
);
})
return is_meal_voucher_method.includes(true);
},
......@@ -100,20 +95,15 @@ odoo.define("pos_meal_voucher.screens", function (require) {
screens.PaymentScreenWidget.include({
meal_voucher_activated: function() {
var payment_methods = this.pos.cashregisters.map(
function(method) {
return method.journal_id[1]
}
);
var is_meal_voucher_method = payment_methods.map(
function(method_name) {
var regex = new RegExp('Déj')
return regex.test(method_name)
}
);
return is_meal_voucher_method.includes(true);
},
//check if POS if configured to accept payment in meal voucher
meal_voucher_activated: function() {
var is_meal_voucher_method = this.pos.cashregisters.map(function(cash_register) {
if (cash_register.journal.meal_voucher_type === "paper" || cash_register.journal.meal_voucher_type === "dematerialized") {
return true
}
})
return is_meal_voucher_method.includes(true);
},
// odoo/addons/point_of_sale/static/src/js/screens.js
// We need to change the default behaviour of locking input with
......
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