Skip to content

Commit

Permalink
[IMP] estate: Resolve Warnings & Issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ataha1 committed Dec 20, 2024
1 parent a981754 commit ebc6946
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,6 @@ dmypy.json

# Pyre type checker
.pyre/

# vscode settings
.vscode/
3 changes: 2 additions & 1 deletion estate/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Real Estate",
"author": "Odoo",
"website": "https://www.odoo.com/",
"website": "https://www.odoo.com/page/realestate",
"version": "0.1",
"application": True,
"installable": True,
Expand All @@ -14,4 +14,5 @@
"views/estate_property_views.xml",
"views/estate_menus.xml",
],
"license": "LGPL-3",
}
10 changes: 4 additions & 6 deletions estate/models/estate_property.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class EstateProperty(models.Model):
garden = fields.Boolean()
garden_area = fields.Integer()
garden_orientation = fields.Selection(
string="Type",
string="Garden Orientation",
selection=[
("north", "North"),
("south", "South"),
Expand All @@ -32,7 +32,7 @@ class EstateProperty(models.Model):
)
active = fields.Boolean(default=True)
state = fields.Selection(
string="Type",
string="State",
selection=[
("new", "New"),
("offer received", "Offer Received"),
Expand All @@ -41,9 +41,7 @@ class EstateProperty(models.Model):
("canceled", "Canceled"),
],
)
property_type_id = fields.Many2one(
"estate.property.type", string="Property Type", index=True
)
property_type_id = fields.Many2one("estate.property.type", string="Property Type")
buyer = fields.Many2one("res.partner", string="Buyer", copy=False)
salesperson = fields.Many2one(
"res.users", string="Salesperson", default=lambda self: self.env.user
Expand All @@ -62,7 +60,7 @@ def _compute_total_area(self):
def _compute_best_price(self):
for record in self:
prices = record.offer_ids.mapped("price")
record.best_price = max(prices) if prices else 0
record.best_price = max(prices, default=0)

@api.onchange("garden")
def _onchange_garden(self):
Expand Down
2 changes: 1 addition & 1 deletion estate/models/estate_property_offer.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class EstatePropertyOffer(models.Model):
compute="_compute_date_deadline", inverse="_inverse_date_deadline"
)

@api.depends("validity")
@api.depends("validity", "create_date")
def _compute_date_deadline(self):
for record in self:
if not record.create_date:
Expand Down

0 comments on commit ebc6946

Please sign in to comment.