Commit f21e727e by François C.

Modifications module coop_membership (shifts)

parent 73452856
......@@ -76,8 +76,10 @@ class ShiftLeave(models.Model):
partner.get_next_shift_date(start_date=leave_stop_time_utc)
if not next_shift_date or not next_shift:
next_shift_date = leave.guess_future_date_shift(
leave.stop_date, is_all_team=True)[0]
future_date_shift = leave.guess_future_date_shift(
leave.stop_date, is_all_team=True)
if len(future_date_shift) > 0:
next_shift_date = future_date_shift[0]
if next_shift_date:
next_shift_date = fields.Date.to_string(
next_shift_date)
......
......@@ -203,7 +203,12 @@ class ShiftRegistration(models.Model):
reason = _('Attended')
counter_vals['point_qty'] = 1
counter_vals['name'] = reason
elif vals_state in ['absent']:
counter_vals['point_qty'] = -2
counter_vals['name'] = _('Absent')
elif vals_state in ['excused']:
counter_vals['point_qty'] = -1
counter_vals['name'] = _('Excused')
# Create Point Counter
if counter_vals:
counter_vals.update({
......
......@@ -60,7 +60,7 @@ class ShiftTemplate(models.Model):
'res.partner', string='Shift Leader')
user_ids = fields.Many2many(
'res.partner', 'res_partner_shift_template_rel', 'shift_template_id',
'partner_id', string='Shift Leaders', required=True)
'partner_id', string='Shift Leaders')
company_id = fields.Many2one(
'res.company', string='Company', change_default=True,
default=lambda self: self.env['res.company']._company_default_get(
......
......@@ -95,4 +95,4 @@ odoo.define('cagette_product.backend', function(require){
});
});
\ No newline at end of file
});
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