Skip to content

Commit d546346

Browse files
committed
[ADD] estate: midway in adding sprinkles
1 parent bfee85e commit d546346

File tree

8 files changed

+29
-2
lines changed

8 files changed

+29
-2
lines changed

estate/models/estate_property.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
class Estateproperty(models.Model):
88
_name = "estate.property"
99
_description = "Estate property"
10+
_order = "id desc"
1011

1112
name = fields.Char('Title', required=True)
1213
description = fields.Text('Description', required=True)
@@ -46,7 +47,7 @@ class Estateproperty(models.Model):
4647
)
4748

4849
_property_selling_price_positive = models.Constraint(
49-
'CHECK(selling_price) >= 0',
50+
'CHECK(selling_price >= 0)',
5051
)
5152

5253
@api.depends("garden_area", "living_area")

estate/models/estate_property_offer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
class EstatePropertyOffer(models.Model):
88
_name = 'estate.property.offer'
99
_description = 'Offer for the property'
10+
_order = 'price desc'
1011

1112
price = fields.Float()
1213
status = fields.Selection(

estate/models/estate_property_tag.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
class EstatePropertyTag(models.Model):
55
_name = "estate.property.tag"
66
_description = "Tags for the estate"
7+
_order = 'name'
78

89
name = fields.Char('Tag', required=True)
910
description = fields.Char('Description')

estate/models/estate_property_type.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,22 @@
44
class EstatePropertyType(models.Model):
55
_name = "estate.property.type"
66
_description = "Estate Property Type"
7+
_order = 'name'
78

89
name = fields.Char('Type', required=True)
910
description = fields.Text()
11+
property_type_line_ids = fields.One2many('estate.property.type.line', 'name')
1012

1113
_unique_type = models.Constraint(
1214
'UNIQUE(name)',
1315
'Property type name exists'
1416
)
17+
18+
class EstatePropertyTypeLine(models.Model):
19+
_name = 'estate.property.type.line'
20+
_description = 'estate property view per type'
21+
22+
name = fields.Many2one('estate.property.type')
23+
title = fields.Char()
24+
expected_price = fields.Char()
25+
state = fields.Char()

estate/security/ir.model.access.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ access_estate_property_tag,estate.property.tag,model_estate_property_tag,base.gr
33
access_estate_property,estate.property,model_estate_property,base.group_user,1,1,1,1
44
access_estate_property_type,estate.property.type,model_estate_property_type,base.group_user,1,1,1,1
55
access_estate_property_offer,estate.property.offer,model_estate_property_offer,base.group_user,1,1,1,1
6+
access_estate_property_type_line,estate.property.type.line,model_estate_property_type_line,base.group_user,1,1,1,1

estate/views/estate_property_tag_views.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<odoo>
33

44
<record id="estate_property_tag_model_action" model="ir.actions.act_window">
5-
<field name="name">Property tags</field>
5+
<field name="name">Property Tags</field>
66
<field name="res_model">estate.property.tag</field>
77
<field name="view_mode">list,form</field>
88
</record>

estate/views/estate_property_type_views.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,17 @@
2929
<field name="name"/>
3030
</h1>
3131
</group>
32+
<notebook>
33+
<page string="Properties">
34+
<field name="property_type_line_ids">
35+
<list>
36+
<field name="title"/>
37+
<field name="expected_price"/>
38+
<field name="state"/>
39+
</list>
40+
</field>
41+
</page>
42+
</notebook>
3243
</sheet>
3344
</form>
3445
</field>

estate/views/estate_property_views.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
<header>
5050
<button name="set_property_sold" type="object" string="SOLD"/>
5151
<button name="set_property_cancelled" type="object" string="CANCEL"/>
52+
<field name="state" widget="statusbar" statusbar_visible="new, offer received, offer accepted, sold"/>
5253
</header>
5354
<sheet>
5455
<group>

0 commit comments

Comments
 (0)