diff --git a/coworking_coworker/models/res_partner.py b/coworking_coworker/models/res_partner.py index 8e8a892..e34c6bd 100644 --- a/coworking_coworker/models/res_partner.py +++ b/coworking_coworker/models/res_partner.py @@ -31,12 +31,12 @@ class ResPartner(models.Model): full_contact_adress = fields.Char(compute='_compute_full_contact_adress') - # @api.depends('is_coworker') - # def _compute_coworker_count(self): - # """ Computes number of coworker """ - # for res_partner in self: - # if res_partner.partner_id is self.is_coworker(): - # self.coworker_count = len(res_partner.partner_id) + @api.depends('is_coworker') + def _compute_coworker_count(self): + """ Computes number of coworker """ + for res_partner in self: + if self.is_coworker(): + self.coworker_count = len(self.is_coworker) @api.depends('street', 'zip', 'city') def _compute_full_contact_adress(self): diff --git a/coworking_coworker/views/res_partner_views.xml b/coworking_coworker/views/res_partner_views.xml index d838f9d..8f5c525 100644 --- a/coworking_coworker/views/res_partner_views.xml +++ b/coworking_coworker/views/res_partner_views.xml @@ -85,11 +85,22 @@ res.partner.graph res.partner - + - - + + + + + + + + + + + + +