Skip to content

Commit 360f500

Browse files
author
youness benbraitit (yoben)
committed
[FIX] estate: fixed warnings
fixed label warning and constraint
1 parent bcfadc1 commit 360f500

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

estate/models/estate_property_type.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ class EstatePropertyType(models.Model):
1616
"estate.property.offer", "property_type_id", string="Offers"
1717
)
1818

19-
_sql_constraints = [
20-
('unique_type_name', 'UNIQUE(name)', 'The property type name must be unique.')
21-
]
19+
# SQL constraints declared using the new API
20+
_unique_type_name = models.Constraint(
21+
'UNIQUE(name)', 'The property type name must be unique.'
22+
)
2223

2324
@api.depends('offer_ids')
2425
def _compute_offer(self):

estate/models/res_users.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ class ResUsers(models.Model):
55
_inherit = "res.users"
66

77
property_ids = fields.One2many(
8-
"estate.property", "user_id", string="Properties", domain="[('state', '=', 'new')]"
8+
"estate.property", "user_id", string="Estate Properties", domain="[('state', '=', 'new')]"
99
)

estate/views/estate_res_users_views.xml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,8 @@
66
<field name="inherit_id" ref="base.view_users_form"/>
77
<field name="arch" type="xml">
88
<xpath expr="//notebook" position="inside">
9-
<page string="Properties">
10-
<field name="property_ids">
11-
<tree editable="bottom">
12-
<field name="name"/>
13-
<field name="state"/>
14-
<field name="expected_price"/>
15-
</tree>
16-
</field>
9+
<page string="Estate Properties">
10+
<field name="property_ids"/>
1711
</page>
1812
</xpath>
1913
</field>

0 commit comments

Comments
 (0)