Skip to content

Commit 668311e

Browse files
committed
[ADD] estate: introduce Kanban view for properties
Add a new Kanban view to visually display properties with a custom layout powered by QWeb templates. This improves user experience compared to the traditional list view by providing a card-like structure. The Kanban view includes: - property name and key pricing details - expected price and tags always visible - best price shown only when offers are received - selling price shown only when an offer is accepted Additionally: - properties are grouped by type by default - drag-and-drop reordering is disabled to preserve consistency This change makes property browsing more visual and intuitive, while respecting Odoo’s guidelines for modular and customizable UI components.
1 parent 182a5cd commit 668311e

File tree

2 files changed

+44
-3
lines changed

2 files changed

+44
-3
lines changed

estate/views/estate_property_offer_views.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
<button name="action_set_accepted" string="Accepted" type="object" icon="fa-check"
2020
invisible="status != False"/>
2121
<button name="action_set_refused" string="Refused" type="object" icon="fa-times"
22-
invisible="status != False"/>
22+
invisible="status != False"/>
23+
<field name ="status" readonly="1"/>
2324
<field name="date_deadline"/>
2425
</list>
2526
</field>

estate/views/estate_property_views.xml

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<record id="estate_property_action" model="ir.actions.act_window">
55
<field name="name">Property</field>
66
<field name="res_model">estate.property</field>
7-
<field name="view_mode">list,form</field>
7+
<field name="view_mode">list,form,kanban</field>
88
<field name="context">{'search_default_available_properties' : 1}</field>
99
<field name="help" type="html">
1010
<p class="o_view_nocontent_smiling_face">
@@ -117,4 +117,44 @@
117117
</search>
118118
</field>
119119
</record>
120-
</odoo>
120+
121+
<!-- kanban view -->
122+
<record id="estate_property_kanban_view" model="ir.ui.view">
123+
<field name="name">estate.property.kanban</field>
124+
<field name="model">estate.property</field>
125+
<field name="arch" type="xml">
126+
<kanban default_group_by="property_type_id" records_draggable="False" group_create="False">
127+
<field name="state"/>
128+
<progressbar field="state"
129+
colors='{
130+
"new": "info",
131+
"offer received": "warning",
132+
"offer accepted": "primary",
133+
"sold": "success",
134+
"cancelled": "danger"
135+
}'/>
136+
<templates>
137+
<t t-name="card">
138+
<div>
139+
<div style="font-weight: bold; font-size: 16px;">
140+
<field name="name"/>
141+
</div>
142+
<div>Expected Price: <field name="expected_price"/></div>
143+
144+
<!-- Conditional display using state -->
145+
<div t-if="record.state.raw_value == 'offer received'">
146+
Best Price: <field name="best_price"/>
147+
</div>
148+
<div t-if="record.state.raw_value == 'offer accepted'">
149+
Selling Price: <field name="selling_price"/>
150+
</div>
151+
152+
<field name="tag_ids" options="{'color_field': 'color'}"/>
153+
</div>
154+
</t>
155+
</templates>
156+
</kanban>
157+
</field>
158+
</record>
159+
</odoo>
160+

0 commit comments

Comments
 (0)