You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: estate/models/estate_property.py
+19-3Lines changed: 19 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,4 @@
1
+
fromdateutil.relativedeltaimportrelativedelta
1
2
fromodooimportfields, models
2
3
3
4
@@ -8,10 +9,10 @@ class EstateProperty(models.Model):
8
9
name=fields.Char(string='Property Name', required=True, help='Enter the name of the property')
9
10
description=fields.Text(string='Property Description', help='Enter a description of the property')
10
11
postcode=fields.Char(string='Postcode', help='Enter the postcode of the property')
11
-
date_availability=fields.Date(string='Availability Date', help='Enter the date when the property becomes available')
12
+
date_availability=fields.Date(string='Availability Date', help='Enter the date when the property becomes available', copy=False, default=lambdaself: fields.Date.today() +relativedelta(months=3))
12
13
expected_price=fields.Float(string='Expected Price', required=True, help='Enter the expected price of the property')
13
-
selling_price=fields.Float(string='Selling Price', help='Enter the selling price of the property')
14
-
bedrooms=fields.Integer(string='Number of Bedrooms', help='Enter the number of bedrooms in the property')
14
+
selling_price=fields.Float(string='Selling Price', help='Enter the selling price of the property', readonly=True, copy=False)
15
+
bedrooms=fields.Integer(string='Number of Bedrooms', help='Enter the number of bedrooms in the property', default=2)
15
16
living_area=fields.Integer(string='Living Area', help='Enter the living area of the property in square meters')
16
17
facades=fields.Integer(string='Number of Facades', help='Enter the number of facades of the property')
17
18
garage=fields.Boolean(string='Garage', help='Check if the property has a garage')
@@ -27,3 +28,18 @@ class EstateProperty(models.Model):
27
28
string='Garden Orientation',
28
29
help='Select the orientation of the garden'
29
30
)
31
+
active=fields.Boolean(string='Active', default=True, help='Set to False to archive the property')
0 commit comments