Skip to content

Commit baabfe5

Browse files
committed
[ADD] estate: add basic property views
CHP 6 - Completed Perform the Estate Property List View , Form View ,Group By and Filters
1 parent 72dac89 commit baabfe5

File tree

5 files changed

+102
-21
lines changed

5 files changed

+102
-21
lines changed

estate/__manifest__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
'name': 'RealEstate',
2+
'name': 'Real Estate',
33
'description': 'Welcome to my Real Estate',
44
'author': 'KRPAT',
55
'website': 'https://www.odoo.com/',
66
'category': 'Tutorials',
7-
'version': '19.0.0.0',
7+
'version': '1.0.0.0',
88
'license': 'LGPL-3',
99
'depends': ['base'],
1010
'data': [

estate/models/estate_property.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class EstateProperty(models.Model):
3333
],
3434
string='Garden Orientation',
3535
)
36-
active = fields.Boolean(default=False)
36+
active = fields.Boolean(default=True)
3737
state = fields.Selection(
3838
[
3939
('new', 'New'),
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
2-
access_estate_property,access_estate_property,model_estate_property,base.group_user,1,1,1,1
2+
access_estate_property,access_estate_property,model_estate_property,base.group_user,1,1,1,1

estate/views/estate_menus.xml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<odoo>
33
<data>
4-
<menuitem id="estate_menu_root" name="Real Estate"/>
5-
6-
<menuitem id="estate_first_level_menu"
7-
name="Estate"
8-
parent="estate_menu_root"/>
9-
10-
<menuitem id="estate_property_menu_action"
11-
name="Properties"
12-
parent="estate_first_level_menu"
13-
action="estate_property_action"/>
4+
<menuitem id="estate_menu_root" name="Real Estate"/>
5+
<menuitem id="estate_first_level_menu" name="Estate" parent="estate_menu_root"/>
6+
<menuitem id="estate_property_menu_action" name="Properties" parent="estate_first_level_menu" action="estate_property_action"/>
147
</data>
158
</odoo>
Lines changed: 95 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,98 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
1+
<?xml version="1.0" encoding="UTF-8"?>
22
<odoo>
33
<data>
4-
<record id="estate_property_action" model="ir.actions.act_window">
5-
<field name="name">Estate Property Actions</field>
6-
<field name="res_model">estate.property</field>
7-
<field name="view_mode">list,form</field>
8-
</record>
9-
</data>
4+
<record id="estate_property_action" model="ir.actions.act_window">
5+
<field name="name">Estate Property Actions</field>
6+
<field name="res_model">estate.property</field>
7+
<field name="view_mode">list,form</field>
8+
</record>
9+
10+
<record id="estate_property_list_view" model="ir.ui.view">
11+
<field name="name">estate.property.list</field>
12+
<field name="model">estate.property</field>
13+
<field name="arch" type="xml">
14+
<list string="Properties">
15+
<field name="name" string="Title" />
16+
<field name="postcode" />
17+
<field name="bedrooms" />
18+
<field name="living_area" string="Living Area (sqm)" />
19+
<field name="expected_price" />
20+
<field name="selling_price" />
21+
<field name="date_availability" string="Available From" />
22+
</list>
23+
</field>
24+
</record>
25+
26+
<record id="estate_property_form_view" model="ir.ui.view">
27+
<field name="name">estate.property.form</field>
28+
<field name="model">estate.property</field>
29+
<field name="arch" type="xml">
30+
<form string="Estate_Property">
31+
<sheet>
32+
<h1>
33+
<field name="name" />
34+
</h1>
35+
36+
<group>
37+
<group>
38+
<field name="postcode" />
39+
<field name="date_availability" string="Available From" />
40+
</group>
41+
<group>
42+
<field name="expected_price" />
43+
<field name="selling_price" />
44+
</group>
45+
</group>
46+
47+
<notebook>
48+
<page string="Description">
49+
<group>
50+
<field name="description" />
51+
</group>
52+
53+
<group>
54+
<field name="bedrooms" />
55+
<field name="living_area" string="Living Area (sqm)" />
56+
<field name="facades" />
57+
<field name="garage" />
58+
<field name="garden" />
59+
<field name="garden_area" string="Garden Area (sqm)" />
60+
<field name="garden_orientation" />
61+
<field name="state" />
62+
</group>
63+
</page>
64+
65+
</notebook>
66+
</sheet>
67+
</form>
68+
</field>
69+
</record>
70+
71+
<record id="estate_property_search_view" model="ir.ui.view">
72+
<field name="name">estate.property.search</field>
73+
<field name="model">estate.property</field>
74+
<field name="arch" type="xml">
75+
76+
<search string="Search Properties">
77+
78+
<field name="name" string="Title" />
79+
<field name="postcode" />
80+
<field name="expected_price" />
81+
<field name="living_area" string="Living Area (sqm)" />
82+
<field name="facades" />
83+
84+
<separator />
85+
86+
<filter name="available" string="Available"
87+
domain="['|',('state', '=', 'new'),('state', '=', 'offer_received')]"/>
88+
89+
<separator />
90+
91+
<filter name="group_by_postcode" string="Postcode"
92+
context="{'group_by': 'postcode'}" />
93+
94+
</search>
95+
</field>
96+
</record>
97+
</data>
1098
</odoo>

0 commit comments

Comments
 (0)