Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
odoo
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cooperatic-foodcoops
odoo
Commits
37d90424
Commit
37d90424
authored
Feb 22, 2022
by
Thibault Grandjean
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change method to check if meal voucher is activated on pos
parent
0b42a4c6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
24 deletions
+14
-24
screens.js
lacagette_addons/pos_meal_voucher/static/src/js/screens.js
+14
-24
No files found.
lacagette_addons/pos_meal_voucher/static/src/js/screens.js
View file @
37d90424
...
@@ -67,18 +67,13 @@ odoo.define("pos_meal_voucher.screens", function (require) {
...
@@ -67,18 +67,13 @@ odoo.define("pos_meal_voucher.screens", function (require) {
screens
.
OrderWidget
.
include
({
screens
.
OrderWidget
.
include
({
//check if POS if configured to accept payment in meal voucher
meal_voucher_activated
:
function
()
{
meal_voucher_activated
:
function
()
{
var
payment_methods
=
this
.
pos
.
cashregisters
.
map
(
var
is_meal_voucher_method
=
this
.
pos
.
cashregisters
.
map
(
function
(
cash_register
)
{
function
(
method
)
{
if
(
cash_register
.
journal
.
meal_voucher_type
===
"paper"
||
cash_register
.
journal
.
meal_voucher_type
===
"dematerialized"
)
{
return
method
.
journal_id
[
1
]
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
);
return
is_meal_voucher_method
.
includes
(
true
);
},
},
...
@@ -100,20 +95,15 @@ odoo.define("pos_meal_voucher.screens", function (require) {
...
@@ -100,20 +95,15 @@ odoo.define("pos_meal_voucher.screens", function (require) {
screens
.
PaymentScreenWidget
.
include
({
screens
.
PaymentScreenWidget
.
include
({
meal_voucher_activated
:
function
()
{
//check if POS if configured to accept payment in meal voucher
var
payment_methods
=
this
.
pos
.
cashregisters
.
map
(
meal_voucher_activated
:
function
()
{
function
(
method
)
{
var
is_meal_voucher_method
=
this
.
pos
.
cashregisters
.
map
(
function
(
cash_register
)
{
return
method
.
journal_id
[
1
]
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
)
{
return
is_meal_voucher_method
.
includes
(
true
);
var
regex
=
new
RegExp
(
'Déj'
)
},
return
regex
.
test
(
method_name
)
}
);
return
is_meal_voucher_method
.
includes
(
true
);
},
// odoo/addons/point_of_sale/static/src/js/screens.js
// odoo/addons/point_of_sale/static/src/js/screens.js
// We need to change the default behaviour of locking input with
// We need to change the default behaviour of locking input with
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment