Skip to content

Commit b63c964

Browse files
[IMP] estate: add kanban view with grouping and conditional fields
Add a kanban view to give users a better visual overview of properties. The view groups properties by type to keep things organized and shows important price details only when they are relevant. - Add kanban to the property action view_mode. - Create a kanban view showing property name and tags. - Show 'best price' only when an offer exists and 'selling price' only when an offer is accepted. - Group properties by type by default. - Disable the drag-and-drop feature for kanban columns.
1 parent f5c7104 commit b63c964

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

estate/views/estate_property_views.xml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,39 @@
9999
</field>
100100
</record>
101101

102+
<record id="estate_property_view_kanban" model="ir.ui.view">
103+
<field name="name">estate.property.kanban</field>
104+
<field name="model">estate.property</field>
105+
<field name="arch" type="xml">
106+
<kanban string="Properties" default_group_by="property_type_id" records_draggable="False" groups_draggable="False">
107+
<templates>
108+
<t t-name="card">
109+
<field name="state" invisible="1"/>
110+
<div>
111+
<b><field name="name"/></b>
112+
</div>
113+
<div>
114+
<strong>Expected Price: </strong><field name="expected_price" string="Expected Price"/>
115+
</div>
116+
<div t-if="record.state.raw_value == 'offer_received'">
117+
<strong>Best Offer: </strong><field name="best_offer"/>
118+
</div>
119+
<div t-if="record.state.raw_value == 'offer_accepted'">
120+
<strong>Selling Price: </strong><field name="selling_price"/>
121+
</div>
122+
<div>
123+
<field name="tag_ids" widget="many2many_tags" options="{'color_field': 'color'}"/>
124+
</div>
125+
</t>
126+
</templates>
127+
</kanban>
128+
</field>
129+
</record>
130+
102131
<record id="estate_property_action" model="ir.actions.act_window">
103132
<field name="name">Properties</field>
104133
<field name="res_model">estate.property</field>
105-
<field name="view_mode">list,form</field>
134+
<field name="view_mode">list,form,kanban</field>
106135
<field name="context">{'search_default_available': 1}</field>
107136
<field name="help" type="html">
108137
<p class="o_view_nocontent_smiling_face">

0 commit comments

Comments
 (0)