Skip to content

Commit 1d80a90

Browse files
committed
[FIX] Fixed Error
1 parent c103eb9 commit 1d80a90

File tree

6 files changed

+8
-32
lines changed

6 files changed

+8
-32
lines changed

estate/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# --coding: utf-8 --
21
# Part of Odoo. See LICENSE file for full copyright and licensing details.
32

43
from . import models

estate/demo/estate_property_demo.xml

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,14 @@
66
<field name="description">A nice and big villa</field>
77
<field name="postcode">12345</field>
88
<field name="date_avaiblity">2020-02-02</field>
9-
<field name="expected_price">1600000</field>
10-
<field name="selling_price"></field>
9+
<field name="expected_price">1600000.0</field>
1110
<field name="bedrooms">6</field>
1211
<field name="living_area">100</field>
1312
<field name="facades">4</field>
1413
<field name="garage">1</field>
1514
<field name="garden">1</field>
1615
<field name="garden_area">100000</field>
1716
<field name="garden_orientation">south</field>
18-
<field name="property_type_id" ref="property_type_residential"/>
1917
</record>
2018

2119
<record id="estate_property_demo_2" model="estate.property">
@@ -24,46 +22,28 @@
2422
<field name="description">Home in trailer park.</field>
2523
<field name="postcode">54321</field>
2624
<field name="date_avaiblity">1970-01-01</field>
27-
<field name="expected_price">100000</field>
28-
<field name="selling_price">120000</field>
25+
<field name="expected_price">100000.00</field>
26+
<field name="selling_price">120000.00</field>
2927
<field name="bedrooms">1</field>
3028
<field name="living_area">10</field>
3129
<field name="facades">4</field>
3230
<field name="garage">0</field>
33-
<field name="property_type_id" ref="property_type_residential"/>
34-
</record>
35-
36-
<record id="estate_property_demo_2" model="estate.property">
37-
<field name="name">Trailer House</field>
38-
<field name="state">cancelled</field>
39-
<field name="description">Home in trailer court.</field>
40-
<field name="postcode">54321</field>
41-
<field name="date_avaiblity">1970-01-01</field>
42-
<field name="expected_price">1000000</field>
43-
<field name="selling_price">1200000</field>
44-
<field name="bedrooms">6</field>
45-
<field name="living_area">1000</field>
46-
<field name="facades">4</field>
47-
<field name="garage">0</field>
4831
<field name="offer_ids"
4932
eval="[
5033
Command.create({
5134
'partner_id': ref('base.res_partner_2'),
52-
'price': 10000,
35+
'price': 1500002,
5336
'validity': 14,
54-
'date_deadline': (DateContext().today() + relativedelta(days=14)).isoformat(),
5537
}),
5638
Command.create({
5739
'partner_id': ref('base.res_partner_2'),
58-
'price': 1500000,
40+
'price': 1500003,
5941
'validity': 14,
60-
'date_deadline': (DateContext().today() + relativedelta(days=14)).isoformat(),
6142
}),
6243
Command.create({
6344
'partner_id': ref('base.res_partner_3'),
64-
'price': 1500001,
45+
'price': 1500004,
6546
'validity': 11,
66-
'date_deadline': (DateContext().today() + relativedelta(days=11)).isoformat(),
6747
}),
6848
]" />
6949
</record>

estate/models/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# --coding: utf-8 --
21
# Part of Odoo. See LICENSE file for full copyright and licensing details.
32

43
from . import estate_property

estate/models/estate_property_offer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ def create(self, vals_list):
7171
price = vals.get("price", 0.0)
7272
if property_id:
7373
property_obj = self.env["estate.property"].browse(property_id)
74-
best_price = property_obj.best_offer or 0.0
74+
best_price = property_obj.best_price or 0.0
7575
if price < best_price:
7676
raise UserError(
7777
"Offer price must be greater than or equal to the best offer price."
7878
)
7979
records = super().create(vals_list)
8080
for record in records:
8181
if record.partner_id:
82-
record.property_id.state = "offer_received"
82+
record.property_id.state = "offer received"
8383
return records

estate_account/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# --coding: utf-8 --
21
# Part of Odoo. See LICENSE file for full copyright and licensing details.
32

43
from . import models

estate_account/models/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# --coding: utf-8 --
21
# Part of Odoo. See LICENSE file for full copyright and licensing details.
32

43
from . import estate_property

0 commit comments

Comments
 (0)