@@ -10,7 +10,6 @@ class PropertyOffer(models.Model):
1010 property_id = fields .Many2one ("estate.property" , string = "Property" , required = True )
1111 partner_id = fields .Many2one ("res.partner" , string = "Partner" , index = True , required = True )
1212
13-
1413 # Beginning of the deadline part
1514 def _current_date (self ):
1615 return fields .Date .today ()
@@ -35,7 +34,6 @@ def _inverse_validity(self):
3534
3635 # End of the deadline part
3736
38-
3937 # Beginning of the currency part
4038 currency_id = fields .Many2one ("res.currency" , "Currency" )
4139 property_currency_id = fields .Many2one ("res.currency" , "Partner Currency" , compute = "_compute_property_currency_id" )
@@ -63,7 +61,6 @@ def _compute_property_currency_id(self):
6361
6462 # End of the currency part
6563
66-
6764 # Beginning of the state / validation part
6865 status = fields .Selection ([
6966 ("accepted" , "Accepted" ),
@@ -82,8 +79,12 @@ def action_confirm(self):
8279 def action_refuse (self ):
8380 for offer in self :
8481 offer .status = "refused"
85-
86- # End of the state / validation part
8782
83+ # End of the state / validation part
8884
8985 sequence = fields .Integer ("Sequence" , default = 0 )
86+
87+ _check_price = models .Constraint (
88+ 'CHECK(price > 0)' ,
89+ 'The price has to be stricly positive'
90+ )
0 commit comments