-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] estate: add property reports in estate module
- Improved the report by including additional data fields and ensuring the PDF output matches the data accurately. - Implemented conditional logic to handle cases with no offers, displaying a message instead of an empty table. - Inherited and extended the property report to add invoice details.
- Loading branch information
Showing
6 changed files
with
142 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<odoo> | ||
<template id="estate_property_offer_template"> | ||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th>Price</th> | ||
<th>Patner</th> | ||
<th>Validity</th> | ||
<th>Deadline</th> | ||
<th>Status</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<t t-set="offers" t-value="property.mapped('offer_ids')"/> | ||
<tr t-foreach="offers" t-as="offer"> | ||
<td> | ||
<span t-field="offer.price"/> | ||
</td> | ||
<td> | ||
<span t-field="offer.partner_id"/> | ||
</td> | ||
<td> | ||
<span t-field="offer.validity"/> | ||
</td> | ||
<td> | ||
<Span t-field="offer.date_deadline"/> | ||
</td> | ||
<td> | ||
<span t-field="offer.status"/> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</template> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<odoo> | ||
<record id="report_estate_property_offers" model="ir.actions.report"> | ||
<field name="name">Print Property</field> | ||
<field name="model">estate.property</field> | ||
<field name="report_type">qweb-html</field> | ||
<field name="report_name">estate.report_property_offers</field> | ||
<field name="report_file">estate.report_property_offers</field> | ||
<field name="print_report_name">'Estate_property_offers - %s' % (object.name or 'Attendee').replace('/','')</field> | ||
<field name="binding_model_id" ref="model_estate_property"/> | ||
<field name="binding_type">report</field> | ||
</record> | ||
|
||
<record id="report_user_estate_property_offer" model="ir.actions.report"> | ||
<field name="name">User Property Offers Report</field> | ||
<field name="model">res.users</field> | ||
<field name="report_type">qweb-html</field> | ||
<field name="report_name">estate.report_user_property_offers</field> | ||
<field name="report_file">estate.report_user_property_offers</field> | ||
<field name="print_report_name">'User Estate Property - %s' % (object.name or 'Attendee').replace('/','')</field> | ||
<field name="binding_model_id" ref="base.model_res_users"/> | ||
<field name="binding_type">report</field> | ||
</record> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<odoo> | ||
<template id="report_property_offers"> | ||
<t t-foreach="docs" t-as="property"> | ||
<t t-call="web.html_container"> | ||
<t t-call="web.external_layout"> | ||
<div class="page"> | ||
<h2> | ||
<span t-field="property.name"/> | ||
</h2> | ||
<div> | ||
<strong>Salesman:</strong> | ||
<span t-field="property.sell_person_id"/> | ||
</div> | ||
<div> | ||
<strong>Expected Price: </strong> | ||
<span t-field="property.expected_price"/> | ||
</div> | ||
<div> | ||
<strong>Status:</strong> | ||
<span t-field="property.state"/> | ||
</div> | ||
<t t-if="property.offer_ids"> | ||
<t t-call="estate.estate_property_offer_template"/> | ||
</t> | ||
<t t-else=""> | ||
<strong>No offers yet made for this property</strong> | ||
</t> | ||
</div> | ||
</t> | ||
</t> | ||
</t> | ||
</template> | ||
<template id="report_user_property_offers"> | ||
<t t-call="web.html_container"> | ||
<t t-foreach="docs" t-as="user"> | ||
<t t-call="web.external_layout"> | ||
<div class="page"> | ||
<h1> | ||
<strong t-field="user.name"/> | ||
</h1> | ||
<t t-foreach="user.property_ids" t-as="property"> | ||
<h2> | ||
<span t-field="property.name"/> | ||
</h2> | ||
<div> | ||
<strong>Expected Price: </strong> | ||
<span t-field="property.expected_price"/> | ||
</div> | ||
<div> | ||
<strong>Status: </strong> | ||
<span t-field="property.state"/> | ||
</div> | ||
<t t-if="property.offer_ids"> | ||
<t t-call="estate.estate_property_offer_template"/> | ||
</t> | ||
<t t-else=""> | ||
<strong>No offers yet made for this property</strong> | ||
</t> | ||
</t> | ||
</div> | ||
</t> | ||
</t> | ||
</t> | ||
</template> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<odoo> | ||
<template id="report_property_invoice_extension" inherit_id="estate.report_property_offers"> | ||
<xpath expr="//div[@class='page']" position="before"> | ||
<!-- Add a line for invoice details --> | ||
<t t-if="property.state == 'sold'"> | ||
<div> | ||
<strong> | ||
Your Invoice is has already created | ||
</strong> | ||
</div> | ||
</t> | ||
</xpath> | ||
</template> | ||
</odoo> | ||
|