Commit e9df4002 by Odoo

Implémentation _compute_lacagette_working_state pour garder statuts spéciaux cohérents

parent 3e45256b
......@@ -44,10 +44,22 @@ class ResPartner(models.Model):
"Number of shift done with both of the associate",
default= 0)
def _compute_lacagette_working_state(self):
for partner in self:
if partner.is_associated_people is True:
partner.working_state = partner.parent_id.cooperative_state
else:
if partner.cooperative_state in ['gone', 'associated']:
partner.working_state = partner.cooperative_state
else:
potential_associated_record = self.env['res.partner'].search([('email','=',self.email), ('is_associated_people', '=', True)])
if potential_associated_record:
partner.working_state = 'associated'
@api.multi
def recompute_member_states(self):
for record in self:
record._compute_working_state()
record._compute_lacagette_working_state()
record._compute_cooperative_state()
@api.model
......
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