diff --git a/coworking_coworker/models/res_partner.py b/coworking_coworker/models/res_partner.py
index ddec5fe..868f351 100644
--- a/coworking_coworker/models/res_partner.py
+++ b/coworking_coworker/models/res_partner.py
@@ -10,8 +10,8 @@ class ResPartner(models.Model):
_inherit = 'res.partner'
is_coworker = fields.Boolean('Coworker', default=False)
- # coworker_count = fields.Integer('Number of coworker',
- # compute='_compute_coworker_count')
+ coworker_count = fields.Integer('Number of coworker',
+ compute='_compute_coworker_count')
company_ids = fields.One2many(
@@ -34,9 +34,8 @@ class ResPartner(models.Model):
@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)
+ for coworker in self:
+ coworker.coworker_count = len(coworker.coworker_type)
@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 5aa155b..eb379ed 100644
--- a/coworking_coworker/views/res_partner_views.xml
+++ b/coworking_coworker/views/res_partner_views.xml
@@ -11,8 +11,7 @@
-
+
@@ -42,11 +41,16 @@
res.partner
-
+
-
+ domain="[('is_coworker','=',True)]" />
+
+
+
+
@@ -73,7 +77,7 @@
+ res_model="res.partner" view_mode="kanban,form,calendar,graph,pivot" />
res.partner.calendar
@@ -93,20 +97,21 @@
-
-
+