Commit acdb9244 by François C.

Fix Odoo presence appearing when shift was moved and validating presence on Odoo interface

parent 4af17e98
...@@ -7,7 +7,7 @@ odoo.define("lacagette_custom_pos.screens", function (require) { ...@@ -7,7 +7,7 @@ odoo.define("lacagette_custom_pos.screens", function (require) {
var dataModel = require('web.DataModel'); var dataModel = require('web.DataModel');
var lacagette_products = new dataModel('lacagette.products'); var lacagette_products = new dataModel('lacagette.products');
var _t = core._t; var _t = core._t;
const interval = 1 * 60 * 1000; // used for last_price_change call const interval = 7 * 60 * 1000; // used for last_price_change call
var reload_on_prices_change = false; var reload_on_prices_change = false;
models.load_fields("pos.config", ['reload_on_prices_change']); models.load_fields("pos.config", ['reload_on_prices_change']);
...@@ -41,7 +41,6 @@ odoo.define("lacagette_custom_pos.screens", function (require) { ...@@ -41,7 +41,6 @@ odoo.define("lacagette_custom_pos.screens", function (require) {
}) })
} }
screens.ClientListScreenWidget.include({ screens.ClientListScreenWidget.include({
init: function(parent, options) { init: function(parent, options) {
this._super(parent, options); this._super(parent, options);
......
...@@ -8,6 +8,25 @@ _logger = logging.getLogger(__name__) ...@@ -8,6 +8,25 @@ _logger = logging.getLogger(__name__)
class ShiftShift(models.Model): class ShiftShift(models.Model):
_inherit = 'shift.shift' _inherit = 'shift.shift'
@api.multi
def button_makeupok(self):
"""
@Function trigger to change the state from Confirm to Entry
"""
for shift in self:
shift.state = 'entry'
# Automatically mark attendance as "Attended" for
# makeup (ABCD Member)
for reg in shift.registration_ids:
if not reg.partner_id.in_ftop_team and \
not reg.tmpl_reg_line_id and \
reg.origin != 'memberspace' and \
reg.origin != 'bdm' and \
reg.state != 'replacing':
reg.button_reg_close()
@api.model @api.model
def run_close_today_ftop_shifts(self): def run_close_today_ftop_shifts(self):
"""Method called by cron task""" """Method called by cron task"""
......
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