Skip to content

Commit 9c4e958

Browse files
author
raibr
committed
[IMP] estate: fix some linting problem
1 parent 35673d8 commit 9c4e958

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed

estate/models/estate_property.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class EstateProperty(models.Model):
99
_name = 'estate.property'
1010
_description = "Real Estate Property"
1111
_order = 'id desc'
12+
1213
_check_expected_price = models.Constraint('Check(expected_price > 0)', "The expected price must be strictly positive.")
1314
_check_selling_price = models.Constraint('Check(selling_price >= 0)', "The selling price must be positive.")
1415

@@ -100,7 +101,8 @@ def action_cancel(self):
100101
property.state = 'cancelled'
101102
return True
102103

103-
def unlink(self):
104+
@api.ondelete(at_uninstall=True)
105+
def delete(self):
104106
for property in self:
105107
if property.state not in ('new', 'cancelled'):
106108
raise UserError(self.env._("Only new and cancelled properties can be deleted."))

estate/models/estate_property_offer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ class EstatePropertyOffer(models.Model):
1010
_description = "Real Estate Property Offer"
1111
_order = 'price desc'
1212

13-
price = fields.Float(required=True, string="Price")
1413
_check_price = models.Constraint('Check(price > 0)', "The offer price must be strictly positive.")
14+
15+
price = fields.Float(required=True, string="Price")
1516
status = fields.Selection(selection=[('accepted', "Accepted"), ('refused', "Refused")], copy=False, string="Status")
1617
partner_id = fields.Many2one(comodel_name='res.partner', string="Partner", required=True)
1718
property_id = fields.Many2one(comodel_name='estate.property', string="Property", required=True, ondelete='cascade')

estate/models/estate_property_type.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ class EstatePropertyType(models.Model):
77
_name = 'estate.property.type'
88
_description = "Real Estate Property Type"
99
_order = 'name'
10+
1011
_check_unique_name = models.Constraint('UNIQUE(name)', "The type name must be unique.")
1112

1213
name = fields.Char(required=True, string="Name")

estate/models/res_users.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ class ResUsers(models.Model):
99
property_ids = fields.One2many(
1010
comodel_name='estate.property',
1111
inverse_name='salesperson_id',
12-
string="Properties",
12+
string="Estate Properties",
1313
)

estate/views/estate_property_type_views.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@
2020
<form string="Property Type">
2121
<sheet>
2222
<div class="oe_button_box" name="button_box">
23-
<button name="%(estate_property_offer_action)d" type="action" class="oe_stat_button" icon="fa-money">
24-
<field name="offer_count" widget="statinfo" string="Offers"/>
23+
<button name="%(estate_property_offer_action)d" type="action"
24+
class="oe_stat_button" icon="fa-money">
25+
<field name="offer_count" widget="statinfo" string="Offers" />
2526
</button>
2627
</div>
2728
<group>

0 commit comments

Comments
 (0)