You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
3.8 KiB

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <template id="vracoop_report_saleorder_document" inherit_id="sale.report_saleorder_document">
  4. <xpath expr="//tbody[@class='sale_tbody']" position="replace">
  5. <tbody class="sale_tbody">
  6. <t t-set="current_subtotal" t-value="0"/>
  7. <t t-foreach="doc.order_line" t-as="line">
  8. <t t-if="not line.pack_parent_line_id">
  9. <t t-set="current_subtotal" t-value="current_subtotal + line.price_subtotal" groups="account.group_show_line_subtotals_tax_excluded"/>
  10. <t t-set="current_subtotal" t-value="current_subtotal + line.price_total" groups="account.group_show_line_subtotals_tax_included"/>
  11. <tr t-att-class="'bg-200 font-weight-bold o_line_section' if line.display_type == 'line_section' else 'font-italic o_line_note' if line.display_type == 'line_note' else ''">
  12. <t t-if="not line.display_type">
  13. <td><span t-field="line.name"/></td>
  14. <td class="text-right">
  15. <span t-field="line.product_uom_qty"/>
  16. <span t-field="line.product_uom" groups="uom.group_uom"/>
  17. </td>
  18. <td class="text-right">
  19. <span t-field="line.price_unit"/>
  20. </td>
  21. <td t-if="display_discount" class="text-right" groups="sale.group_discount_per_so_line">
  22. <span t-field="line.discount"/>
  23. </td>
  24. <td class="text-right">
  25. <span t-esc="', '.join(map(lambda x: (x.description or x.name), line.tax_id))"/>
  26. </td>
  27. <td class="text-right o_price_total">
  28. <span t-field="line.price_subtotal" groups="account.group_show_line_subtotals_tax_excluded"/>
  29. <span t-field="line.price_total" groups="account.group_show_line_subtotals_tax_included"/>
  30. </td>
  31. </t>
  32. <t t-if="line.display_type == 'line_section'">
  33. <td t-att-colspan="colspan">
  34. <span t-field="line.name"/>
  35. </td>
  36. <t t-set="current_section" t-value="line"/>
  37. <t t-set="current_subtotal" t-value="0"/>
  38. </t>
  39. <t t-if="line.display_type == 'line_note'">
  40. <td t-att-colspan="colspan">
  41. <span t-field="line.name"/>
  42. </td>
  43. </t>
  44. </tr>
  45. <t t-if="current_section and (line_last or doc.order_line[line_index+1].display_type == 'line_section')">
  46. <tr class="is-subtotal text-right">
  47. <td t-att-colspan="colspan">
  48. <strong class="mr16">Sous-total</strong>
  49. <span
  50. t-esc="current_subtotal"
  51. t-options='{"widget": "monetary", "display_currency": doc.pricelist_id.currency_id}'
  52. />
  53. </td>
  54. </tr>
  55. </t>
  56. </t>
  57. </t>
  58. </tbody>
  59. </xpath>
  60. </template>
  61. </odoo>