File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed
Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -75,11 +75,13 @@ class EstateProperty(models.Model):
7575 def _compute_total_area (self ):
7676 for record in self :
7777 record .total_area = record .living_area + record .garden_area
78+
7879 @api .depends ('offer_ids.price' )
7980 def _compute_best_price (self ):
8081 for record in self :
8182 prices = record .offer_ids .mapped ('price' )
8283 record .best_price = max (prices ) if prices else 0.0
84+
8385 @api .onchange ("garden" )
8486 def _onchange_garden (self ):
8587 if self .garden :
Original file line number Diff line number Diff line change 11from dateutil .relativedelta import relativedelta
2- from datetime import date
32from odoo import models , fields , api
43
54
@@ -37,6 +36,7 @@ def _compute_date_deadline(self):
3736 for rec in self :
3837 create = rec .create_date or fields .Date .today ()
3938 rec .date_deadline = (create + relativedelta (days = rec .validity ))
39+
4040 def _inverse_date_deadline (self ):
4141 for rec in self :
4242 create = rec .create_date or fields .Date .today ()
You can’t perform that action at this time.
0 commit comments