project_update_templates.xml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?xml version="1.0"?>
  2. <odoo>
  3. <template id="project_update_default_description" inherit_id="project.project_update_default_description">
  4. <!--As this template is rendered in an html field, the spaces may be interpreted as nbsp while editing. -->
  5. <xpath expr="//div[@name='milestone']" position="before">
  6. <br/>
  7. <div t-if="show_sold">
  8. <h3 style="font-weight: bolder"><u>Sold</u></h3>
  9. <table class="table table-bordered table-striped">
  10. <tbody>
  11. <thead>
  12. <td style="font-weight: bolder">Service</td>
  13. <td style="font-weight: bolder">Sold</td>
  14. <td style="font-weight: bolder">Effective</td>
  15. <td style="font-weight: bolder">Remaining</td>
  16. </thead>
  17. <tr t-foreach="services['data']" t-as="service">
  18. <t t-set="is_unit" t-value="service['is_unit']"/>
  19. <td t-attf-class="#{ 'fst-italic' if is_unit else ''}"><t t-esc="service['name']"/></td>
  20. <td t-attf-class="#{ 'fst-italic' if is_unit else ''}" style="text-align: right; vertical-align: middle;"><t t-esc="format_value(service['sold_value'], service['is_hour'])"/> <t t-esc="service['unit']"/></td>
  21. <td t-attf-class="#{ 'fst-italic' if is_unit else ''}" style="text-align: right; vertical-align: middle;"><t t-esc="format_value(service['effective_value'], service['is_hour'])"/> <t t-esc="service['unit']"/></td>
  22. <td t-attf-class="#{ 'fst-italic' if is_unit else ''}" style="text-align: right; vertical-align: middle;"><t t-esc="format_value(service['remaining_value'], service['is_hour'])"/> <t t-esc="service['unit']"/></td>
  23. </tr>
  24. <tfoot>
  25. <td style="font-weight: bolder; text-align: right">Total</td>
  26. <td style="font-weight: bolder; text-align: right; vertical-align: middle;"><t t-esc="format_value(services['total_sold'], services['is_hour'])"/> <t t-esc="services['company_unit_name']"/></td>
  27. <td style="font-weight: bolder; text-align: right; vertical-align: middle;"><t t-esc="format_value(services['total_effective'], services['is_hour'])"/> <t t-esc="services['company_unit_name']"/></td>
  28. <td style="font-weight: bolder; text-align: right; vertical-align: middle;"><t t-esc="format_value(services['total_remaining'], services['is_hour'])"/> <t t-esc="services['company_unit_name']"/></td>
  29. </tfoot>
  30. </tbody>
  31. </table>
  32. <br/>
  33. </div>
  34. <div name="profitability" t-if="show_profitability">
  35. <t t-if="project.analytic_account_id and project.allow_billable and user.has_group('project.group_project_manager')" name="costs">
  36. <h3 style="font-weight: bolder"><u>Profitability</u></h3>
  37. The cost of the project is now at <t t-esc="profitability['costs_formatted']"/>, for a revenue of <t t-esc="profitability['revenues_formatted']"/>, leading to a
  38. <span>
  39. <font t-if="profitability['margin'] &gt; 0" style="color: rgb(0, 128, 0)">
  40. <b><t t-esc="profitability['margin_formatted']"/></b>
  41. </font>
  42. <font t-elif="profitability['margin'] &lt; 0" style="color: rgb(128, 0, 0)">
  43. <b><t t-esc="profitability['margin_formatted']"/></b>
  44. </font>
  45. <t t-else="" t-esc="profitability['margin_formatted']"/>
  46. </span> margin (<t t-esc="profitability['margin_percentage']"/>%).
  47. </t>
  48. </div>
  49. </xpath>
  50. </template>
  51. </odoo>