10000 XAFR - Technical Training by xafr-odoo · Pull Request #740 · odoo/tutorials · GitHub
[go: up one dir, main page]

Skip to content

XAFR - Technical Training #740

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 21 commits into
base: 18.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[IMP] estate: Chapter 14
QWeb Templates
  • Loading branch information
xafr-odoo committed May 2, 2025
commit 7e14dacf078afb18970a53a40f52aaba8d7a613d
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,4 @@ dmypy.json
.pyre/

# PyCharm Demo Config
.run/rd-demo.run.xml
.run/rd-demo.run.xml
22 changes: 0 additions & 22 deletions .run/rd-demo.run.xml

This file was deleted.

2 changes: 1 addition & 1 deletion estate/models/estate_property.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def _onchange_has_garden(self):
self.garden_orientation = ''
return {'warning': {
'title': _("Warning"),
'message': ('Unchecking the garden option removed the area value and orientation.')}}
'message': _('Unchecking the garden option removed the area value and orientation.')}}

def action_btn_sold(self):
for record in self:
Expand Down
44 changes: 42 additions & 2 deletions estate/views/estate_property_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<record id="estate_property_model_action" model="ir.actions.act_window">
<field name="name">Properties</field>
<field name="res_model">estate.property</field>
<field name="view_mode">list,form</field>
<field name="context">{'search_default_availability': True}</field>
<field name="view_mode">list,form,kanban</field>
<!-- <field name="context">{'search_default_availability': True}</field>-->

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to leave a commented line :)

</record>

<record id="estate_property_list_view" model="ir.ui.view">
Expand Down Expand Up @@ -104,4 +104,44 @@
</search>
</field>
</record>

<record id="estate_property_kanban_view" model="ir.ui.view">
<field name="name">estate.property.kanban</field>
<field name="model">estate.property</field>
<field name="arch" type="xml">
<kanban default_group_by="property_type_id" groups_draggable="False" records_draggable="False">
<field name="state"/>
<templates>
<t t-name="kanban-box">
<div>
<field name="name"/>
<div t-if="record.state.raw_value == 'new'">
This is new!
</div>
</div>
</t>
<t t-name="card">
<div>
<h2><field name="name"/></h2>
</div>
<div>
Expected price:
<field name="expected_price"/>€
</div>
<div t-if="record.state.raw_value == 'offer_received'">
Best Offer:
<field name="best_offer"/>€
</div>
<div t-if="record.state.raw_value == 'offer_accepted'">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should use a t-elif here

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes indeed

Selling price:
<field name="selling_price"/>€
</div>
<div>
<field name="tag_ids"/>
</div>
</t>
</templates>
</kanban>
</field>
</record>
</odoo>
0