| 1 |
<?xml version="1.0"?> |
| 2 |
<odoo> |
| 3 |
<template id="project.milestone_deadline"> |
| 4 |
<t t-if="milestone['deadline']"> |
| 5 |
(due <t t-out="milestone['deadline']" t-options='{"widget": "date"}'/><t t-if="not milestone['is_reached'] or not milestone['reached_date']"> |
| 6 |
<t t-if="milestone['can_be_marked_as_done']"> - <font t-att-style="'color: rgb(0, ' + str(color_level) + ', 0)'">ready to be marked as reached</font></t>)</t><t t-else=""> - reached on<t t-if="milestone['reached_date'] > milestone['deadline']"> |
| 7 |
<font style="color: rgb(255, 0, 0)"><t t-out="milestone['reached_date']" t-options='{"widget": "date"}'/></font>)</t><t t-else=""> |
| 8 |
<font style="color: rgb(0, 128, 0)"><t t-out="milestone['reached_date']" t-options='{"widget": "date"}'/></font>)</t></t> |
| 9 |
</t> |
| 10 |
<t t-elif="milestone['can_be_marked_as_done']"> |
| 11 |
(<font t-att-style="'color: rgb(0, ' + str(color_level) + ', 0)'">ready to be marked as reached</font>) |
| 12 |
</t> |
| 13 |
</template> |
| 14 |
|
| 15 |
<template id="project_update_default_description" name="Project Update Description"> |
| 16 |
<!--As this template is rendered in an html field, the spaces may be interpreted as nbsp while editing. --> |
| 17 |
<div name="summary"> |
| 18 |
<br/><h1 style="font-weight: bolder;">Summary</h1> |
| 19 |
<br/><p>How’s this project going?</p><br/><br/> |
| 20 |
</div> |
| 21 |
|
| 22 |
<div name="activities" t-if="show_activities"> |
| 23 |
<h1 style="font-weight: bolder;">Activities</h1> |
| 24 |
</div> |
| 25 |
|
| 26 |
<div name="profitability" t-if="show_profitability"> |
| 27 |
<t t-if="project.account_id" name="costs"> |
| 28 |
<h3 style="font-weight: bolder"><u>Profitability</u></h3> |
| 29 |
|
| 30 |
<div name="profitability_detail" class="mt-4"> |
| 31 |
<table class="table table-striped" t-if="profitability['revenues']['data']"> |
| 32 |
<thead class="border-2 border-start-0 border-end-0"> |
| 33 |
<tr> |
| 34 |
<th class="fw-bolder" style="width: 55%">Revenues</th> |
| 35 |
<th class="fw-bolder text-end" style="width: 15%">Expected</th> |
| 36 |
<th class="fw-bolder text-end" style="width: 15%">To Invoice</th> |
| 37 |
<th class="fw-bolder text-end" style="width: 15%">Invoiced</th> |
| 38 |
</tr> |
| 39 |
</thead> |
| 40 |
<tbody> |
| 41 |
<tr t-foreach="profitability['revenues']['data']" t-as="revenue"> |
| 42 |
<tr class="revenue_data"> |
| 43 |
<td t-out="profitability['labels'][revenue['id']]"/> |
| 44 |
<td class="text-end" t-out="format_monetary(revenue['invoiced'] + revenue['to_invoice'])"/> |
| 45 |
<td class="text-end" t-out="format_monetary(revenue['to_invoice'])"/> |
| 46 |
<td class="text-end" t-out="format_monetary(revenue['invoiced'])"/> |
| 47 |
</tr> |
| 48 |
</tr> |
| 49 |
<tfoot> |
| 50 |
<td class="fw-bolder">Total Revenues</td> |
| 51 |
<td class="fw-bolder text-end" t-out="format_monetary(profitability['revenues']['total']['invoiced'] + profitability['revenues']['total']['to_invoice'])"/> |
| 52 |
<td class="fw-bolder text-end" t-out="format_monetary(profitability['revenues']['total']['to_invoice'])"/> |
| 53 |
<td class="fw-bolder text-end" t-out="format_monetary(profitability['revenues']['total']['invoiced'])"/> |
| 54 |
</tfoot> |
| 55 |
</tbody> |
| 56 |
</table> |
| 57 |
|
| 58 |
<table class="table table-striped mt-4 table-bordered" t-if="profitability['costs']['data']"> |
| 59 |
<thead> |
| 60 |
<tr> |
| 61 |
<th class="fw-bolder" style="width: 55%">Costs</th> |
| 62 |
<th class="fw-bolder text-end" style="width: 15%">Expected</th> |
| 63 |
<th class="fw-bolder text-end" style="width: 15%">To Bill</th> |
| 64 |
<th class="fw-bolder text-end" style="width: 15%">Billed</th> |
| 65 |
</tr> |
| 66 |
</thead> |
| 67 |
<tbody> |
| 68 |
<tr t-foreach="profitability['costs']['data']" t-as="cost"> |
| 69 |
<td t-out="profitability['labels'][cost['id']]"/> |
| 70 |
<td class="text-end" t-out="format_monetary(cost['billed'] + cost['to_bill'])"/> |
| 71 |
<td class="text-end" t-out="format_monetary(cost['to_bill'])"/> |
| 72 |
<td class="text-end" t-out="format_monetary(cost['billed'])"/> |
| 73 |
</tr> |
| 74 |
</tbody> |
| 75 |
<tr> |
| 76 |
<td class="fw-bolder">Total Costs</td> |
| 77 |
<td class="fw-bolder text-end" t-out="format_monetary(profitability['costs']['total']['billed'] + profitability['costs']['total']['to_bill'])"/> |
| 78 |
<td class="fw-bolder text-end" t-out="format_monetary(profitability['costs']['total']['to_bill'])"/> |
| 79 |
<td class="fw-bolder text-end" t-out="format_monetary(profitability['costs']['total']['billed'])"/> |
| 80 |
</tr> |
| 81 |
<tr t-if="profitability['costs']['data'] and profitability['revenues']['data']"> |
| 82 |
<td class="fw-bolder align-middle">Total</td> |
| 83 |
<td t-attf-class="#{'text-danger' if profitability['total']['margin'] < 0 else 'text-success'}" style="text-align: right"> |
| 84 |
<t t-out="format_monetary(profitability['total']['margin'])"/><br/> |
| 85 |
<t t-if="profitability['expected_percentage']"> |
| 86 |
<t t-out="profitability['expected_percentage']"/><t>%</t> |
| 87 |
</t> |
| 88 |
</td> |
| 89 |
<td t-attf-class="#{'text-danger' if profitability['total']['revenues'] < 0 else 'text-success'}" style="text-align: right"> |
| 90 |
<t t-out="format_monetary(profitability['total']['revenues'])"/><br/> |
| 91 |
<t t-if="profitability['to_bill_to_invoice_percentage']"> |
| 92 |
<t t-out="profitability['to_bill_to_invoice_percentage']"/><t>%</t> |
| 93 |
</t> |
| 94 |
</td> |
| 95 |
<td t-attf-class="#{'text-danger' if profitability['total']['costs'] < 0 else 'text-success'}" style="text-align: right"> |
| 96 |
<t t-out="format_monetary(profitability['total']['costs'])"/><br/> |
| 97 |
<t t-if="profitability['billed_invoiced_percentage']"> |
| 98 |
<t t-out="profitability['billed_invoiced_percentage']"/><t>%</t> |
| 99 |
</t> |
| 100 |
</td> |
| 101 |
</tr> |
| 102 |
</table> |
| 103 |
</div> |
| 104 |
</t> |
| 105 |
</div> |
| 106 |
|
| 107 |
<div name="milestone" t-if="milestones['show_section']"> |
| 108 |
<br/> |
| 109 |
<h3 style="font-weight: bolder"><u>Milestones</u></h3> |
| 110 |
|
| 111 |
<ul class="o_checklist" t-if="milestones['list']"> |
| 112 |
<t t-foreach="milestones['list']" t-as="milestone"> |
| 113 |
<li t-att-class="milestone['is_reached'] and 'o_checked'" t-attf-id="checkId-{{milestone_index}}"> |
| 114 |
<t t-out="milestone['name']"/> |
| 115 |
<span t-if="milestone['is_deadline_exceeded']"><font style="color: rgb(255, 0, 0);"><t t-call="project.milestone_deadline"/></font></span> |
| 116 |
<span t-elif="not milestone['can_be_marked_as_done']"><font style="color: rgb(190, 190, 190);"><t t-set="color_level" t-value="64"/><t t-call="project.milestone_deadline"/></font></span> |
| 117 |
<span t-else=""><t t-set="color_level" t-value="128"/><t t-call="project.milestone_deadline"/></span> |
| 118 |
</li> |
| 119 |
</t> |
| 120 |
</ul> |
| 121 |
|
| 122 |
<t t-if="milestones['updated']"> |
| 123 |
<t t-if="milestones['last_update_date']">Since <t t-out="milestones['last_update_date']" t-options='{"widget": "date"}'/> (last project update), </t> |
| 124 |
<t t-if="len(milestones['updated']) > 1">the deadline for the following milestones has been updated:</t> |
| 125 |
<t t-else="">the deadline for the following milestone has been updated:</t> |
| 126 |
<ul> |
| 127 |
<t t-foreach="milestones['updated']" t-as="milestone"> |
| 128 |
<li> |
| 129 |
<t t-out="milestone['name']"/> (<t t-out="milestone['old_value']" t-options='{"widget": "date"}'/> => <t t-out="milestone['new_value']" t-options='{"widget": "date"}'/>) |
| 130 |
</li> |
| 131 |
</t> |
| 132 |
</ul> |
| 133 |
</t> |
| 134 |
|
| 135 |
<t t-if="milestones['created']"> |
| 136 |
<t t-if="len(milestones['created']) > 1">The following milestones have been added:</t> |
| 137 |
<t t-else="">The following milestone has been added:</t> |
| 138 |
<ul> |
| 139 |
<t t-foreach="milestones['created']" t-as="milestone"> |
| 140 |
<li> |
| 141 |
<t t-out="milestone['name']"/> |
| 142 |
<span t-if="milestone['is_deadline_exceeded']"><font style="color: rgb(255, 0, 0);"><t t-call="project.milestone_deadline"/></font></span> |
| 143 |
<span t-else=""><font style="color: rgb(190, 190, 190);"><t t-set="color_level" t-value="128"/><t t-call="project.milestone_deadline"/></font></span> |
| 144 |
</li> |
| 145 |
</t> |
| 146 |
</ul> |
| 147 |
</t> |
| 148 |
</div> |
| 149 |
</template> |
| 150 |
</odoo> |