ubl_21_templates.xml 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <template id="ubl_21_InvoiceLineType" inherit_id="account_edi_ubl_cii.ubl_20_InvoiceLineType" primary="True">
  4. <xpath expr="//*[local-name()='Item']" position="before">
  5. <t t-if="invoice.move_type == 'out_refund'">
  6. <!-- AllowanceCharge and TaxTotal are swapped in the CreditLine
  7. w.r.t InvoiceLine. see: http://www.datypic.com/sc/ubl21/e-cac_InvoiceLine.html
  8. vs http://www.datypic.com/sc/ubl21/e-cac_CreditNoteLine.html-->
  9. <t t-foreach="vals.get('allowance_charge_vals', [])" t-as="foreach_vals">
  10. <cac:AllowanceCharge
  11. xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
  12. xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
  13. xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
  14. <t t-call="{{AllowanceChargeType_template}}">
  15. <t t-set="vals" t-value="foreach_vals"/>
  16. </t>
  17. </cac:AllowanceCharge>
  18. </t>
  19. </t>
  20. </xpath>
  21. </template>
  22. <template id="ubl_21_InvoiceType" inherit_id="account_edi_ubl_cii.ubl_20_InvoiceType" primary="True">
  23. <xpath expr="//*[local-name()='IssueDate']" position="after">
  24. <cbc:DueDate
  25. xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
  26. xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
  27. xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
  28. t-if="invoice.move_type == 'out_invoice'"
  29. t-out="vals.get('due_date')"/>
  30. <cbc:CreditNoteTypeCode
  31. xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
  32. xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
  33. xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
  34. t-if="invoice.move_type == 'out_refund'"
  35. t-att="vals.get('invoice_type_code_attrs', {})"
  36. t-out="vals.get('credit_note_type_code')"
  37. />
  38. </xpath>
  39. <xpath expr="//*[local-name()='DocumentCurrencyCode']" position="after">
  40. <cbc:BuyerReference
  41. xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
  42. xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
  43. xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
  44. t-out="vals.get('buyer_reference')"/>
  45. </xpath>
  46. <xpath expr="//*[@id='delivery_foreach']" position="after">
  47. <t t-if="invoice.move_type == 'out_refund'">
  48. <t t-foreach="vals.get('payment_means_vals_list', [])" t-as="foreach_vals">
  49. <cac:PaymentMeans
  50. xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
  51. xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
  52. xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
  53. <t t-call="{{PaymentMeansType_template}}">
  54. <t t-set="vals" t-value="foreach_vals"/>
  55. </t>
  56. </cac:PaymentMeans>
  57. </t>
  58. </t>
  59. </xpath>
  60. </template>
  61. </odoo>