Skip to content

Commit 205621d

Browse files
committed
[IMP] estate: Added Form view
Added List View Added Search View Added Filter View Added Group By view Styled the Form View
1 parent 4e193a0 commit 205621d

File tree

3 files changed

+86
-14
lines changed

3 files changed

+86
-14
lines changed

estate/__manifest__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
'data': [
1717
"security/ir.model.access.csv",
1818
"views/estate_property_views.xml",
19-
"views/estate_property_menus.xml"
19+
"views/estate_property_menus.xml",
2020
],
2121
'demo': [
2222
],
2323
"license": "LGPL-3",
24-
'css': ['static/src/css/crm.css'],
24+
'css': [''],
2525
'installable': True,
2626
'application': True,
2727
'auto_install': False

estate/models/estate_property.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,27 @@ class EstateProperty(models.Model):
1111
name = fields.Char(string='Estate Property Name', required=True)
1212
description = fields.Text(string='Estate Property Description')
1313
postcode = fields.Char(string='Estate Property Postcode')
14-
date_availability = fields.Date(string='Estate Property Date Availability',
15-
copy=False, default=lambda self: datetime.now() + timedelta(days=90))
16-
expected_price = fields.Float(
17-
string='Expected Price Of Property', required=True)
18-
selling_price = fields.Float(
19-
string='Selling Price of Property', readonly=True, copy=False)
20-
bedrooms = fields.Integer(
21-
string='Number of Bedrooms in Property', default=2)
14+
date_availability = fields.Date(string='Estate Property Date Availability', copy=False, default=lambda self: datetime.now() + timedelta(days=90))
15+
expected_price = fields.Float(string='Expected Price Of Property', required=True)
16+
selling_price = fields.Float(string='Selling Price of Property', readonly=True, copy=False)
17+
bedrooms = fields.Integer(string='Number of Bedrooms in Property', default=2)
2218
living_area = fields.Integer(string='Number of Living Room in Property')
2319
facades = fields.Integer(string='Number of Facades in Property')
2420
garage = fields.Boolean(string='Property have garage or not')
2521
garden = fields.Boolean(string='Property have Garden or not')
2622
garden_area = fields.Integer(string='Number of Garden Area')
2723
garden_orientation = fields.Selection(
2824
string='Orientation of Garden',
29-
selection=[('north', 'North'), ('south', 'Sou hhjghjth'),
30-
31-
('east', 'East'), ('west', 'West')],
25+
selection=[('north', 'North'),
26+
('south', 'Sou hhjghjth'),
27+
('east', 'East'),
28+
('west', 'West')],
3229
help="Different Types of Directions")
3330
active = fields.Boolean(default=True)
3431
state = fields.Selection(
3532
string='State',
3633
default="new",
3734
copy=False,
3835
required=True,
39-
selection=[('new' , 'New'), ('offer_recieved' , 'Offer Received'), ('offer_accepted','Offer Accepted'), ('sold_and_cancelled', 'Sold and Cancelled')],
36+
selection=[('new', 'New'), ('offer_recieved', 'Offer Received'), ('offer_accepted' , 'Offer Accepted'), ('sold_and_cancelled', 'Sold and Cancelled')],
4037
help="State of the property")

estate/views/estate_property_views.xml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,79 @@
55
<field name="res_model">estate.property</field>
66
<field name="view_mode">list,form</field>
77
</record>
8+
<record id="estate_property_view_tree" model="ir.ui.view">
9+
<field name="name">estate.property.list</field>
10+
<field name="model">estate.property</field>
11+
<field name="arch" type="xml">
12+
<list string="Properties">
13+
<field name="name" string="Title" />
14+
<field name="postcode" string="Postcode" />
15+
<field name="bedrooms" string="Bedrooms" />
16+
<field name="living_area" string="Living Area (sqm)" />
17+
<field name="expected_price" string="Expected Price" />
18+
<field name="selling_price" string="Selling Price" />
19+
<field name="date_availability" string="Available From" />
20+
</list>
21+
</field>
22+
</record>
23+
<record id="estate.property_view_form" model="ir.ui.view">
24+
<field name="name">estate.property.view.form</field>
25+
<field name="model">estate.property</field>
26+
<field name="arch" type="xml">
27+
<form string="New Property XX">
28+
<sheet>
29+
<div class="oe_title">
30+
<h1>
31+
32+
<field name="name" placeholder="Enter your Estate Property Name"
33+
required="True"></field>
34+
</h1>
35+
</div>
36+
<group>
37+
<group>
38+
<field name="postcode" string="Postcode" />
39+
<field name="date_availability" string="Available from" />
40+
</group>
41+
<group>
42+
<field name="expected_price" string="Expected Price" />
43+
<field name="selling_price" string="Selling Price" />
44+
</group>
45+
</group>
46+
<notebook>
47+
<page string="Description">
48+
<group>
49+
<field name="description" string="Description" />
50+
<field name="bedrooms" string="Bedrooms" />
51+
<field name="living_area" string="Living Area (sqm)" />
52+
<field name="facades" string="Facades" />
53+
<field name="garage" string="Garage" />
54+
<field name="garden" string="Garden" />
55+
<field name="garden_area" string="Garden Area (sqm)" />
56+
<field name="garden_orientation" string="Garden orientation" />
57+
<field name="state" string="Current state"></field>
58+
</group>
59+
</page>
60+
</notebook>
61+
</sheet>
62+
</form>
63+
</field>
64+
</record>
65+
<record id="estate_property_search" model="ir.ui.view">
66+
<field name="name">estate.property.search</field>
67+
<field name="model">estate.property</field>
68+
<field name="arch" type="xml">
69+
<search string="Real Estate">
70+
<field name="name" string="Title" />
71+
<field name="postcode" string="Postcode" />
72+
<field name="expected_price" string="Expected Price" />
73+
<field name="bedrooms" string="Bedrooms" />
74+
<field name="living_area" string="Living Area (sqm)" />
75+
<field name="facades" string="Facades" />
76+
<separator />
77+
<filter string="Available" name="state"
78+
domain="[('state', 'in', ['new', 'offer_recieved'])]" />
79+
<filter name="postcode" string="Postcode" context="{'group_by': 'postcode'}" />
80+
</search>
81+
</field>
82+
</record>
883
</odoo>

0 commit comments

Comments
 (0)