1+ import datetime as dt
2+
13from odoo import fields , models
24
35
@@ -8,10 +10,10 @@ class EstateProperty(models.Model):
810 name = fields .Char (required = True )
911 description = fields .Text ()
1012 postcode = fields .Char ()
11- date_availability = fields .Date ()
13+ date_availability = fields .Date (copy = False , default = dt . datetime . today () + dt . timedelta ( days = 90 ) )
1214 expected_price = fields .Float (required = True )
13- selling_price = fields .Float ()
14- bedrooms = fields .Integer ()
15+ selling_price = fields .Float (readonly = True , copy = False )
16+ bedrooms = fields .Integer (default = 2 )
1517 living_area = fields .Integer ()
1618 facades = fields .Integer ()
1719 garage = fields .Boolean ()
@@ -22,3 +24,12 @@ class EstateProperty(models.Model):
2224 selection = [('north' , 'North' ), ('west' , 'West' ), ('south' , 'South' ), ('east' , 'East' )],
2325 help = "Choose the appropriate orientation of the garden"
2426 )
27+ active = fields .Boolean (default = True )
28+ state = fields .Selection (
29+ string = "Estate status" ,
30+ selection = [('new' , 'New' ), ('offer received' , 'Offer Received' ), ('offer accepted' , 'Offer Accepted' ), ('sold' , 'Sold' ), ('cancelled' , 'Cancelled' )],
31+ help = 'This field explain the estate status.' ,
32+ required = True ,
33+ copy = False ,
34+ default = 'new'
35+ )
0 commit comments