Skip to content

Commit 71ed848

Browse files
committed
[FIX] estate: Fixing error with style
1 parent 7e58d88 commit 71ed848

File tree

2 files changed

+3
-29
lines changed

2 files changed

+3
-29
lines changed

estate/models/estate_property.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ class EstateProperty(models.Model):
1818
selection=[('house', 'House'), ('apartment', 'Apartment')])
1919
description = fields.Text()
2020
postcode = fields.Char()
21-
state = fields.Text()
2221
date_availability = fields.Date(copy=False, readonly=True, default=lambda self: date.today() + relativedelta(months=3))
2322
expected_price = fields.Float("Expected Price", required=True)
2423
selling_price = fields.Float("Selling Price", readonly=True, copy=False)
@@ -78,10 +77,7 @@ def _compute_best_price(self):
7877
for record in self:
7978
if record.offer_ids:
8079
record.best_price = max(record.offer_ids.mapped('price')) if record.offer_ids else 0
81-
# if record.offer_ids:
82-
# record.best_price = max(record.offer_ids.mapped('price'))
83-
# else:
84-
# record.best_price = 0.0
80+
8581
@api.onchange('garden')
8682
def _onchange_garden(self):
8783
if self.garden:
@@ -96,11 +92,11 @@ def _onchange_garden(self):
9692

9793
_check_selling_price = models.Constraint(
9894
'CHECK(selling_price > 0)', 'The selling price must be positive.')
99-
95+
10096
@api.constrains('selling_price', 'expected_price')
10197
def _check_selling_price_expected_price(self):
10298
for record in self:
10399
if record.selling_price == 0:
104-
continue
100+
continue
105101
if float_compare(record.selling_price, 0.9 * record.expected_price, precision_digits=2) == -1:
106102
raise UserError("The selling price must be at least 90% of the expected price.")

estate/views/estate_property_tags_view.xml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,4 @@
44
<field name="res_model">estate.property.tags</field>
55
<field name="view_mode">list,form</field>
66
</record>
7-
<!-- <record id="estate_property_tags_list" model="ir.ui.view">
8-
<field name="name">estate.property.tags.list</field>
9-
<field name="model">estate.property.tags</field>
10-
<field name="arch" type="xml">
11-
<list string="Property Tags">
12-
<field name="name"/>
13-
</list>
14-
</field>
15-
</record>
16-
<record id="estate_property_tags_form" model="ir.ui.view">
17-
<field name="name">estate.property.tags.form</field>
18-
<field name="model">estate.property.tags</field>
19-
<field name="arch" type="xml">
20-
<form string="Property Tags">
21-
<sheet>
22-
<group>
23-
<field name="name"/>
24-
</group>
25-
</sheet>
26-
</form>
27-
</field>
28-
</record> -->
297
</odoo>

0 commit comments

Comments
 (0)