@@ -8,7 +8,7 @@ class Estate_property(models.Model):
8
8
_order = "id desc"
9
9
10
10
name = fields .Char (string = "Name" , required = True )
11
- description = fields .Text ()
11
+ description = fields .Text ()
12
12
postcode = fields .Char ()
13
13
date_availability = fields .Datetime (copy = False , default = fields .date .today () + relativedelta (months = 3 ))
14
14
expected_price = fields .Float (required = True )
@@ -21,7 +21,7 @@ class Estate_property(models.Model):
21
21
garden_area = fields .Integer ()
22
22
garden_orientation = fields .Selection (
23
23
string = 'Orientation' ,
24
- selection = [('north' , 'North' ), ('south' , 'South' ), ('east' ,'East' ), ('west' , 'West' )],
24
+ selection = [('north' , 'North' ), ('south' , 'South' ), ('east' , 'East' ), ('west' , 'West' )],
25
25
help = "Orientation is meant to describe the garden."
26
26
)
27
27
active = fields .Boolean ('Active' , default = True )
@@ -83,9 +83,7 @@ def has_accepted_offer(self):
83
83
@api .onchange ("expected_price" )
84
84
def _onchange_expected_price (self ):
85
85
if (self .has_accepted_offer ()):
86
- compute_cost = self .expected_price * 90 / 100
87
- print (compute_cost )
88
- if (tools .float_utils .float_compare (compute_cost , self .selling_price , 2 ) > 0 ):
86
+ if (tools .float_utils .float_compare (self .expected_price * 90 / 100 , self .selling_price , 2 ) > 0 ):
89
87
raise exceptions .ValidationError ("The selling price must be equal or higher than 90% of the selling price." )
90
88
91
89
@api .ondelete (at_uninstall = False )
0 commit comments