File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -95,16 +95,15 @@ def action_sold(self):
9595 raise UserError ("A cancelled property cannot be set as sold" )
9696 record .state = "sold"
9797
98- _constraints = [
99- models .CheckConstraint (
100- "expected_price > 0" ,
101- message = "The expected price must be strictly positive." ,
102- ),
103- models .CheckConstraint (
104- "selling_price >= 0" ,
105- message = "The selling price must be positive." ,
106- ),
107- ]
98+ _check_expected_price = models .Constraint (
99+ 'CHECK(expected_price > 0)' ,
100+ 'The expected price of a property must be strictly positive.'
101+ )
102+
103+ _check_selling_price = models .Constraint (
104+ 'CHECK(selling_price > 0)' ,
105+ 'The selling price of a property must be positive.'
106+ )
108107
109108 @api .constrains ("selling_price" , "expected_price" )
110109 def _check_selling_price_ratio (self ):
You can’t perform that action at this time.
0 commit comments