Commit 63dd09c6 by François C.

Ajout surcharge shift.extension pour déclencher changement statut vers délai

parent 850f73f5
......@@ -7,4 +7,4 @@ from . import shift_shift
from . import member_state_change
from . import shift_template
from . import shift_template_registration_line
from . import shift_extension
# -*- coding: utf-8 -*-
from openerp import _, api, models, fields
import logging
import datetime
_logger = logging.getLogger(__name__)
class ShiftExtension(models.Model):
_inherit = 'shift.extension'
@api.model
def _update_member_status(self, vals):
res_partner = self.env['res.partner'].search([('id', '=', vals['partner_id'])])
if res_partner:
res_partner[0].recompute_member_states()
@api.model
def write(self, vals):
_logger.debug("Shift extension Vals recues = %s", str(vals))
res = super(ShiftExtension, self).write(vals)
self._update_member_status(vals)
return res
@api.model
def create(self, vals):
_logger.debug("Shift extension Vals recues creation = %s", str(vals))
res = super(ShiftExtension, self).create(vals)
self._update_member_status(vals)
return res
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