Commit 88c283ad by François C.

Ajout fichier shift_leave.py dans module lacagette_membership

parent c1883bb3
# -*- coding: utf-8 -*-
from openerp import _, api, models, fields
import logging
import datetime
_logger = logging.getLogger(__name__)
class ShiftLeave(models.Model):
_inherit = 'shift.leave'
@api.model
def _update_member_status(self, vals):
_logger.debug("_update_member_status, reçu %s", str(vals))
res_partner = self.env['res.partner'].search([('id', '=', vals['partner_id'])])
if res_partner:
res_partner[0].recompute_member_states()
@api.multi
def write(self, vals):
_logger.debug("Shift leave vals = %s, partner_id = %s", str(vals), str(self.partner_id.id))
res = super(ShiftLeave, self).write(vals)
vals['partner_id'] = self.partner_id.id
self._update_member_status(vals)
return res
@api.model
def create(self, vals):
_logger.debug("Shift leave Vals recues creation = %s", str(vals))
res = super(ShiftLeave, 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