Commit 38f3ee82 by François C.

Fix seat_reserved bug on subscription calendar

parent c5b11509
Pipeline #2370 failed with stage
in 1 minute 22 seconds
......@@ -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]
......
......@@ -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);
}
......
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