@@ -54,14 +54,6 @@ class Property(models.Model):
54
54
total_area = fields .Float ("Total area (sqm)" , compute = "_compute_area" )
55
55
best_price = fields .Float ("Best price" , compute = "_compute_best_price" )
56
56
57
- @api .constrains ("expected_price" , "selling_price" )
58
- def _check_price (self ):
59
- for record in self :
60
- if record .selling_price and record .expected_price and not tools .float_utils .float_is_zero (record .selling_price , precision_digits = 2 ):
61
- if record .selling_price < 0.9 * record .expected_price :
62
- raise exceptions .ValidationError (
63
- "The selling price cannot be lower than 90% of the expected price." )
64
-
65
57
@api .depends ("living_area" , "garden_area" )
66
58
def _compute_area (self ):
67
59
for record in self :
@@ -70,7 +62,7 @@ def _compute_area(self):
70
62
@api .depends ("offer_ids.price" )
71
63
def _compute_best_price (self ):
72
64
for record in self :
73
- record .best_price = max ([0 ]+ record .offer_ids .mapped ('price' ))
65
+ record .best_price = max ([0 ] + record .offer_ids .mapped ('price' ))
74
66
75
67
@api .onchange ("garden" )
76
68
def _onchange_garden (self ):
@@ -109,7 +101,6 @@ def _check_price(self):
109
101
if record .selling_price < 0.9 * record .expected_price :
110
102
raise exceptions .ValidationError (
111
103
"The selling price cannot be lower than 90% of the expected price." )
112
-
113
104
114
105
@api .ondelete (at_uninstall = False )
115
106
def _not_delete_if_not_new_or_canceled (self ):
0 commit comments