Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
third-party
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
2
Merge Requests
2
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
third-party
Commits
38f3ee82
Commit
38f3ee82
authored
Sep 12, 2022
by
François C.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix seat_reserved bug on subscription calendar
parent
c5b11509
Pipeline
#2370
failed with stage
in 1 minute 22 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
models.py
members/models.py
+3
-2
common.js
outils/static/js/common.js
+5
-2
No files found.
members/models.py
View file @
38f3ee82
...
...
@@ -1280,7 +1280,7 @@ class CagetteServices(models.Model):
api
=
OdooAPI
()
f
=
[
'name'
,
'week_number'
,
'start_datetime_tz'
,
'end_datetime_tz'
,
'seats_reserved'
,
'shift_type_id'
,
'seats_max'
,
'seats_available'
]
'seats_available'
,
'registration_qty'
]
c
=
[[
'active'
,
'='
,
True
]]
shift_templates
=
api
.
search_read
(
'shift.template'
,
c
,
f
)
...
...
@@ -1303,7 +1303,8 @@ class CagetteServices(models.Model):
line
[
'end'
]
=
str
(
end
.
tm_hour
)
+
':'
+
end_min
line
[
'max'
]
=
l
[
'seats_max'
]
# line['reserved'] = nb_reserved
line
[
'reserved'
]
=
l
[
'seats_reserved'
]
#line['reserved'] = l['seats_reserved']
line
[
'reserved'
]
=
l
[
'registration_qty'
]
line
[
'week'
]
=
l
[
'week_number'
]
line
[
'id'
]
=
l
[
'id'
]
line
[
'type'
]
=
l
[
'shift_type_id'
][
0
]
...
...
outils/static/js/common.js
View file @
38f3ee82
...
...
@@ -363,8 +363,11 @@ function retrieve_and_draw_shift_tempates(external) {
$
.
each
(
resp
.
rows
,
function
(
i
,
e
)
{
if
(
e
.
doc
.
shift_template
&&
typeof
(
e
.
doc
.
shift_template
.
data
)
!=
"undefined"
)
{
try
{
if
(
typeof
shift_templates
[
e
.
doc
.
shift_template
.
data
.
id
]
!=
"undefined"
)
shift_templates
[
e
.
doc
.
shift_template
.
data
.
id
][
'data'
][
'reserved'
]
+=
1
;
if
(
typeof
e
.
doc
.
odoo_id
==
"undefined"
||
isNaN
(
e
.
doc
.
odoo_id
))
{
if
(
typeof
shift_templates
[
e
.
doc
.
shift_template
.
data
.
id
]
!=
"undefined"
)
shift_templates
[
e
.
doc
.
shift_template
.
data
.
id
][
'data'
][
'reserved'
]
+=
1
;
}
}
catch
(
ec
)
{
console
.
log
(
ec
);
}
...
...
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