11from odoo import fields , models
22
3+
34class Property (models .Model ):
4- _name = " estate.property"
5- _description = " Estate property"
5+ _name = ' estate.property'
6+ _description = ' Estate property'
67
78 name = fields .Char ("Name" , required = True )
89 description = fields .Text ("Description" )
910 postcode = fields .Char ("Postcode" )
10- date_availability = fields .Date ("Available From" , copy = False , default = fields .Date .today ())
11+ date_availability = fields .Date ("Available From" , copy = False , default = fields .Date .add ( fields . Date . today (), months = 3 ))
1112 expected_price = fields .Float ("Expected Price" , required = True )
1213 selling_price = fields .Float ("Selling Price" , readonly = True , copy = False )
1314 bedrooms = fields .Integer ("Bedrooms" , default = 2 )
@@ -17,6 +18,14 @@ class Property(models.Model):
1718 garden = fields .Boolean ("Garden" )
1819 garden_area = fields .Integer ("Garden Area (sqm)" )
1920 garden_orientation = fields .Selection (
20- string = 'Type' ,
21- selection = [('north' , 'North' ) ,('south' , 'South' ), ('east' , 'East' ), ('west' , 'West' )],
22- )
21+ string = "Type" ,
22+ selection = [('north' , "North" ), ('south' , "South" ), ('east' , "East" ), ('west' , "West" )],
23+ )
24+ active = fields .Boolean ("Active" , default = False )
25+ state = fields .Selection (
26+ string = "Status" ,
27+ selection = [('new' , "New" ), ('offer_received' , "Offer Received" ), ('offer_accepted' , "Offer Accepted" ), ('sold' , "Sold" ), ('cancelled' , "Cancelled" )],
28+ default = 'new' ,
29+ required = True ,
30+ copy = False ,
31+ )
0 commit comments