odoo-addon-ebill-postfinance 16.0.1.0.0.6__py3-none-any.whl → 18.0.1.0.0.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. odoo/addons/ebill_postfinance/README.rst +42 -29
  2. odoo/addons/ebill_postfinance/__manifest__.py +1 -1
  3. odoo/addons/ebill_postfinance/data/ir_cron.xml +0 -2
  4. odoo/addons/ebill_postfinance/data/mail_activity_type.xml +7 -7
  5. odoo/addons/ebill_postfinance/data/transmit.method.xml +1 -1
  6. odoo/addons/ebill_postfinance/i18n/ebill_postfinance.pot +3 -16
  7. odoo/addons/ebill_postfinance/messages/invoice-2003A.jinja +1 -1
  8. odoo/addons/ebill_postfinance/messages/invoice-yellowbill.jinja +2 -2
  9. odoo/addons/ebill_postfinance/models/__init__.py +1 -0
  10. odoo/addons/ebill_postfinance/models/account_move.py +14 -8
  11. odoo/addons/ebill_postfinance/models/account_move_line.py +36 -0
  12. odoo/addons/ebill_postfinance/models/ebill_payment_contract.py +6 -3
  13. odoo/addons/ebill_postfinance/models/ebill_postfinance_invoice_message.py +16 -18
  14. odoo/addons/ebill_postfinance/models/ebill_postfinance_service.py +1 -1
  15. odoo/addons/ebill_postfinance/models/sale_order.py +0 -1
  16. odoo/addons/ebill_postfinance/readme/CONFIGURE.md +15 -0
  17. odoo/addons/ebill_postfinance/readme/CONTRIBUTORS.md +2 -0
  18. odoo/addons/ebill_postfinance/readme/{DESCRIPTION.rst → DESCRIPTION.md} +2 -1
  19. odoo/addons/ebill_postfinance/readme/INSTALL.md +3 -0
  20. odoo/addons/ebill_postfinance/readme/ROADMAP.md +10 -0
  21. odoo/addons/ebill_postfinance/readme/USAGE.md +6 -0
  22. odoo/addons/ebill_postfinance/static/description/index.html +55 -35
  23. odoo/addons/ebill_postfinance/tests/__init__.py +1 -0
  24. odoo/addons/ebill_postfinance/tests/common.py +33 -8
  25. odoo/addons/ebill_postfinance/tests/{examples → samples}/credit_note_yb.xml +24 -19
  26. odoo/addons/ebill_postfinance/tests/{examples → samples}/invoice_qr_yb.xml +27 -21
  27. odoo/addons/ebill_postfinance/tests/{examples → samples}/yellowbill_qr_iban.xml +164 -163
  28. odoo/addons/ebill_postfinance/tests/test_account_move.py +57 -0
  29. odoo/addons/ebill_postfinance/tests/test_ebill_postfinance.py +8 -2
  30. odoo/addons/ebill_postfinance/tests/test_ebill_postfinance_message_yb.py +7 -11
  31. odoo/addons/ebill_postfinance/tests/test_ebill_postfinance_message_yb_creditnote.py +5 -9
  32. odoo/addons/ebill_postfinance/views/ebill_payment_contract.xml +14 -17
  33. odoo/addons/ebill_postfinance/views/ebill_postfinance_invoice_message.xml +21 -21
  34. odoo/addons/ebill_postfinance/views/ebill_postfinance_service.xml +15 -15
  35. {odoo_addon_ebill_postfinance-16.0.1.0.0.6.dist-info → odoo_addon_ebill_postfinance-18.0.1.0.0.7.dist-info}/METADATA +52 -38
  36. odoo_addon_ebill_postfinance-18.0.1.0.0.7.dist-info/RECORD +46 -0
  37. {odoo_addon_ebill_postfinance-16.0.1.0.0.6.dist-info → odoo_addon_ebill_postfinance-18.0.1.0.0.7.dist-info}/WHEEL +1 -1
  38. odoo_addon_ebill_postfinance-18.0.1.0.0.7.dist-info/top_level.txt +1 -0
  39. odoo/addons/ebill_postfinance/readme/CONFIGURE.rst +0 -13
  40. odoo/addons/ebill_postfinance/readme/CONTRIBUTORS.rst +0 -1
  41. odoo/addons/ebill_postfinance/readme/INSTALL.rst +0 -2
  42. odoo/addons/ebill_postfinance/readme/ROADMAP.rst +0 -10
  43. odoo/addons/ebill_postfinance/readme/USAGE.rst +0 -5
  44. odoo_addon_ebill_postfinance-16.0.1.0.0.6.dist-info/RECORD +0 -44
  45. odoo_addon_ebill_postfinance-16.0.1.0.0.6.dist-info/top_level.txt +0 -1
