Skip to content

Commit 2fd7752

Browse files
committed
[ADD] estate: auto invoice creation on property sale
�[200~Added a new linking module estate_account depending on estate and account.
1 parent 1065ee5 commit 2fd7752

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

estate/models/estate_property.py

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,37 @@ class EstateModel(models.Model):
99
_description = "Real Estate Advertisement Model"
1010
_order = "id desc"
1111

12-
name = fields.Char(required=True)
13-
description = fields.Text()
14-
postcode = fields.Char()
12+
active = fields.Boolean(default=True)
13+
bedrooms = fields.Integer(default=2)
14+
best_price = fields.Float(compute="_compute_best_price", store=True, default=0.0)
15+
buyer = fields.Many2one("res.partner", readonly=True)
1516
date_availability = fields.Date(
1617
copy=False,
1718
default=fields.Date.today() + timedelta(days=90),
1819
)
19-
active = fields.Boolean(default=True)
20+
description = fields.Text()
2021
expected_price = fields.Float(required=True)
21-
selling_price = fields.Float(readonly=True, copy=False)
22-
bedrooms = fields.Integer(default=2)
23-
living_area = fields.Integer()
2422
facades = fields.Integer()
2523
garage = fields.Boolean()
2624
garden = fields.Boolean()
2725
garden_area = fields.Integer()
26+
garden_orientation = fields.Selection(
27+
string="Garden Orientation",
28+
selection=[
29+
("north", "North"),
30+
("south", "South"),
31+
("east", "East"),
32+
("west", "West"),
33+
],
34+
help="Select the direction the garden faces",
35+
)
36+
living_area = fields.Integer()
37+
name = fields.Char(required=True)
38+
offer_ids = fields.One2many("estate.property.offer", inverse_name="property_id")
39+
postcode = fields.Char()
40+
property_type_id = fields.Many2one("estate.property.type")
41+
salesman = fields.Many2one("res.users")
42+
selling_price = fields.Float(readonly=True, copy=False)
2843
state = fields.Selection(
2944
string="State",
3045
default="new",
@@ -38,23 +53,8 @@ class EstateModel(models.Model):
3853
("cancelled", "Cancelled"),
3954
],
4055
)
41-
garden_orientation = fields.Selection(
42-
string="Garden Orientation",
43-
selection=[
44-
("north", "North"),
45-
("south", "South"),
46-
("east", "East"),
47-
("west", "West"),
48-
],
49-
help="Select the direction the garden faces",
50-
)
51-
property_type_id = fields.Many2one("estate.property.type")
52-
buyer = fields.Many2one("res.partner", readonly=True)
53-
salesman = fields.Many2one("res.users")
5456
tag_ids = fields.Many2many("estate.property.tag")
55-
offer_ids = fields.One2many("estate.property.offer", inverse_name="property_id")
5657
total_area = fields.Float(compute="_compute_total_area", store=True)
57-
best_price = fields.Float(compute="_compute_best_price", store=True, default=0.0)
5858

5959
_sql_constraints = [
6060
(

0 commit comments

Comments
 (0)