Skip to content

Commit a038bb3

Browse files
committed
[Fix] handeled comments in the PR
- modify the way of getting the best price - removed hard coded styles - remove unwanted dependencies - make code more clear
1 parent 4cbc244 commit a038bb3

File tree

4 files changed

+5
-9
lines changed

4 files changed

+5
-9
lines changed

estate/models/estate_property.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,7 @@ def _compute_total_area(self):
6767
@api.depends('offer_ids.price')
6868
def _compute_best_price(self):
6969
for record in self:
70-
best = 0
71-
for offer in record.offer_ids:
72-
best = max(best, offer.price)
73-
record.best_price = best
70+
record.best_price = max(record.offer_ids.mapped('price')) if record.offer_ids else 0.0
7471

7572
@api.onchange('garden')
7673
def _onchange_garden(self):

estate/models/estate_property_offer.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,9 @@ def _compute_validity(self):
3131

3232
def _inverse_validity(self):
3333
for record in self:
34+
record.date_deadline = fields.Date.today()
3435
if record.validity:
35-
record.date_deadline = fields.Date.today() + timedelta(days=record.validity)
36-
else:
37-
record.date_deadline = fields.Date.today()
36+
record.date_deadline += timedelta(days=record.validity)
3837

3938
def action_accept_offer(self):
4039
for record in self:

estate/views/estate_property_views.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
decoration-muted="state == 'sold'">
1010
<field name="name" />
1111
<field name="property_type_id" />
12-
<field name="date_availability" width="200vw" optional="true" />
12+
<field name="date_availability" optional="true" />
1313
</list>
1414
</field>
1515
</record>

estate_account/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
'license': 'LGPL-3',
77
'application': True,
88
'installable': True,
9-
'depends': ['base', 'estate', 'account'],
9+
'depends': ['estate', 'account'],
1010
'data': [
1111
'security/ir.model.access.csv',
1212
],

0 commit comments

Comments
 (0)