Skip to content

Commit 7a77b1b

Browse files
committed
[IMP] estate : adding kanban view to estate property
1 parent 07813a2 commit 7a77b1b

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

estate/models/estate_property.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ class EstateProperty(models.Model):
6969
)
7070

7171
property_tags_ids = fields.Many2many("estate.property.tag", string="Tags")
72+
color = fields.Integer('Color Index', default=7)
7273

7374
offer_ids = fields.One2many("estate.property.offer", "property_id", string="Offers")
7475
total_area = fields.Float(compute="_compute_total_area")

estate/views/estate_property_view.xml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,38 @@
55
<field name="name">Real Estate Properties</field>
66
<field name="res_model">estate.property</field>
77
<field name="context">{'search_default_property_state': True}</field>
8-
<field name="view_mode">list,form</field>
8+
<field name="view_mode">list,form,kanban</field>
99
<field name="help" type="html">
1010
<p class="o_view_nocontent_smiling_face">
1111
Welcome to the help of estate property
1212
</p>
1313
</field>
1414
</record>
1515

16+
<record id="estate_property_view_kanban" model="ir.ui.view">
17+
<field name="name">estate.property.kanban</field>
18+
<field name="model">estate.property</field>
19+
<field name="arch" type="xml">
20+
<kanban highlight_color="color" default_group_by="property_type_id" records_draggable="false" groups_draggable="true">
21+
<!-- <progressbar field="state" colors='{"new": "success", "offer_received": "warning", "offer_accepted": "danger"}'/> -->
22+
<field name="state"/>
23+
<templates>
24+
<t t-name="card" handle="false">
25+
<field name="name"/>
26+
<field name="expected_price"/>
27+
<div t-if="record.state == 'offer_received'">
28+
<field name="best_offer"/>
29+
</div>
30+
<div t-if="record.state == 'offer_accepted'">
31+
<field name="selling_price"/>
32+
</div>
33+
<field name="property_tags_ids"/>
34+
</t>
35+
</templates>
36+
</kanban>
37+
</field>
38+
</record>
39+
1640
<record id="estate_property_view_form" model="ir.ui.view">
1741
<field name="name">estate.property.form</field>
1842
<field name="model">estate.property</field>

0 commit comments

Comments
 (0)