Skip to content

Commit 35673d8

Browse files
author
raibr
committed
[IMP] estate (Chapter 14): Add Kanban view for properties and associated styles
1 parent 9259a91 commit 35673d8

File tree

3 files changed

+62
-1
lines changed

3 files changed

+62
-1
lines changed

estate/__manifest__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
"views/res_users_views.xml",
2525
"views/estate_menus.xml",
2626
],
27+
"assets": {
28+
"web.assets_backend": [
29+
"estate/static/src/css/estate.css",
30+
],
31+
},
2732
"application": True,
2833
"license": "LGPL-3",
2934
}

estate/static/src/css/estate.css

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/* Estate Module Kanban View Styles */
2+
3+
.o_kanban_record_title {
4+
font-size: 16px;
5+
font-weight: bold;
6+
margin-bottom: 8px;
7+
color: #212529;
8+
}
9+
10+
.o_kanban_record_subtitle {
11+
font-size: 13px;
12+
color: #6c757d;
13+
margin-bottom: 4px;
14+
}
15+
16+
.o_kanban_tags_section {
17+
margin-top: 8px;
18+
}

estate/views/estate_property_views.xml

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,44 @@
2323

2424
</record>
2525

26+
<!-- Kanban view -->
27+
<record id="estate_property_view_kanban" model="ir.ui.view">
28+
<field name="name">estate.property.view.kanban</field>
29+
<field name="model">estate.property</field>
30+
<field name="arch" type="xml">
31+
<kanban default_group_by="property_type_id" records_draggable="false">
32+
<field name="state" />
33+
<templates>
34+
<t t-name="card">
35+
<div class="oe_kanban_card oe_kanban_global_click">
36+
<div class="oe_kanban_details">
37+
<div class="o_kanban_record_title">
38+
<field name="name" />
39+
</div>
40+
<div class="o_kanban_record_subtitle"> Expected Price: <field
41+
name="expected_price" />
42+
</div>
43+
<div class="o_kanban_record_subtitle"
44+
t-if="record.state.raw_value == 'offer_received' or record.state.raw_value == 'offer_accepted'">
45+
Best Offer: <field name="best_price" />
46+
</div>
47+
<div class="o_kanban_record_subtitle"
48+
t-if="record.state.raw_value == 'offer_accepted'"> Selling
49+
Price: <field name="selling_price" />
50+
</div>
51+
<div class="o_kanban_tags_section">
52+
<field name="tag_ids" widget="many2many_tags"
53+
options="{'no_quick_create': True}"
54+
/>
55+
</div>
56+
</div>
57+
</div>
58+
</t>
59+
</templates>
60+
</kanban>
61+
</field>
62+
</record>
63+
2664
<!-- Form view -->
2765
<record id="estate_property_view_form" model="ir.ui.view">
2866
<field name="name">estate.property.view.form</field>
@@ -118,7 +156,7 @@
118156
<record id="estate_property_action" model="ir.actions.act_window">
119157
<field name="name">Properties</field>
120158
<field name="res_model">estate.property</field>
121-
<field name="view_mode">list,form</field>
159+
<field name="view_mode">list,kanban,form</field>
122160
<field name="context">{'search_default_filter_available': True}</field>
123161
</record>
124162
</odoo>

0 commit comments

Comments
 (0)