bemade_fsm: Add the beginning of the PDF report for service tasks.
This commit is contained in:
parent
29862ccc63
commit
b787f81325
3 changed files with 135 additions and 0 deletions
|
|
@ -49,6 +49,7 @@
|
|||
'views/menus.xml',
|
||||
'views/task_views.xml',
|
||||
'views/sale_order_views.xml',
|
||||
'reports/worksheet_templates.xml',
|
||||
],
|
||||
'assets': {
|
||||
'web.assets_tests': [
|
||||
|
|
@ -56,6 +57,9 @@
|
|||
'bemade_fsm/static/tests/tours/equipment_tour.js',
|
||||
'bemade_fsm/static/tests/tours/sale_order_tour.js',
|
||||
],
|
||||
'web.report_assets_common': [
|
||||
'bemade_fsm/static/src/scss/bemade_fsm.scss'
|
||||
]
|
||||
},
|
||||
'installable': True,
|
||||
'auto_install': False
|
||||
|
|
|
|||
86
bemade_fsm/reports/worksheet_templates.xml
Normal file
86
bemade_fsm/reports/worksheet_templates.xml
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="default_worksheet_template" model="ir.actions.report">
|
||||
<field name="name">Complete Worksheet Report (PDF)</field>
|
||||
<field name="model">project.task</field>
|
||||
<field name="report_type">qweb-pdf</field>
|
||||
<field name="report_name">bemade_fsm.worksheet_complete</field>
|
||||
<field name="print_report_name">
|
||||
'%s Worksheet %s' % (time.now().strftime('%Y-%m-%d'),object.name)
|
||||
</field>
|
||||
<field name="binding_model_id" ref="model_project_task"/>
|
||||
<field name="binding_type">report</field>
|
||||
</record>
|
||||
|
||||
<template id="worksheet_complete">
|
||||
<t t-call="web.html_container">
|
||||
<t t-foreach="docs" t-as="doc">
|
||||
<t t-call="web.external_layout">
|
||||
<t t-call="bemade_fsm.worksheet_complete_page"
|
||||
t-lang="doc.partner_id.lang"/>
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
<template id="worksheet_complete_page">
|
||||
<t t-set="address">
|
||||
<strong class="big-red">Customer:</strong>
|
||||
<div t-field="doc.partner_id"
|
||||
t-options='{"widget": "contact",
|
||||
"fields": ["address", "name"], "no_marker": True}'/>
|
||||
</t>
|
||||
<t t-set="information_block">
|
||||
<strong>Service Address:</strong>
|
||||
<div t-field="doc.customer_shipping_id"
|
||||
t-options='{"widget": "contact",
|
||||
"fields": ["address", "name", "phone"],
|
||||
"no_marker": True, "phone_icons": True}'/>
|
||||
</t>
|
||||
<div class="page">
|
||||
<div class="oe_structure"/>
|
||||
<h2 class="mt16">
|
||||
<span>Work Order </span>
|
||||
<span t-field="doc.name"/>
|
||||
</h2>
|
||||
|
||||
<div class="container wo-information">
|
||||
<div t-if="doc.sale_order_id.client_order_ref" class="col-3">
|
||||
<p class="m-0">
|
||||
<strong>Your Reference: </strong>
|
||||
<span t-field="doc.sale_order_id.client_order_ref"/>
|
||||
</p>
|
||||
<p t-if="doc.planned_date_begin" class="m-0">
|
||||
<strong t-if="doc.planned_date_begin" >Planned for: </strong>
|
||||
<span t-field="doc.planned_date_begin"
|
||||
t-options='{"widget": "datetime"}'/>
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<strong>Technician(s):</strong>
|
||||
<t t-foreach="doc.technician_ids" t-as="technician"
|
||||
t-if="doc.technician_ids">
|
||||
<p class="m-0" t-field="technician.name"/>
|
||||
</t>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<strong>Site Contacts:</strong>
|
||||
<t t-foreach="doc.site_contacts" t-as="contact">
|
||||
<p class="m-0" t-out="contact"
|
||||
t-options='{"widget": "contact",
|
||||
"fields": ["name", "phone", "mobile", "email"],
|
||||
"no_marker": True, "phone_icons": True}'/>
|
||||
</t>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<strong>Work order attn:</strong>
|
||||
<t t-foreach="doc.work_order_contacts" t-as="contact">
|
||||
<p class="m-0" t-out="contact"/>
|
||||
</t>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</data>
|
||||
</odoo>
|
||||
45
bemade_fsm/static/src/scss/bemade_fsm.scss
Normal file
45
bemade_fsm/static/src/scss/bemade_fsm.scss
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
.border-black {
|
||||
border: 1px solid black;
|
||||
}
|
||||
|
||||
.wo-information{
|
||||
border: 1px solid black;
|
||||
.row{
|
||||
.col-auto{
|
||||
border: 1px solid black;
|
||||
}
|
||||
}
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
|
||||
.wo-intervention{
|
||||
border: 1px solid black;
|
||||
margin-bottom: 10px;
|
||||
padding-bottom: 10px;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
|
||||
.wo-parts-used{
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
|
||||
.wo-task{
|
||||
border: 1px solid black;
|
||||
margin-bottom: 10px;
|
||||
padding-bottom: 10px;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
|
||||
.border-top-black{
|
||||
border-top: 1px solid black;
|
||||
}
|
||||
|
||||
.text-left {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.manual_line_input {
|
||||
border-bottom: 1px solid black;
|
||||
margin: 30px 0px 0px 0px;
|
||||
width: 100%;
|
||||
}
|
||||
Loading…
Reference in a new issue