83 lines
2.8 KiB
XML
83 lines
2.8 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<template id="slot_report">
|
|
<t t-call="web.html_container">
|
|
<t t-call="web.internal_layout">
|
|
<style>
|
|
.shift-schedule {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
table-layout: fixed;
|
|
font-size: 12px;
|
|
}
|
|
.shift-schedule th,
|
|
.shift-schedule td {
|
|
border: 1px solid #ccc;
|
|
padding: 6px;
|
|
vertical-align: top;
|
|
page-break-before: always;
|
|
}
|
|
.shift-schedule th {
|
|
background-color: #f2f2f2;
|
|
text-align: center;
|
|
}
|
|
.group-by-cell {
|
|
font-weight: bold;
|
|
background-color: #f9f9f9;
|
|
width: 140px;
|
|
}
|
|
.shift-block {
|
|
display: block;
|
|
margin-bottom: 3px;
|
|
padding: 2px 4px;
|
|
border-radius: 3px;
|
|
page-break-inside: avoid;
|
|
overflow: hidden;
|
|
min-height: 40px;
|
|
}
|
|
.week-heading {
|
|
text-align: center;
|
|
font-size: 16px;
|
|
font-weight: bold;
|
|
margin-bottom: 10px;
|
|
}
|
|
</style>
|
|
<div class="page">
|
|
<t t-foreach="weeks" t-as="week">
|
|
<div style="page-break-before: always;">
|
|
<t t-if="str(week[0]) in group_by_slots_per_day_per_week">
|
|
<h3><t t-esc="week[2]"/></h3>
|
|
<table class="shift-schedule">
|
|
<tr>
|
|
<th class="group-by-cell"></th>
|
|
<t t-foreach="week[1]" t-as="day">
|
|
<th><t t-esc="day"/></th>
|
|
</t>
|
|
</tr>
|
|
<tbody>
|
|
<t t-foreach="group_by_slots_per_day_per_week[str(week[0])]" t-as="res">
|
|
<tr>
|
|
<td class="group-by-cell"><t t-esc="group_by_name_by_id[str(res[0]) if res[0] else 'false']"/></td>
|
|
<t t-foreach="week[1]" t-as="day">
|
|
<td>
|
|
<t t-set="shifts" t-value="res[1].get(day, [])"/>
|
|
<t t-foreach="shifts" t-as="shift">
|
|
<div class="shift-block" t-att-style="shift.get('style')">
|
|
<t t-esc="shift.get('title')"/>
|
|
</div>
|
|
</t>
|
|
</td>
|
|
</t>
|
|
</tr>
|
|
</t>
|
|
</tbody>
|
|
</table>
|
|
</t>
|
|
</div>
|
|
</t>
|
|
</div>
|
|
</t>
|
|
</t>
|
|
</template>
|
|
</odoo>
|