bemade_fsm: Got the "Sign Report" functionality working.

Found which template to extend to inject our new work order template
into the front-end signature page. Now need to add the timesheets info
with task tree into our template and we should be good to go.

Fixes Dur-Pro/bemade-addons#94
This commit is contained in:
Marc Durepos 2023-08-04 15:31:10 -04:00
parent c4fdcd94b3
commit a84b9d926a
2 changed files with 45 additions and 4 deletions

View file

@ -25,9 +25,6 @@
}'/>
</t>
</div>
<div t-attf-class="{{('col-6' if report_type == 'pdf' else 'col-md-6 col-12') + ' mb-3'}}">
<span>Company: <span t-out="company"/></span>
</div>
</div>
<t t-set="order_lines" t-value="doc.relevant_order_lines"/>
<t t-if="order_lines">
@ -172,6 +169,37 @@
</div>
</div>
</div>
<div t-if="doc.worksheet_signature">
<div t-if="report_type == html" class="ribbon" style="
position: absolute;
right: 0px; top: 0px;
z-index: 1;
overflow: hidden;
width: 75px; height: 75px;
text-align: right;">
<span style="
font-size: 10px;
color: #fff;
text-transform: uppercase;
text-align: center;
font-weight: bold; line-height: 20px;
transform: rotate(45deg);
width: 100px; height: auto; display: block;
background: green;
position: absolute;
top: 19px; right: -21px; left: auto;
padding: 0;">
Signed
</span>
</div>
<div t-attf-class="#{'col-12 col-lg-3' if report_type != 'html' else 'col-sm-7 col-md-4'} ml-auto text-right" style="page-break-inside: avoid">
<h5>Signature</h5>
<img t-att-src="image_data_uri(doc.worksheet_signature)" style="max-height: 6rem; max-width: 100%; color:black;"/><br/>
<span t-field="doc.worksheet_signed_by"/>
</div>
</div>
</div>
</template>
@ -185,5 +213,12 @@
</t>
</t>
</template>
<template id="portal_my_worksheet"
inherit_id="industry_fsm_report.portal_my_worksheet">
<xpath expr="//div[@t-call='industry_fsm_report.worksheet_custom_page']"
position="replace">
<div t-call="bemade_fsm.work_order_page"/>
</xpath>
</template>
</data>
</odoo>

View file

@ -5,8 +5,14 @@
<field name="name">Work Order Report (PDF)</field>
<field name="report_name">bemade_fsm.work_order</field>
<field name="report_file">bemade_fsm.work_order</field>
<field name="print_report_name">'%s Work Order %s' % (time.strftime('%Y-%m-%d'), object.name)</field>
<field name="print_report_name">'%s Work Order %s' % (
time.strftime('%Y-%m-%d'), object.name)</field>
<field name="report_type">qweb-html</field>
</record>
<!-- <record id="work_order_template" model="worksheet.template">-->
<!-- <field name="name">Basic Work Order</field>-->
<!-- <field name="res_model">project.task</field>-->
<!-- </record>-->
</data>
</odoo>