@@ -9,6 +9,7 @@ class EstateProperty(models.Model):
9
9
_name = "estate.property"
10
10
_description = "Real Estate Property"
11
11
_order = 'id desc'
12
+ _inherit = ['mail.thread' , 'mail.activity.mixin' ]
12
13
13
14
name = fields .Char (required = True )
14
15
description = fields .Text (string = "Description" )
@@ -38,7 +39,7 @@ class EstateProperty(models.Model):
38
39
('offer_accepted' , 'Offer Accepted' ),
39
40
('sold' , 'Sold' ),
40
41
('cancelled' , 'Cancelled' ),
41
- ], default = 'new' , string = "Status" , copy = False )
42
+ ], default = 'new' , string = "Status" , copy = False , tracking = True , group_expand = '_group_expand_states' )
42
43
property_type_id = fields .Many2one ('estate.property.type' , string = "Property Type" ,
43
44
options = {'no_create' : True , 'no_edit' : True })
44
45
buyer_id = fields .Many2one ('res.partner' , string = "Buyer" ,copy = False )
@@ -76,6 +77,7 @@ class EstateProperty(models.Model):
76
77
)
77
78
78
79
80
+
79
81
80
82
@api .onchange ('garden' )
81
83
def _onchange_garden (self ):
@@ -147,21 +149,21 @@ def _compute_offer_accepted(self):
147
149
148
150
@api .ondelete (at_uninstall = False )
149
151
def _check_state_on_delete (self ):
150
- for record in self :
151
- if record .state not in ('new' , 'cancelled' ):
152
- raise UserError (
153
- "You cannot delete a property unless it is in 'New' or 'Cancelled' state."
152
+ for record in self :
153
+ if record .state not in ('new' , 'cancelled' ):
154
+ raise UserError (
155
+ "You cannot delete a property unless it is in 'New' or 'Cancelled' state."
154
156
)
155
157
156
- # def action_helper_message(self):
157
- # # Logic to determine when to show the helper
158
- # if not self.search([]):
159
- # return {
160
- # 'type': 'ir.actions.client',
161
- # 'tag': 'display_notification',
162
- # 'params': {
163
- # 'title': 'No Properties Found',
164
- # 'message': 'Click the button to create your first property.',
165
- # 'type': 'warning',
166
- # }
167
- # }
158
+ def action_helper_message (self ):
159
+ # Logic to determine when to show the helper
160
+ if not self .search ([]):
161
+ return {
162
+ 'type' : 'ir.actions.client' ,
163
+ 'tag' : 'display_notification' ,
164
+ 'params' : {
165
+ 'title' : 'No Properties Found' ,
166
+ 'message' : 'Click the button to create your first property.' ,
167
+ 'type' : 'warning' ,
168
+ }
169
+ }
0 commit comments