@@ -1,18 +1,18 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
1
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
2
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
3
  <head>
5
4
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
5
  <meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
7
- <title>eBill Postfinance</title>
6
+ <title>README.rst</title>
8
7
  <style type="text/css">
9
8
 
10
9
  /*
11
10
  :Author: David Goodger (goodger@python.org)
12
- :Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
11
+ :Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
13
12
  :Copyright: This stylesheet has been placed in the public domain.
14
13
 
15
14
  Default cascading style sheet for the HTML output of Docutils.
15
+ Despite the name, some widely supported CSS2 features are used.
16
16
 
17
17
  See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
18
18
  customize this style sheet.
@@ -275,7 +275,7 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code {
275
275
  margin-left: 2em ;
276
276
  margin-right: 2em }
277
277
 
278
- pre.code .ln { color: grey; } /* line numbers */
278
+ pre.code .ln { color: gray; } /* line numbers */
279
279
  pre.code, code { background-color: #eeeeee }
280
280
  pre.code .comment, code .comment { color: #5C6576 }
281
281
  pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
@@ -301,7 +301,7 @@ span.option {
301
301
  span.pre {
302
302
  white-space: pre }
303
303
 
304
- span.problematic {
304
+ span.problematic, pre.problematic {
305
305
  color: red }
306
306
 
307
307
  span.section-subtitle {
@@ -360,24 +360,32 @@ ul.auto-toc {
360
360
  </style>
361
361
  </head>
362
362
  <body>
363
- <div class="document" id="ebill-postfinance">
364
- <h1 class="title">eBill Postfinance</h1>
363
+ <div class="document">
365
364
 
365
+
366
+ <a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
367
+ <img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
368
+ </a>
369
+ <div class="section" id="ebill-postfinance">
370
+ <h1>eBill Postfinance</h1>
366
371
  <!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
367
372
  !! This file is generated by oca-gen-addon-readme !!
368
373
  !! changes will be overwritten. !!
369
374
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370
- !! source digest: sha256:8fe54c201370aabd37f966becd9bc102925267307e434f56a4c558a943f058ed
375
+ !! source digest: sha256:70553006c73d13f974e48d52641436b9d6be23fb09a43c219b113be254f6e9d1
371
376
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372
- <p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/l10n-switzerland/tree/16.0/ebill_postfinance"><img alt="OCA/l10n-switzerland" src="https://img.shields.io/badge/github-OCA%2Fl10n--switzerland-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/l10n-switzerland-16-0/l10n-switzerland-16-0-ebill_postfinance"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/l10n-switzerland&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373
- <p>This module implements the exchange of electronic invoices with the Postfinance web service.</p>
377
+ <p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/l10n-switzerland/tree/18.0/ebill_postfinance"><img alt="OCA/l10n-switzerland" src="https://img.shields.io/badge/github-OCA%2Fl10n--switzerland-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/l10n-switzerland-18-0/l10n-switzerland-18-0-ebill_postfinance"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/l10n-switzerland&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
378
+ <p>This module implements the exchange of electronic invoices with the
379
+ Postfinance web service.</p>
374
380
  <p><strong>Table of contents</strong></p>
375
381
  <div class="contents local topic" id="contents">
376
382
  <ul class="simple">
377
383
  <li><a class="reference internal" href="#installation" id="toc-entry-1">Installation</a></li>
378
- <li><a class="reference internal" href="#configuration" id="toc-entry-2">Configuration</a></li>
384
+ <li><a class="reference internal" href="#configuration" id="toc-entry-2">Configuration</a><ul>
379
385
  <li><a class="reference internal" href="#create-a-service" id="toc-entry-3">Create a service</a></li>
380
386
  <li><a class="reference internal" href="#configure-a-customer-and-create-his-contract" id="toc-entry-4">Configure a customer and create his contract</a></li>
387
+ </ul>
388
+ </li>
381
389
  <li><a class="reference internal" href="#usage" id="toc-entry-5">Usage</a></li>
382
390
  <li><a class="reference internal" href="#known-issues-roadmap" id="toc-entry-6">Known issues / Roadmap</a></li>
383
391
  <li><a class="reference internal" href="#bug-tracker" id="toc-entry-7">Bug Tracker</a></li>
@@ -390,39 +398,47 @@ ul.auto-toc {
390
398
  </ul>
391
399
  </div>
392
400
  <div class="section" id="installation">
393
- <h1><a class="toc-backref" href="#toc-entry-1">Installation</a></h1>
394
- <p>This module needs the Python library <cite>ebilling_postfiance</cite> which can be installed from Pypi.
395
- More information can be found at <a class="reference external" href="repositoryhttps://github.com/camptocamp/ebilling-postfinance">repositoryhttps://github.com/camptocamp/ebilling-postfinance</a>.</p>
401
+ <h2><a class="toc-backref" href="#toc-entry-1">Installation</a></h2>
402
+ <p>This module needs the Python library ebilling_postfinance which can be
403
+ installed from Pypi. More information can be found at
404
+ <a class="reference external" href="repository%20https://github.com/camptocamp/ebilling-postfinance">repository</a>
405
+ <a class="reference external" href="https://github.com/camptocamp/ebilling-postfinance">https://github.com/camptocamp/ebilling-postfinance</a>.</p>
396
406
  </div>
397
407
  <div class="section" id="configuration">
398
- <h1><a class="toc-backref" href="#toc-entry-2">Configuration</a></h1>
399
- </div>
408
+ <h2><a class="toc-backref" href="#toc-entry-2">Configuration</a></h2>
400
409
  <div class="section" id="create-a-service">
401
- <h1><a class="toc-backref" href="#toc-entry-3">Create a service</a></h1>
402
- <p>First you need to be registred on ‘Postfinance eBill service &lt;<a class="reference external" href="https://www.postfinance.ch/en/business/products/accounts-receivable-solutions/e-bill-invoice-issuer.html">https://www.postfinance.ch/en/business/products/accounts-receivable-solutions/e-bill-invoice-issuer.html</a>&gt;’
403
- To create a service go to <cite>Accounting - Configuration - Payments - Postfinance eBill Service</cite></p>
410
+ <h3><a class="toc-backref" href="#toc-entry-3">Create a service</a></h3>
411
+ <p>First you need to be registred on ‘Postfinance eBill service
412
+ &lt;<a class="reference external" href="https://www.postfinance.ch/en/business/products/accounts-receivable-solutions/e-bill-invoice-issuer.html">https://www.postfinance.ch/en/business/products/accounts-receivable-solutions/e-bill-invoice-issuer.html</a>&gt;’
413
+ To create a service go to Accounting - Configuration - Payments -
414
+ Postfinance eBill Service</p>
404
415
  </div>
405
416
  <div class="section" id="configure-a-customer-and-create-his-contract">
406
- <h1><a class="toc-backref" href="#toc-entry-4">Configure a customer and create his contract</a></h1>
407
- <p>The contracts specific to Postfinance e-billing are located in <cite>Accounting - Customers - eBill Postfinance Contract</cite>
408
- Create a contract for a customer with his PayerId and make sure that the contract is active by being in <cite>Open</cite> state with valid start/end dates.</p>
409
- <p>Set <cite>Customer Invoice Transmission Method</cite> on the customer to Postfinance.</p>
417
+ <h3><a class="toc-backref" href="#toc-entry-4">Configure a customer and create his contract</a></h3>
418
+ <p>The contracts specific to Postfinance e-billing are located in
419
+ Accounting - Customers - eBill Postfinance Contract Create a contract
420
+ for a customer with his PayerId and make sure that the contract is
421
+ active by being in Open state with valid start/end dates.</p>
422
+ <p>Set Customer Invoice Transmission Method on the customer to Postfinance.</p>
423
+ </div>
410
424
  </div>
411
425
  <div class="section" id="usage">
412
- <h1><a class="toc-backref" href="#toc-entry-5">Usage</a></h1>
426
+ <h2><a class="toc-backref" href="#toc-entry-5">Usage</a></h2>
413
427
  <p>To use this module, you need to:</p>
414
428
  <ol class="arabic simple">
415
- <li>Configure the service, customers and contracts as described in the CONFIGURATION section.</li>
429
+ <li>Configure the service, customers and contracts as described in the
430
+ CONFIGURATION section.</li>
416
431
  <li>Create an invoice for a customer with an open Postfinance contract.</li>
417
432
  <li>Validate the invoice, and click the Send eBill button.</li>
418
433
  </ol>
419
434
  </div>
420
435
  <div class="section" id="known-issues-roadmap">
421
- <h1><a class="toc-backref" href="#toc-entry-6">Known issues / Roadmap</a></h1>
436
+ <h2><a class="toc-backref" href="#toc-entry-6">Known issues / Roadmap</a></h2>
422
437
  <p>ToDo</p>
423
438
  <ul class="simple">
424
439
  <li>Add option to import the contract subscription (csv)</li>
425
- <li>Add the download of this csv from web service, but what is the endpoint ?</li>
440
+ <li>Add the download of this csv from web service, but what is the
441
+ endpoint ?</li>
426
442
  </ul>
427
443
  <p>Nice to have</p>
428
444
  <ul class="simple">
@@ -431,40 +447,44 @@ Create a contract for a customer with his PayerId and make sure that the contrac
431
447
  </ul>
432
448
  </div>
433
449
  <div class="section" id="bug-tracker">
434
- <h1><a class="toc-backref" href="#toc-entry-7">Bug Tracker</a></h1>
450
+ <h2><a class="toc-backref" href="#toc-entry-7">Bug Tracker</a></h2>
435
451
  <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/l10n-switzerland/issues">GitHub Issues</a>.
436
452
  In case of trouble, please check there if your issue has already been reported.
437
453
  If you spotted it first, help us to smash it by providing a detailed and welcomed
438
- <a class="reference external" href="https://github.com/OCA/l10n-switzerland/issues/new?body=module:%20ebill_postfinance%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
454
+ <a class="reference external" href="https://github.com/OCA/l10n-switzerland/issues/new?body=module:%20ebill_postfinance%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
439
455
  <p>Do not contact contributors directly about support or help with technical issues.</p>
440
456
  </div>
441
457
  <div class="section" id="credits">
442
- <h1><a class="toc-backref" href="#toc-entry-8">Credits</a></h1>
458
+ <h2><a class="toc-backref" href="#toc-entry-8">Credits</a></h2>
443
459
  <div class="section" id="authors">
444
- <h2><a class="toc-backref" href="#toc-entry-9">Authors</a></h2>
460
+ <h3><a class="toc-backref" href="#toc-entry-9">Authors</a></h3>
445
461
  <ul class="simple">
446
462
  <li>Camptocamp</li>
447
463
  </ul>
448
464
  </div>
449
465
  <div class="section" id="contributors">
450
- <h2><a class="toc-backref" href="#toc-entry-10">Contributors</a></h2>
466
+ <h3><a class="toc-backref" href="#toc-entry-10">Contributors</a></h3>
451
467
  <ul class="simple">
452
468
  <li>Thierry Ducrest &lt;<a class="reference external" href="mailto:thierry.ducrest&#64;camptocamp.com">thierry.ducrest&#64;camptocamp.com</a>&gt;</li>
469
+ <li>Simone Orsi &lt;<a class="reference external" href="mailto:simone.orsi&#64;camptocamp.com">simone.orsi&#64;camptocamp.com</a>&gt;</li>
453
470
  </ul>
454
471
  </div>
455
472
  <div class="section" id="maintainers">
456
- <h2><a class="toc-backref" href="#toc-entry-11">Maintainers</a></h2>
473
+ <h3><a class="toc-backref" href="#toc-entry-11">Maintainers</a></h3>
457
474
  <p>This module is maintained by the OCA.</p>
458
- <a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
475
+ <a class="reference external image-reference" href="https://odoo-community.org">
476
+ <img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
477
+ </a>
459
478
  <p>OCA, or the Odoo Community Association, is a nonprofit organization whose
460
479
  mission is to support the collaborative development of Odoo features and
461
480
  promote its widespread use.</p>
462
481
  <p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
463
482
  <p><a class="reference external image-reference" href="https://github.com/TDu"><img alt="TDu" src="https://github.com/TDu.png?size=40px" /></a></p>
464
- <p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-switzerland/tree/16.0/ebill_postfinance">OCA/l10n-switzerland</a> project on GitHub.</p>
483
+ <p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-switzerland/tree/18.0/ebill_postfinance">OCA/l10n-switzerland</a> project on GitHub.</p>
465
484
  <p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
466
485
  </div>
467
486
  </div>
468
487
  </div>
488
+ </div>
469
489
  </body>
470
490
  </html>
@@ -1,3 +1,4 @@
1
1
  from . import test_ebill_postfinance
2
2
  from . import test_ebill_postfinance_message_yb
3
3
  from . import test_ebill_postfinance_message_yb_creditnote
4
+ from . import test_account_move
@@ -5,6 +5,8 @@ import logging
5
5
  import os
6
6
  from os.path import dirname, join
7
7
 
8
+ import requests
9
+ from lxml import etree
8
10
  from vcr import VCR
9
11
  from xmlunittest import XmlTestMixin
10
12
 
@@ -16,8 +18,15 @@ _logger = logging.getLogger(__name__)
16
18
  class CommonCase(TransactionCase, XmlTestMixin):
17
19
  @classmethod
18
20
  def setUpClass(cls):
21
+ cls._super_send = requests.Session.send
19
22
  super().setUpClass()
20
23
  cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))
24
+ cls.setUpBasicData()
25
+ cls.setUpSaleData()
26
+ cls.setUpInvoiceData()
27
+
28
+ @classmethod
29
+ def setUpBasicData(cls):
21
30
  cls.service = cls.env["ebill.postfinance.service"].create(
22
31
  {
23
32
  "name": "Postfinance Test Service",
@@ -28,7 +37,7 @@ class CommonCase(TransactionCase, XmlTestMixin):
28
37
  }
29
38
  )
30
39
  cls.country = cls.env.ref("base.ch")
31
- cls.company = cls.env.ref("l10n_ch.demo_company_ch")
40
+ cls.company = cls.env.ref("base.demo_company_ch")
32
41
  cls.env.user.company_id = cls.company
33
42
  cls.company.vat = "CHE-012.345.678"
34
43
  cls.company.name = "Camptocamp SA"
@@ -41,7 +50,7 @@ class CommonCase(TransactionCase, XmlTestMixin):
41
50
  cls.company.phone = ""
42
51
  cls.bank = cls.env.ref("base.res_bank_1")
43
52
  cls.bank.bic = 777
44
- cls.tax7 = cls.env.ref("l10n_ch.{}_vat_77".format(cls.company.id))
53
+ cls.tax7 = cls.env.ref(f"account.{cls.company.id}_vat_77")
45
54
  cls.partner_bank = cls.env["res.partner.bank"].create(
46
55
  {
47
56
  "bank_id": cls.bank.id,
@@ -51,7 +60,7 @@ class CommonCase(TransactionCase, XmlTestMixin):
51
60
  "l10n_ch_qr_iban": "CH2130808001234567827",
52
61
  }
53
62
  )
54
- cls.terms = cls.env.ref("account.account_payment_term_15days")
63
+ cls.payment_term = cls.env.ref("account.account_payment_term_advance_60days")
55
64
  cls.state = cls.env["res.country.state"].create(
56
65
  {"code": "RR", "name": "Fribourg", "country_id": cls.country.id}
57
66
  )
@@ -90,6 +99,9 @@ class CommonCase(TransactionCase, XmlTestMixin):
90
99
  [("account_type", "=", "asset_receivable")],
91
100
  limit=1,
92
101
  )
102
+
103
+ @classmethod
104
+ def setUpSaleData(cls):
93
105
  cls.product = cls.env["product.product"].create(
94
106
  {"name": "Product Q & A", "list_price": 100.00, "default_code": "370003021"}
95
107
  )
@@ -136,6 +148,9 @@ class CommonCase(TransactionCase, XmlTestMixin):
136
148
  )
137
149
  cls.sale.action_confirm()
138
150
  cls.sale.date_order = "2019-06-01"
151
+
152
+ @classmethod
153
+ def setUpInvoiceData(cls):
139
154
  # Generate the invoice from the sale order
140
155
  cls.invoice = cls.sale._create_invoices()
141
156
  # And add some more lines on the invoice
@@ -161,6 +176,11 @@ class CommonCase(TransactionCase, XmlTestMixin):
161
176
  cls.invoice.payment_reference = "210000000003139471430009017"
162
177
  cls.invoice.partner_bank_id = cls.partner_bank.id
163
178
 
179
+ @classmethod
180
+ def _request_handler(cls, s, r, /, **kw):
181
+ """Don't block external requests."""
182
+ return cls._super_send(s, r, **kw)
183
+
164
184
  @staticmethod
165
185
  def compare_xml_line_by_line(content, expected):
166
186
  """This a quick way to check the diff line by line to ease debugging"""
@@ -169,11 +189,12 @@ class CommonCase(TransactionCase, XmlTestMixin):
169
189
  number_of_lines = len(expected_line)
170
190
  for i in range(number_of_lines):
171
191
  if generated_line[i].strip() != expected_line[i].strip():
172
- return "Diff at {}/{} || Expected {} || Generated {}".format(
173
- i,
174
- number_of_lines,
175
- expected_line[i],
176
- generated_line[i],
192
+ return " || ".join(
193
+ [
194
+ f"Diff at {i}/{number_of_lines}",
195
+ f"Expected {expected_line[i]}",
196
+ f"Generated {generated_line[i]}",
197
+ ]
177
198
  )
178
199
 
179
200
 
@@ -192,3 +213,7 @@ def get_recorder(base_path=None, **kw):
192
213
 
193
214
 
194
215
  recorder = get_recorder()
216
+
217
+
218
+ def clean_xml(txt):
219
+ return etree.canonicalize(txt.decode(), strip_text=True).encode()
@@ -1,5 +1,9 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" type="string">
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <Envelope
3
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
4
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5
+ type="string"
6
+ >
3
7
  <Header>
4
8
  <From>Camptocamp SA</From>
5
9
  <To>IPECeBILLServer</To>
@@ -17,7 +21,7 @@
17
21
  <DeliveryDate>2019-06-21</DeliveryDate>
18
22
  <TransactionID>$TRANSACTION_ID</TransactionID>
19
23
  <BillDetailsType>PDFAppendix</BillDetailsType>
20
- <URLBillDetails/>
24
+ <URLBillDetails />
21
25
  </DeliveryInfo>
22
26
  <Bill>
23
27
  <Header>
@@ -44,7 +48,8 @@
44
48
  <Address>
45
49
  <CompanyName>Test RAD Customer XML</CompanyName>
46
50
  <Address1>Teststrasse 100</Address1>
47
- <Address2>This is a very long street name that should be sna</Address2>
51
+ <Address2
52
+ >This is a very long street name that should be sna</Address2>
48
53
  <ZIP>1700</ZIP>
49
54
  <City>Fribourg</City>
50
55
  <Country>CH</Country>
@@ -54,11 +59,11 @@
54
59
  </ReceiverParty>
55
60
  <DeliveryPlace>
56
61
  <Address>
57
- <CompanyName>Test RAD Customer XML</CompanyName>
58
- <ZIP>1700</ZIP>
59
- <City>Fribourg</City>
60
- <Country>CH</Country>
61
- <!-- <Contact1>0000000001</Contact1> -->
62
+ <CompanyName>Test RAD Customer XML</CompanyName>
63
+ <ZIP>1700</ZIP>
64
+ <City>Fribourg</City>
65
+ <Country>CH</Country>
66
+ <!-- <Contact1>0000000001</Contact1> -->
62
67
  </Address>
63
68
  </DeliveryPlace>
64
69
  <AchievementDate>
@@ -67,12 +72,12 @@
67
72
  </AchievementDate>
68
73
  <Currency>CHF</Currency>
69
74
  <AccountAssignment>
70
- <OrderReference>
71
- <ReferencePosition>1</ReferencePosition>
72
- <ReferenceType>OrderReference</ReferenceType>
73
- <ReferenceValue>CustomerRef</ReferenceValue>
74
- </OrderReference>
75
- <OrderDate>2019-06-01</OrderDate>
75
+ <OrderReference>
76
+ <ReferencePosition>1</ReferencePosition>
77
+ <ReferenceType>OrderReference</ReferenceType>
78
+ <ReferenceValue>CustomerRef</ReferenceValue>
79
+ </OrderReference>
80
+ <OrderDate>2019-06-01</OrderDate>
76
81
  </AccountAssignment>
77
82
  <Language>en</Language>
78
83
  <PaymentInformation>
@@ -116,7 +121,8 @@
116
121
  <LineItem>
117
122
  <LineItemType>NORMAL</LineItemType>
118
123
  <LineItemID>2</LineItemID>
119
- <ProductDescription>Product With a Very Long Name That Need To Be Truncated</ProductDescription>
124
+ <ProductDescription
125
+ >Product With a Very Long Name That Need To Be Truncated</ProductDescription>
120
126
  <ProductID>370003022</ProductID>
121
127
  <Quantity>1.0</Quantity>
122
128
  <QuantityDescription>Units</QuantityDescription>
@@ -169,8 +175,7 @@
169
175
  <!-- <TotalAmountPaid>200.00</TotalAmountPaid> -->
170
176
  <TotalAmountDue>-529.88</TotalAmountDue>
171
177
  </Summary>
172
- </Bill>
173
- <Appendix>
174
- </Appendix>
178
+ </Bill>
179
+ <Appendix />
175
180
  </Body>
176
181
  </Envelope>
@@ -1,5 +1,9 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" type="string">
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <Envelope
3
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
4
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5
+ type="string"
6
+ >
3
7
  <Header>
4
8
  <From>Camptocamp SA</From>
5
9
  <To>IPECeBILLServer</To>
@@ -17,7 +21,7 @@
17
21
  <DeliveryDate>2019-06-21</DeliveryDate>
18
22
  <TransactionID>$TRANSACTION_ID</TransactionID>
19
23
  <BillDetailsType>PDFAppendix</BillDetailsType>
20
- <URLBillDetails/>
24
+ <URLBillDetails />
21
25
  </DeliveryInfo>
22
26
  <Bill>
23
27
  <Header>
@@ -44,7 +48,8 @@
44
48
  <Address>
45
49
  <CompanyName>Test RAD Customer XML</CompanyName>
46
50
  <Address1>Teststrasse 100</Address1>
47
- <Address2>This is a very long street name that should be sna</Address2>
51
+ <Address2
52
+ >This is a very long street name that should be sna</Address2>
48
53
  <ZIP>1700</ZIP>
49
54
  <City>Fribourg</City>
50
55
  <Country>CH</Country>
@@ -54,11 +59,11 @@
54
59
  </ReceiverParty>
55
60
  <DeliveryPlace>
56
61
  <Address>
57
- <CompanyName>Test RAD Customer XML</CompanyName>
58
- <ZIP>1700</ZIP>
59
- <City>Fribourg</City>
60
- <Country>CH</Country>
61
- <!-- <Contact1>0000000001</Contact1> -->
62
+ <CompanyName>Test RAD Customer XML</CompanyName>
63
+ <ZIP>1700</ZIP>
64
+ <City>Fribourg</City>
65
+ <Country>CH</Country>
66
+ <!-- <Contact1>0000000001</Contact1> -->
62
67
  </Address>
63
68
  </DeliveryPlace>
64
69
  <AchievementDate>
@@ -67,23 +72,24 @@
67
72
  </AchievementDate>
68
73
  <Currency>CHF</Currency>
69
74
  <AccountAssignment>
70
- <OrderReference>
71
- <ReferencePosition>1</ReferencePosition>
72
- <ReferenceType>OrderReference</ReferenceType>
73
- <ReferenceValue>CustomerRef</ReferenceValue>
74
- </OrderReference>
75
- <OrderDate>2019-06-01</OrderDate>
75
+ <OrderReference>
76
+ <ReferencePosition>1</ReferencePosition>
77
+ <ReferenceType>OrderReference</ReferenceType>
78
+ <ReferenceValue>CustomerRef</ReferenceValue>
79
+ </OrderReference>
80
+ <OrderDate>2019-06-01</OrderDate>
76
81
  </AccountAssignment>
77
82
  <Language>en</Language>
78
83
  <PaymentInformation>
79
- <PaymentDueDate>2019-07-01</PaymentDueDate>
84
+ <PaymentDueDate>2019-08-20</PaymentDueDate>
80
85
  <PaymentType>IBAN</PaymentType>
81
86
  <fixAmount>Yes</fixAmount>
82
87
  <IBAN>
83
88
  <BIC>777</BIC>
84
89
  <BankName>Reserve</BankName>
85
90
  <IBAN>CH2130808001234567827</IBAN>
86
- <CreditorReference>210000000003139471430009017</CreditorReference>
91
+ <CreditorReference
92
+ >210000000003139471430009017</CreditorReference>
87
93
  </IBAN>
88
94
  </PaymentInformation>
89
95
  <!-- <FreeText>Dies ist eine Musterrechnung mit QR-IBAN Angaben</FreeText> -->
@@ -122,7 +128,8 @@
122
128
  <LineItem>
123
129
  <LineItemType>NORMAL</LineItemType>
124
130
  <LineItemID>2</LineItemID>
125
- <ProductDescription>Product With a Very Long Name That Need To Be Truncated</ProductDescription>
131
+ <ProductDescription
132
+ >Product With a Very Long Name That Need To Be Truncated</ProductDescription>
126
133
  <ProductID>370003022</ProductID>
127
134
  <Quantity>1.0</Quantity>
128
135
  <QuantityDescription>Units</QuantityDescription>
@@ -175,8 +182,7 @@
175
182
  <!-- <TotalAmountPaid>200.00</TotalAmountPaid> -->
176
183
  <TotalAmountDue>529.88</TotalAmountDue>
177
184
  </Summary>
178
- </Bill>
179
- <Appendix>
180
- </Appendix>
185
+ </Bill>
186
+ <Appendix />
181
187
  </Body>
182
188
  </Envelope>