-
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: Implemented PDF Reports
After this commit: Implemented Minimal Template Implemented Sub Templeted Implemented Report Inheritance
- Loading branch information
Showing
8 changed files
with
169 additions
and
26 deletions.
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 |
---|---|---|
@@ -1,39 +1,38 @@ | ||
<odoo> | ||
<record id="azure_interior_big_villa_1" model="estate.property.offer"> | ||
<field name="partner_id" ref="base.res_partner_12"/> | ||
<field name="property_id" ref="demo_big_villa"/> | ||
<field name="price">10000</field> | ||
<field name="validity">14</field> | ||
<field name="date_deadline" eval="DateTime.now() + relativedelta(days=14)"/> | ||
<field name="partner_id" ref="base.res_partner_12" /> | ||
<field name="property_id" ref="demo_big_villa" /> | ||
<field name="price">10000</field> | ||
<field name="validity">14</field> | ||
<field name="date_deadline" eval="DateTime.now() + relativedelta(days=14)" /> | ||
</record> | ||
|
||
<record id="azure_interior_big_villa_2" model="estate.property.offer"> | ||
<field name="partner_id" ref="base.res_partner_12"/> | ||
<field name="property_id" ref="demo_big_villa"/> | ||
<field name="price">1500000</field> | ||
<field name="validity">14</field> | ||
<field name="date_deadline" eval="DateTime.now() + relativedelta(days=14)"/> | ||
<field name="partner_id" ref="base.res_partner_12" /> | ||
<field name="property_id" ref="demo_big_villa" /> | ||
<field name="price">1500000</field> | ||
<field name="validity">14</field> | ||
<field name="date_deadline" eval="DateTime.now() + relativedelta(days=14)" /> | ||
</record> | ||
|
||
<record id="decco_addict_big_villa_3" model="estate.property.offer"> | ||
<field name="partner_id" ref="base.res_partner_2"/> | ||
<field name="property_id" ref="demo_big_villa"/> | ||
<field name="price">1500001</field> | ||
<field name="validity">14</field> | ||
<field name="date_deadline" eval="DateTime.now() + relativedelta(days=14)"/> | ||
<field name="partner_id" ref="base.res_partner_2" /> | ||
<field name="property_id" ref="demo_big_villa" /> | ||
<field name="price">1500001</field> | ||
<field name="validity">14</field> | ||
<field name="date_deadline" eval="DateTime.now() + relativedelta(days=14)" /> | ||
</record> | ||
|
||
<function model="estate.property.offer" name="action_accept"> | ||
<value eval="[ref('azure_interior_big_villa_1')]"/> | ||
<value eval="[ref('azure_interior_big_villa_1')]" /> | ||
</function> | ||
|
||
<function model="estate.property.offer" name="action_refused"> | ||
<value eval="[ref('azure_interior_big_villa_2')]"/> | ||
<value eval="[ref('azure_interior_big_villa_2')]" /> | ||
</function> | ||
|
||
<function model="estate.property.offer" name="action_refused"> | ||
<value eval="[ref('decco_addict_big_villa_3')]"/> | ||
<value eval="[ref('decco_addict_big_villa_3')]" /> | ||
</function> | ||
|
||
</odoo> | ||
|
||
</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,22 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
<data> | ||
<record id="action_property_offer_report" model="ir.actions.report"> | ||
<field name="name">Estate Property Report</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="binding_model_id" ref="estate.model_estate_property" /> | ||
<field name="binding_type">report</field> | ||
</record> | ||
|
||
<record id="action_user_offer_report" model="ir.actions.report"> | ||
<field name="name">Estate User Property</field> | ||
<field name="model">res.users</field> | ||
<field name="report_type">qweb-html</field> | ||
<field name="report_name">estate.report_salesperson_properties</field> | ||
<field name="binding_model_id" ref="base.model_res_users" /> | ||
<field name="binding_type">report</field> | ||
</record> | ||
</data> | ||
</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,36 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<odoo> | ||
<template id="estate_property_offer_subtemplate"> | ||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th>Price</th> | ||
<th>Partner</th> | ||
<th>Validity (days)</th> | ||
<th>Deadline</th> | ||
<th>State</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,67 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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.salesperson" /> | ||
</div> | ||
<div> | ||
<strong>Expected Price: </strong> | ||
<span t-field="property.expected_price" /> | ||
</div> | ||
<div class="state"> | ||
<strong>Status: </strong> | ||
<span t-field="property.state" /> | ||
</div> | ||
<t t-if="property.offer_ids"> | ||
<t t-call="estate.estate_property_offer_subtemplate" /> | ||
</t> | ||
<t t-else=""> | ||
<p> | ||
<b>No offer found</b> | ||
</p> | ||
</t> | ||
</div> | ||
</t> | ||
</t> | ||
</t> | ||
</template> | ||
<template id="report_salesperson_properties"> | ||
<t t-foreach="docs" t-as="user"> | ||
<t t-call="web.html_container"> | ||
<t t-call="web.external_layout"> | ||
<div class="page"> | ||
<h2>Salesman: <span t-field="user.name" /> | ||
</h2> | ||
<t t-foreach="user.property_ids" t-as="property"> | ||
<div> | ||
<h3> | ||
<span t-field="property.name" /> | ||
</h3> | ||
<div> | ||
<strong>Expected Price: </strong> | ||
<span t-field="property.expected_price" /> | ||
</div> | ||
<div> | ||
<strong>Status: </strong> | ||
<span t-field="property.state" /> | ||
</div> | ||
<t t-set="offers" t-value="property.mapped('offer_ids')" /> | ||
<t t-call="estate.estate_property_offer_subtemplate"> | ||
<t t-set="offers" t-value="offers" /> | ||
</t> | ||
</div> | ||
</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
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,12 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<odoo> | ||
<template id="report_property_offers_inherit" inherit_id="estate.report_property_offers"> | ||
<xpath expr="//div[@class='state']" position="after"> | ||
<t t-if="property.state == 'sold'"> | ||
<div> | ||
<strong>!!!Invoice has been already created!!!</strong> | ||
</div> | ||
</t> | ||
</xpath> | ||
</template> | ||
</odoo> |