Skip to content

Commit 8cd5978

Browse files
committed
[IMP] estate: Add kanban view for estate properties.
Chapter 14 - A brief history of QWeb
1 parent 31a320d commit 8cd5978

2 files changed

Lines changed: 39 additions & 3 deletions

File tree

estate/views/estate_property_offer_views.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
<field name="date_deadline"/>
1313
<button name="action_accept_offer" type="object" title="Accept" icon="fa-check" invisible="status == 'accepted' or status == 'refused'"/>
1414
<button name="action_refuse_offer" type="object" title="Refuse" icon="fa-times" invisible="status == 'accepted' or status == 'refused'"/>
15-
<field name="status" invisible="True"/>
1615
</list>
1716
</field>
1817
</record>

estate/views/estate_property_views.xml

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<record id="estate_property_action" model="ir.actions.act_window">
44
<field name="name">Properties</field>
55
<field name="res_model">estate.property</field>
6-
<field name="view_mode">list,form</field>
6+
<field name="view_mode">list,form,kanban</field>
77
<field name="context">{'search_default_available': True}</field>
88
</record>
99

@@ -100,9 +100,46 @@
100100
<filter string="Postcode" name="group_by_postcode" context="{'group_by':'postcode'}"/>
101101
</group>
102102
</search>
103+
</field>
104+
</record>
103105

104-
106+
<record id="estate_property_view_kanban" model="ir.ui.view">
107+
<field name="name">estate.properties.view.kanban</field>
108+
<field name="model">estate.property</field>
109+
<field name="arch" type="xml">
110+
<kanban default_group_by="state" group_create="false" groups_draggable="False" records_draggable="False">
111+
<field name="tag_ids"/>
112+
<field name="state"/>
113+
<templates>
114+
<t t-name="card">
115+
<div class="oe_kanban_global_click">
116+
<div>
117+
<h2>
118+
<field name="name"/>
119+
</h2>
120+
</div>
121+
<div>
122+
<span>Expected price :</span>
123+
<field name="expected_price"/>
124+
</div>
125+
<div t-if="record.state.raw_value === 'offer_received'">
126+
<span>Best price :</span>
127+
<field name="best_price"/>
128+
</div>
129+
<div t-if="record.state.raw_value === 'offer_accepted'">
130+
<span>Selling price :</span>
131+
<field name="selling_price"/>
132+
</div>
133+
<div class="oe_kanban_tags">
134+
<field name="tag_ids" widget="many2many_tags" options="{'color_field': 'color'}"/>
135+
</div>
136+
</div>
137+
</t>
138+
</templates>
139+
</kanban>
105140
</field>
106141
</record>
107142

143+
144+
108145
</odoo>

0 commit comments

Comments
 (0)