Skip to content

Commit 1561928

Browse files
committed
[FIX] property type
1 parent ae66c3b commit 1561928

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

estate/models/estate_property_type.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,10 @@ class PropertyType(models.Model):
99
name = fields.Char(required=True)
1010
property_ids = fields.One2many('estate.property', 'property_type_id', string='Properties')
1111
sequence = fields.Integer(string="Sequence", default=10)
12-
offer_ids = fields.One2many("estate.property.offer", compute="_compute_offers", string="Offers")
12+
offer_ids = fields.One2many("estate.property.offer", "property_type_id", string="Offers")
1313
offer_count = fields.Integer(string="Offer Count", compute="_compute_offer_count")
1414

15-
1615
@api.depends("offer_ids")
1716
def _compute_offer_count(self):
1817
for record in self:
1918
record.offer_count = len(record.offer_ids)
20-
21-
def _compute_offers(self):
22-
for record in self:
23-
offers = self.env['estate.property.offer'].search([
24-
('property_type_id', '=', record.id)
25-
])
26-
record.offer_ids = offers

0 commit comments

Comments
 (0)