Skip to content

Commit 0e2371c

Browse files
committed
[IMP] estate: estate_account had import error
Fixed path of estate_account module. [FIX] estate: estate_account had import error -Fixed path of estate_account module. [FIX] estate: estate_account had import error -Fixed path of estate_account module. [IMP] estate: estate_account had import error Fixed path of estate_account module.
1 parent de6b813 commit 0e2371c

File tree

10 files changed

+20
-16
lines changed

10 files changed

+20
-16
lines changed

estate/__manifest__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@
1313
'views/estate_property_tag_views.xml',
1414
'views/estate_menus.xml'
1515
],
16-
1716
}

estate/estate_account/models/__init__.py

Whitespace-only changes.

estate/models/estate_property.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ class EstateProperty(models.Model):
6868
def _compute_total_area(self):
6969
for record in self:
7070
record.total_area = (record.living_area or 0) + (record.garden_area or 0)
71-
71+
7272
@api.depends("offer_ids.price")
7373
def _compute_best_price(self):
7474
for record in self:
7575
record.best_price = max(record.offer_ids.mapped("price"), default=0)
76-
76+
7777
@api.onchange("garden")
7878
def _onchange_garden(self):
7979
if self.garden:
@@ -82,17 +82,19 @@ def _onchange_garden(self):
8282
else:
8383
self.garden_area = 0
8484
self.garden_orientation = False
85+
8586
def action_cancel(self):
8687
for record in self:
8788
if record.state == "sold":
8889
raise UserError("A sold property cannot be cancelled")
8990
record.state = "cancelled"
91+
9092
def action_sold(self):
9193
for record in self:
9294
if record.state == "cancelled":
9395
raise UserError("A cancelled property cannot be set as sold")
9496
record.state = "sold"
95-
97+
9698
@api.constrains("selling_price", "expected_price")
9799
def _check_selling_price(self):
98100
for record in self:

estate/models/estate_property_offer.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,12 @@ def _compute_date_deadline(self):
3636
for record in self:
3737
creation_date = record.create_date or fields.Date.today()
3838
record.date_deadline = creation_date + relativedelta(days=record.validity)
39+
3940
def _inverse_date_deadline(self):
4041
for record in self:
4142
creation_date = record.create_date.date() or fields.Date.today()
4243
record.validity = (record.date_deadline - creation_date).days
44+
4345
def action_accept(self):
4446
for record in self:
4547
if record.property_id.buyer_id:
@@ -48,10 +50,11 @@ def action_accept(self):
4850
record.property_id.selling_price = record.price
4951
record.property_id.state = 'offer_accepted'
5052
record.property_id.buyer_id = record.partner_id
53+
5154
def action_refuse(self):
5255
self.status = 'refused'
5356
return True
54-
57+
5558
@api.model
5659
def create(self, vals):
5760
vals_list = vals if isinstance(vals, list) else [vals]
@@ -69,11 +72,10 @@ def create(self, vals):
6972
("price", ">=", max_new_price),
7073
], limit=1)
7174
if existing_offers:
72-
raise UserError(
73-
"You cannot create an offer with a lower amount than an existing offer for this property."
74-
)
75+
raise UserError("You cannot create an offer with a lower amount than an existing offer for this property.")
76+
7577
records = super().create(vals)
76-
if isinstance(records, models.Model):
78+
if isinstance(records, models.Model):
7779
for offer in records:
7880
offer.property_id.state = "offer_received"
7981
return records

estate/models/estate_property_tag.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ class EstatePropertyTag(models.Model):
77
_order = "name"
88
name = fields.Char(required=True)
99
color = fields.Integer()
10-
10+
1111
_check_tag_name_unique = models.Constraint(
12-
'UNIQUE(name)',
12+
'UNIQUE(name)',
1313
'The name of the property tag must be unique.'
1414
)

estate/models/res_users.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33

44
class InheritedModel(models.Model):
55
_inherit = "res.users"
6-
property_ids=fields.One2Many("estate.property","salesperson_id",domain=[("state","!=","sold")], string="Properties")
6+
property_ids = fields.One2Many("estate.property", "salesperson_id", domain=[("state", "!=", "sold")], string="Properties")
File renamed without changes.

estate/estate_account/__manifest__.py renamed to estate_account/__manifest__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
'application': True,
44
'installable': True,
55
'author': 'Odoo S.A.',
6-
'license': 'LGPL-3'
7-
'depends': ['estate', 'account'],
6+
'license': 'LGPL-3',
7+
'depends': ['estate', 'account']
88
}

estate_account/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import estate_property

estate/estate_account/models/estate_property.py renamed to estate_account/models/estate_property.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
class EstateProperty(models.Model):
5-
_inherit="estate.property"
5+
_inherit = "estate.property"
66

77
def action_sold(self):
88
self.env['account.move'].create({
@@ -13,7 +13,7 @@ def action_sold(self):
1313
{
1414
"name": "selling price commission (6%)",
1515
"quantity": 1,
16-
"price_unit": self.selling_price * 0.06 ,
16+
"price_unit": self.selling_price * 0.06,
1717
}
1818
),
1919
Command.create(

0 commit comments

Comments
 (0)