Skip to content

Commit c292b77

Browse files
committed
[ADD] estate: Add Kanban View for Properties
Introduces a Kanban view to visually represent properties using a custom QWeb-powered layout, offering a more intuitive and engaging alternative to the standard list view. Key Features: - Displays property name and key pricing details. - Shows expected price and tags by default. - Displays best offer only when offers exist. - Reveals selling price only when an offer is accepted. - Groups properties by property type by default.
1 parent cd2b9e2 commit c292b77

File tree

1 file changed

+40
-5
lines changed

1 file changed

+40
-5
lines changed

estate/views/estate_property_views.xml

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<record id="action_estate_property" model="ir.actions.act_window">
66
<field name="name">Properties</field>
77
<field name="res_model">estate.property</field>
8-
<field name="view_mode">list,form</field>
8+
<field name="view_mode">list,form,kanban</field>
99
<field name="context">{'search_default_available': True}</field>
1010
<field name="help" type="html">
1111
<p class="o_view_nocontent_smiling_face">
@@ -14,13 +14,48 @@
1414
</field>
1515
</record>
1616

17+
<record id="kanban_view_estate_property" model="ir.ui.view">
18+
<field name="name">Estate Properties kanban</field>
19+
<field name="model">estate.property</field>
20+
<field name="arch" type="xml">
21+
<kanban default_group_by="property_type_id" records_draggable="False" group_create="False">
22+
<field name="state" />
23+
<templates>
24+
<t t-name="kanban-box">
25+
<div>
26+
<div>
27+
<strong>
28+
<field name="name" />
29+
</strong>
30+
</div>
31+
32+
<div>
33+
Expected Price: <field name="expected_price"/>
34+
</div>
35+
36+
<div t-if="record.state.raw_value == 'offer_received'">
37+
Best Price: <field name="best_price"/>
38+
</div>
39+
40+
<div t-if="record.state.raw_value == 'offer_accepted'">
41+
Selling Price: <field name="selling_price"/>
42+
</div>
43+
44+
<div>
45+
<field name="tag_ids" widget="many2many_tags" options="{'color_field' : 'color'}" />
46+
</div>
47+
</div>
48+
</t>
49+
</templates>
50+
</kanban>
51+
</field>
52+
</record>
53+
1754
<record id="list_view_estate_property" model="ir.ui.view">
1855
<field name="name">Estate Properties list</field>
1956
<field name="model">estate.property</field>
2057
<field name="arch" type="xml">
21-
<list decoration-success="state == 'offer_received' or state == 'offer_accepted'"
22-
decoration-danger="state == 'cancelled'"
23-
decoration-bf="state == 'offer_accepted'" decoration-muted="state == 'sold'">
58+
<list decoration-success="state == 'offer_received' or state == 'offer_accepted'" decoration-danger="state == 'cancelled'" decoration-bf="state == 'offer_accepted'" decoration-muted="state == 'sold'">
2459
<field name="name" string="Title" width="20%" />
2560
<field name="postcode" string="Postcode" width="20%" />
2661
<field name="bedrooms" string="Bedrooms" width="10%" />
@@ -86,7 +121,7 @@
86121
<page string="Offer">
87122
<field name="offer_ids" readonly="state in ['offer_accepted', 'sold', 'cancelled']" />
88123
</page>
89-
124+
90125
<page string="Other Info">
91126
<group>
92127
<field name="salesman" string="Salesman"/>

0 commit comments

Comments
 (0)