odoo-addon-ebill-postfinance 17.0.1.0.0.3__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.
- odoo/addons/ebill_postfinance/README.rst +13 -8
- odoo/addons/ebill_postfinance/__manifest__.py +1 -1
- odoo/addons/ebill_postfinance/data/ir_cron.xml +0 -2
- odoo/addons/ebill_postfinance/data/mail_activity_type.xml +7 -7
- odoo/addons/ebill_postfinance/data/transmit.method.xml +1 -1
- odoo/addons/ebill_postfinance/i18n/ebill_postfinance.pot +6 -7
- odoo/addons/ebill_postfinance/messages/invoice-2003A.jinja +1 -1
- odoo/addons/ebill_postfinance/messages/invoice-yellowbill.jinja +2 -2
- odoo/addons/ebill_postfinance/models/__init__.py +1 -0
- odoo/addons/ebill_postfinance/models/account_move.py +13 -6
- odoo/addons/ebill_postfinance/models/account_move_line.py +36 -0
- odoo/addons/ebill_postfinance/models/ebill_payment_contract.py +3 -1
- odoo/addons/ebill_postfinance/models/ebill_postfinance_invoice_message.py +10 -8
- odoo/addons/ebill_postfinance/readme/CONTRIBUTORS.md +1 -0
- odoo/addons/ebill_postfinance/readme/INSTALL.md +1 -1
- odoo/addons/ebill_postfinance/static/description/index.html +26 -19
- odoo/addons/ebill_postfinance/tests/__init__.py +1 -0
- odoo/addons/ebill_postfinance/tests/common.py +24 -6
- odoo/addons/ebill_postfinance/tests/{examples → samples}/credit_note_yb.xml +24 -19
- odoo/addons/ebill_postfinance/tests/{examples → samples}/invoice_qr_yb.xml +26 -20
- odoo/addons/ebill_postfinance/tests/{examples → samples}/yellowbill_qr_iban.xml +164 -163
- odoo/addons/ebill_postfinance/tests/test_account_move.py +57 -0
- odoo/addons/ebill_postfinance/tests/test_ebill_postfinance.py +8 -1
- odoo/addons/ebill_postfinance/tests/test_ebill_postfinance_message_yb.py +6 -10
- odoo/addons/ebill_postfinance/tests/test_ebill_postfinance_message_yb_creditnote.py +5 -9
- odoo/addons/ebill_postfinance/views/ebill_payment_contract.xml +12 -15
- odoo/addons/ebill_postfinance/views/ebill_postfinance_invoice_message.xml +21 -21
- odoo/addons/ebill_postfinance/views/ebill_postfinance_service.xml +14 -14
- {odoo_addon_ebill_postfinance-17.0.1.0.0.3.dist-info → odoo_addon_ebill_postfinance-18.0.1.0.0.7.dist-info}/METADATA +19 -13
- odoo_addon_ebill_postfinance-18.0.1.0.0.7.dist-info/RECORD +46 -0
- {odoo_addon_ebill_postfinance-17.0.1.0.0.3.dist-info → odoo_addon_ebill_postfinance-18.0.1.0.0.7.dist-info}/WHEEL +1 -1
- odoo_addon_ebill_postfinance-17.0.1.0.0.3.dist-info/RECORD +0 -44
- {odoo_addon_ebill_postfinance-17.0.1.0.0.3.dist-info → odoo_addon_ebill_postfinance-18.0.1.0.0.7.dist-info}/top_level.txt +0 -0
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
.. image:: https://odoo-community.org/readme-banner-image
|
|
2
|
+
:target: https://odoo-community.org/get-involved?utm_source=readme
|
|
3
|
+
:alt: Odoo Community Association
|
|
4
|
+
|
|
1
5
|
=================
|
|
2
6
|
eBill Postfinance
|
|
3
7
|
=================
|
|
@@ -7,23 +11,23 @@ eBill Postfinance
|
|
|
7
11
|
!! This file is generated by oca-gen-addon-readme !!
|
|
8
12
|
!! changes will be overwritten. !!
|
|
9
13
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
10
|
-
!! source digest: sha256:
|
|
14
|
+
!! source digest: sha256:70553006c73d13f974e48d52641436b9d6be23fb09a43c219b113be254f6e9d1
|
|
11
15
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
12
16
|
|
|
13
17
|
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
|
14
18
|
:target: https://odoo-community.org/page/development-status
|
|
15
19
|
:alt: Beta
|
|
16
|
-
.. |badge2| image:: https://img.shields.io/badge/
|
|
20
|
+
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
|
|
17
21
|
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
|
18
22
|
:alt: License: AGPL-3
|
|
19
23
|
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--switzerland-lightgray.png?logo=github
|
|
20
|
-
:target: https://github.com/OCA/l10n-switzerland/tree/
|
|
24
|
+
:target: https://github.com/OCA/l10n-switzerland/tree/18.0/ebill_postfinance
|
|
21
25
|
:alt: OCA/l10n-switzerland
|
|
22
26
|
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
|
23
|
-
:target: https://translation.odoo-community.org/projects/l10n-switzerland-
|
|
27
|
+
:target: https://translation.odoo-community.org/projects/l10n-switzerland-18-0/l10n-switzerland-18-0-ebill_postfinance
|
|
24
28
|
:alt: Translate me on Weblate
|
|
25
29
|
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
|
|
26
|
-
:target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-switzerland&target_branch=
|
|
30
|
+
:target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-switzerland&target_branch=18.0
|
|
27
31
|
:alt: Try me on Runboat
|
|
28
32
|
|
|
29
33
|
|badge1| |badge2| |badge3| |badge4| |badge5|
|
|
@@ -39,7 +43,7 @@ Postfinance web service.
|
|
|
39
43
|
Installation
|
|
40
44
|
============
|
|
41
45
|
|
|
42
|
-
This module needs the Python library
|
|
46
|
+
This module needs the Python library ebilling_postfinance which can be
|
|
43
47
|
installed from Pypi. More information can be found at
|
|
44
48
|
`repository <repository%20https://github.com/camptocamp/ebilling-postfinance>`__
|
|
45
49
|
https://github.com/camptocamp/ebilling-postfinance.
|
|
@@ -95,7 +99,7 @@ Bug Tracker
|
|
|
95
99
|
Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-switzerland/issues>`_.
|
|
96
100
|
In case of trouble, please check there if your issue has already been reported.
|
|
97
101
|
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
|
98
|
-
`feedback <https://github.com/OCA/l10n-switzerland/issues/new?body=module:%20ebill_postfinance%0Aversion:%
|
|
102
|
+
`feedback <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**>`_.
|
|
99
103
|
|
|
100
104
|
Do not contact contributors directly about support or help with technical issues.
|
|
101
105
|
|
|
@@ -111,6 +115,7 @@ Contributors
|
|
|
111
115
|
------------
|
|
112
116
|
|
|
113
117
|
- Thierry Ducrest <thierry.ducrest@camptocamp.com>
|
|
118
|
+
- Simone Orsi <simone.orsi@camptocamp.com>
|
|
114
119
|
|
|
115
120
|
Maintainers
|
|
116
121
|
-----------
|
|
@@ -133,6 +138,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
|
|
|
133
138
|
|
|
134
139
|
|maintainer-TDu|
|
|
135
140
|
|
|
136
|
-
This module is part of the `OCA/l10n-switzerland <https://github.com/OCA/l10n-switzerland/tree/
|
|
141
|
+
This module is part of the `OCA/l10n-switzerland <https://github.com/OCA/l10n-switzerland/tree/18.0/ebill_postfinance>`_ project on GitHub.
|
|
137
142
|
|
|
138
143
|
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
|
@@ -4,9 +4,7 @@
|
|
|
4
4
|
<field name="name">eBill Postfinance - Check invoices state on server</field>
|
|
5
5
|
<field name="interval_number">1</field>
|
|
6
6
|
<field name="interval_type">hours</field>
|
|
7
|
-
<field name="numbercall">-1</field>
|
|
8
7
|
<field name="active" eval="True" />
|
|
9
|
-
<field name="doall" eval="False" />
|
|
10
8
|
<field name="model_id" ref="model_ebill_postfinance_service" />
|
|
11
9
|
<field name="state">code</field>
|
|
12
10
|
<field name="code">model.cron_update_invoices()</field>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="utf-8" ?>
|
|
2
2
|
<odoo noupdate="1">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
<record id="mail_activity_ebill_postfinance_error" model="mail.activity.type">
|
|
4
|
+
<field name="name">eBill Postfinance Error</field>
|
|
5
|
+
<field name="icon">fa-warning</field>
|
|
6
|
+
<field name="delay_count">0</field>
|
|
7
|
+
<field name="sequence">99</field>
|
|
8
|
+
<field name="decoration_type">warning</field>
|
|
9
|
+
</record>
|
|
10
10
|
</odoo>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="utf-8" ?>
|
|
2
2
|
<odoo>
|
|
3
|
-
<record id="postfinance_transmit_method" model="transmit.method">
|
|
3
|
+
<record id="postfinance_transmit_method" model="transmit.method" forcecreate="True">
|
|
4
4
|
<field name="name">Postfinance</field>
|
|
5
5
|
<field name="code">postfinance</field>
|
|
6
6
|
<field name="customer_ok" eval="True" />
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
#
|
|
5
5
|
msgid ""
|
|
6
6
|
msgstr ""
|
|
7
|
-
"Project-Id-Version: Odoo Server
|
|
7
|
+
"Project-Id-Version: Odoo Server 18.0\n"
|
|
8
8
|
"Report-Msgid-Bugs-To: \n"
|
|
9
9
|
"Last-Translator: \n"
|
|
10
10
|
"Language-Team: \n"
|
|
@@ -16,7 +16,6 @@ msgstr ""
|
|
|
16
16
|
#. module: ebill_postfinance
|
|
17
17
|
#. odoo-python
|
|
18
18
|
#: code:addons/ebill_postfinance/models/ebill_payment_contract.py:0
|
|
19
|
-
#, python-format
|
|
20
19
|
msgid "A Postfinance service is required for a Postfinance contract."
|
|
21
20
|
msgstr ""
|
|
22
21
|
|
|
@@ -132,7 +131,6 @@ msgstr ""
|
|
|
132
131
|
#. module: ebill_postfinance
|
|
133
132
|
#. odoo-python
|
|
134
133
|
#: code:addons/ebill_postfinance/models/account_move.py:0
|
|
135
|
-
#, python-format
|
|
136
134
|
msgid "Error generating postfinance eBill"
|
|
137
135
|
msgstr ""
|
|
138
136
|
|
|
@@ -201,14 +199,12 @@ msgstr ""
|
|
|
201
199
|
#. module: ebill_postfinance
|
|
202
200
|
#. odoo-python
|
|
203
201
|
#: code:addons/ebill_postfinance/models/account_move.py:0
|
|
204
|
-
#, python-format
|
|
205
202
|
msgid "Invoice accepted by the Postfinance system"
|
|
206
203
|
msgstr ""
|
|
207
204
|
|
|
208
205
|
#. module: ebill_postfinance
|
|
209
206
|
#. odoo-python
|
|
210
207
|
#: code:addons/ebill_postfinance/models/ebill_postfinance_invoice_message.py:0
|
|
211
|
-
#, python-format
|
|
212
208
|
msgid "Invoice paid through eBilling"
|
|
213
209
|
msgstr ""
|
|
214
210
|
|
|
@@ -239,6 +235,11 @@ msgstr ""
|
|
|
239
235
|
msgid "Journal Entry"
|
|
240
236
|
msgstr ""
|
|
241
237
|
|
|
238
|
+
#. module: ebill_postfinance
|
|
239
|
+
#: model:ir.model,name:ebill_postfinance.model_account_move_line
|
|
240
|
+
msgid "Journal Item"
|
|
241
|
+
msgstr ""
|
|
242
|
+
|
|
242
243
|
#. module: ebill_postfinance
|
|
243
244
|
#: model:ir.model.fields,field_description:ebill_postfinance.field_ebill_postfinance_invoice_message__write_uid
|
|
244
245
|
#: model:ir.model.fields,field_description:ebill_postfinance.field_ebill_postfinance_service__write_uid
|
|
@@ -459,7 +460,6 @@ msgstr ""
|
|
|
459
460
|
#. module: ebill_postfinance
|
|
460
461
|
#. odoo-python
|
|
461
462
|
#: code:addons/ebill_postfinance/models/ebill_payment_contract.py:0
|
|
462
|
-
#, python-format
|
|
463
463
|
msgid "The Postfinacnce Account ID is required for a Postfinance contract."
|
|
464
464
|
msgstr ""
|
|
465
465
|
|
|
@@ -471,7 +471,6 @@ msgstr ""
|
|
|
471
471
|
#. module: ebill_postfinance
|
|
472
472
|
#. odoo-python
|
|
473
473
|
#: code:addons/ebill_postfinance/models/ebill_postfinance_invoice_message.py:0
|
|
474
|
-
#, python-format
|
|
475
474
|
msgid "The payload is valid."
|
|
476
475
|
msgstr ""
|
|
477
476
|
|
|
@@ -179,7 +179,7 @@
|
|
|
179
179
|
{%- if loop.index == 1 %}
|
|
180
180
|
<TAX>
|
|
181
181
|
<Rate>{{ tax.amount}}</Rate>
|
|
182
|
-
<Amount Currency="{{ invoice.currency_id.name }}">{{
|
|
182
|
+
<Amount Currency="{{ invoice.currency_id.name }}">{{ line._ebill_tax_amount(tax)|round(2) }}</Amount>
|
|
183
183
|
</TAX>
|
|
184
184
|
{%- endif %}
|
|
185
185
|
{% else %}
|
|
@@ -163,11 +163,11 @@
|
|
|
163
163
|
<Tax>
|
|
164
164
|
<TaxDetail>
|
|
165
165
|
<Rate>{{ tax.amount|round(2)|replace(",", ".") }}</Rate>
|
|
166
|
-
<Amount>{{
|
|
166
|
+
<Amount>{{ line._ebill_tax_amount(tax)|round(2) }}</Amount>
|
|
167
167
|
<BaseAmountExclusiveTax>{{ line.price_subtotal|round(6) }}</BaseAmountExclusiveTax>
|
|
168
168
|
<BaseAmountInclusiveTax>{{ line.price_total|round(6) }}</BaseAmountInclusiveTax>
|
|
169
169
|
</TaxDetail>
|
|
170
|
-
<TotalTax>{{
|
|
170
|
+
<TotalTax>{{ line._ebill_tax_amount(tax)|round(2) }}</TotalTax>
|
|
171
171
|
</Tax>
|
|
172
172
|
{%- endif %}
|
|
173
173
|
{% endfor %}
|
|
@@ -5,7 +5,7 @@ import base64
|
|
|
5
5
|
import logging
|
|
6
6
|
|
|
7
7
|
import odoo
|
|
8
|
-
from odoo import
|
|
8
|
+
from odoo import api, fields, models
|
|
9
9
|
from odoo.exceptions import UserError
|
|
10
10
|
from odoo.tools.pdf import merge_pdf
|
|
11
11
|
|
|
@@ -15,8 +15,15 @@ _logger = logging.getLogger(__name__)
|
|
|
15
15
|
class AccountMove(models.Model):
|
|
16
16
|
_inherit = "account.move"
|
|
17
17
|
|
|
18
|
-
@api.
|
|
19
|
-
def
|
|
18
|
+
@api.depends("transmit_method_id")
|
|
19
|
+
def _compute_partner_bank_id(self): # pylint: disable=missing-return
|
|
20
|
+
super()._compute_partner_bank_id()
|
|
21
|
+
for rec in self:
|
|
22
|
+
pf_partner_bank = rec._get_postfinance_partner_bank()
|
|
23
|
+
if pf_partner_bank:
|
|
24
|
+
rec.partner_bank_id = pf_partner_bank
|
|
25
|
+
|
|
26
|
+
def _get_postfinance_partner_bank(self):
|
|
20
27
|
if self.move_type not in ("out_invoice", "out_refund"):
|
|
21
28
|
return
|
|
22
29
|
postfinance_method = self.env.ref(
|
|
@@ -25,7 +32,7 @@ class AccountMove(models.Model):
|
|
|
25
32
|
if self.transmit_method_id == postfinance_method:
|
|
26
33
|
contract = self.partner_id.get_active_contract(self.transmit_method_id)
|
|
27
34
|
if contract:
|
|
28
|
-
|
|
35
|
+
return contract.postfinance_service_id.partner_bank_id
|
|
29
36
|
|
|
30
37
|
def _export_invoice(self):
|
|
31
38
|
"""Export invoice with the help of account_invoice_export module."""
|
|
@@ -36,7 +43,7 @@ class AccountMove(models.Model):
|
|
|
36
43
|
return super()._export_invoice()
|
|
37
44
|
message = self.create_postfinance_ebill()
|
|
38
45
|
if not message:
|
|
39
|
-
raise UserError(_("Error generating postfinance eBill"))
|
|
46
|
+
raise UserError(self.env._("Error generating postfinance eBill"))
|
|
40
47
|
message.send_to_postfinance()
|
|
41
48
|
self.invoice_exported = True
|
|
42
49
|
return f"Postfinance invoice generated and in state {message.state}"
|
|
@@ -120,7 +127,7 @@ class AccountMove(models.Model):
|
|
|
120
127
|
["ebill_postfinance.mail_activity_dws_error"],
|
|
121
128
|
feedback="It worked on a later try",
|
|
122
129
|
)
|
|
123
|
-
self.message_post(body=_("Invoice accepted by the Postfinance system"))
|
|
130
|
+
self.message_post(body=self.env._("Invoice accepted by the Postfinance system"))
|
|
124
131
|
self.invoice_export_confirmed = True
|
|
125
132
|
|
|
126
133
|
def log_invoice_refused_by_system(self):
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Copyright 2025 Camptocamp SA
|
|
2
|
+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
|
3
|
+
|
|
4
|
+
from odoo import models
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class AccountMoveLine(models.Model):
|
|
8
|
+
_inherit = "account.move.line"
|
|
9
|
+
|
|
10
|
+
def _ebill_tax_amount(self, tax):
|
|
11
|
+
"""Helper to compute tax amount for a given tax on invoice line.
|
|
12
|
+
|
|
13
|
+
:param tax: The tax to compute.
|
|
14
|
+
:return: Computed tax amount.
|
|
15
|
+
"""
|
|
16
|
+
if not tax:
|
|
17
|
+
return 0.0
|
|
18
|
+
|
|
19
|
+
# Compute the tax amount
|
|
20
|
+
price_unit = self.price_unit
|
|
21
|
+
quantity = self.quantity
|
|
22
|
+
currency = self.move_id.currency_id
|
|
23
|
+
|
|
24
|
+
# Adjust price for discount
|
|
25
|
+
discount = self.discount or 0.0
|
|
26
|
+
price = price_unit * (1 - discount / 100)
|
|
27
|
+
|
|
28
|
+
# Compute the tax amount using the tax's compute_all method
|
|
29
|
+
res = tax.compute_all(
|
|
30
|
+
price_unit=price,
|
|
31
|
+
currency=currency,
|
|
32
|
+
quantity=quantity,
|
|
33
|
+
product=self.product_id,
|
|
34
|
+
partner=self.move_id.partner_id,
|
|
35
|
+
)
|
|
36
|
+
return res["taxes"][0]["amount"]
|
|
@@ -70,5 +70,7 @@ class EbillPaymentContract(models.Model):
|
|
|
70
70
|
for contract in self:
|
|
71
71
|
if contract.is_postfinance_contract and not contract.postfinance_service_id:
|
|
72
72
|
raise ValidationError(
|
|
73
|
-
_(
|
|
73
|
+
self.env._(
|
|
74
|
+
"A Postfinance service is required for a Postfinance contract."
|
|
75
|
+
)
|
|
74
76
|
)
|
|
@@ -9,7 +9,7 @@ import pytz
|
|
|
9
9
|
from jinja2 import Environment, FileSystemLoader
|
|
10
10
|
from lxml import etree
|
|
11
11
|
|
|
12
|
-
from odoo import
|
|
12
|
+
from odoo import api, fields, models
|
|
13
13
|
from odoo.exceptions import UserError
|
|
14
14
|
from odoo.modules.module import get_module_root
|
|
15
15
|
|
|
@@ -139,7 +139,9 @@ class EbillPostfinanceInvoiceMessage(models.Model):
|
|
|
139
139
|
for record in self:
|
|
140
140
|
if record.state != "done":
|
|
141
141
|
record.state = "done"
|
|
142
|
-
record.invoice_id.message_post(
|
|
142
|
+
record.invoice_id.message_post(
|
|
143
|
+
body=self.env._("Invoice paid through eBilling")
|
|
144
|
+
)
|
|
143
145
|
|
|
144
146
|
@api.model
|
|
145
147
|
def _remove_pdf_data_from_payload(self, data):
|
|
@@ -281,14 +283,14 @@ class EbillPostfinanceInvoiceMessage(models.Model):
|
|
|
281
283
|
amount_by_group = []
|
|
282
284
|
# Get the percentage of the tax from the name of the group
|
|
283
285
|
# Could be improve by searching in the account_tax linked to the group
|
|
284
|
-
for
|
|
285
|
-
for taxgroup in
|
|
286
|
-
rate = taxgroup["
|
|
286
|
+
for subtotal in self.invoice_id.tax_totals["subtotals"]:
|
|
287
|
+
for taxgroup in subtotal["tax_groups"]:
|
|
288
|
+
rate = taxgroup["group_name"].split()[-1:][0][:-1]
|
|
287
289
|
amount_by_group.append(
|
|
288
290
|
(
|
|
289
291
|
rate or "0",
|
|
290
|
-
taxgroup["
|
|
291
|
-
taxgroup["
|
|
292
|
+
taxgroup["tax_amount"],
|
|
293
|
+
taxgroup["base_amount"],
|
|
292
294
|
)
|
|
293
295
|
)
|
|
294
296
|
params["amount_by_group"] = amount_by_group
|
|
@@ -350,7 +352,7 @@ class EbillPostfinanceInvoiceMessage(models.Model):
|
|
|
350
352
|
"type": "ir.actions.client",
|
|
351
353
|
"tag": "display_notification",
|
|
352
354
|
"params": {
|
|
353
|
-
"title": _("The payload is valid."),
|
|
355
|
+
"title": self.env._("The payload is valid."),
|
|
354
356
|
"sticky": False,
|
|
355
357
|
},
|
|
356
358
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
This module needs the Python library
|
|
1
|
+
This module needs the Python library ebilling_postfinance which can be
|
|
2
2
|
installed from Pypi. More information can be found at
|
|
3
3
|
[repository https://github.com/camptocamp/ebilling-postfinance](repository%20https://github.com/camptocamp/ebilling-postfinance).
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
5
5
|
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
|
|
6
|
-
<title>
|
|
6
|
+
<title>README.rst</title>
|
|
7
7
|
<style type="text/css">
|
|
8
8
|
|
|
9
9
|
/*
|
|
@@ -360,16 +360,21 @@ ul.auto-toc {
|
|
|
360
360
|
</style>
|
|
361
361
|
</head>
|
|
362
362
|
<body>
|
|
363
|
-
<div class="document"
|
|
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:
|
|
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/
|
|
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&target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
|
|
373
378
|
<p>This module implements the exchange of electronic invoices with the
|
|
374
379
|
Postfinance web service.</p>
|
|
375
380
|
<p><strong>Table of contents</strong></p>
|
|
@@ -393,23 +398,23 @@ Postfinance web service.</p>
|
|
|
393
398
|
</ul>
|
|
394
399
|
</div>
|
|
395
400
|
<div class="section" id="installation">
|
|
396
|
-
<
|
|
397
|
-
<p>This module needs the Python library
|
|
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
|
|
398
403
|
installed from Pypi. More information can be found at
|
|
399
404
|
<a class="reference external" href="repository%20https://github.com/camptocamp/ebilling-postfinance">repository</a>
|
|
400
405
|
<a class="reference external" href="https://github.com/camptocamp/ebilling-postfinance">https://github.com/camptocamp/ebilling-postfinance</a>.</p>
|
|
401
406
|
</div>
|
|
402
407
|
<div class="section" id="configuration">
|
|
403
|
-
<
|
|
408
|
+
<h2><a class="toc-backref" href="#toc-entry-2">Configuration</a></h2>
|
|
404
409
|
<div class="section" id="create-a-service">
|
|
405
|
-
<
|
|
410
|
+
<h3><a class="toc-backref" href="#toc-entry-3">Create a service</a></h3>
|
|
406
411
|
<p>First you need to be registred on ‘Postfinance eBill service
|
|
407
412
|
<<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>>’
|
|
408
413
|
To create a service go to Accounting - Configuration - Payments -
|
|
409
414
|
Postfinance eBill Service</p>
|
|
410
415
|
</div>
|
|
411
416
|
<div class="section" id="configure-a-customer-and-create-his-contract">
|
|
412
|
-
<
|
|
417
|
+
<h3><a class="toc-backref" href="#toc-entry-4">Configure a customer and create his contract</a></h3>
|
|
413
418
|
<p>The contracts specific to Postfinance e-billing are located in
|
|
414
419
|
Accounting - Customers - eBill Postfinance Contract Create a contract
|
|
415
420
|
for a customer with his PayerId and make sure that the contract is
|
|
@@ -418,7 +423,7 @@ active by being in Open state with valid start/end dates.</p>
|
|
|
418
423
|
</div>
|
|
419
424
|
</div>
|
|
420
425
|
<div class="section" id="usage">
|
|
421
|
-
<
|
|
426
|
+
<h2><a class="toc-backref" href="#toc-entry-5">Usage</a></h2>
|
|
422
427
|
<p>To use this module, you need to:</p>
|
|
423
428
|
<ol class="arabic simple">
|
|
424
429
|
<li>Configure the service, customers and contracts as described in the
|
|
@@ -428,7 +433,7 @@ CONFIGURATION section.</li>
|
|
|
428
433
|
</ol>
|
|
429
434
|
</div>
|
|
430
435
|
<div class="section" id="known-issues-roadmap">
|
|
431
|
-
<
|
|
436
|
+
<h2><a class="toc-backref" href="#toc-entry-6">Known issues / Roadmap</a></h2>
|
|
432
437
|
<p>ToDo</p>
|
|
433
438
|
<ul class="simple">
|
|
434
439
|
<li>Add option to import the contract subscription (csv)</li>
|
|
@@ -442,29 +447,30 @@ endpoint ?</li>
|
|
|
442
447
|
</ul>
|
|
443
448
|
</div>
|
|
444
449
|
<div class="section" id="bug-tracker">
|
|
445
|
-
<
|
|
450
|
+
<h2><a class="toc-backref" href="#toc-entry-7">Bug Tracker</a></h2>
|
|
446
451
|
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/l10n-switzerland/issues">GitHub Issues</a>.
|
|
447
452
|
In case of trouble, please check there if your issue has already been reported.
|
|
448
453
|
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
|
449
|
-
<a class="reference external" href="https://github.com/OCA/l10n-switzerland/issues/new?body=module:%20ebill_postfinance%0Aversion:%
|
|
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>
|
|
450
455
|
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
|
451
456
|
</div>
|
|
452
457
|
<div class="section" id="credits">
|
|
453
|
-
<
|
|
458
|
+
<h2><a class="toc-backref" href="#toc-entry-8">Credits</a></h2>
|
|
454
459
|
<div class="section" id="authors">
|
|
455
|
-
<
|
|
460
|
+
<h3><a class="toc-backref" href="#toc-entry-9">Authors</a></h3>
|
|
456
461
|
<ul class="simple">
|
|
457
462
|
<li>Camptocamp</li>
|
|
458
463
|
</ul>
|
|
459
464
|
</div>
|
|
460
465
|
<div class="section" id="contributors">
|
|
461
|
-
<
|
|
466
|
+
<h3><a class="toc-backref" href="#toc-entry-10">Contributors</a></h3>
|
|
462
467
|
<ul class="simple">
|
|
463
468
|
<li>Thierry Ducrest <<a class="reference external" href="mailto:thierry.ducrest@camptocamp.com">thierry.ducrest@camptocamp.com</a>></li>
|
|
469
|
+
<li>Simone Orsi <<a class="reference external" href="mailto:simone.orsi@camptocamp.com">simone.orsi@camptocamp.com</a>></li>
|
|
464
470
|
</ul>
|
|
465
471
|
</div>
|
|
466
472
|
<div class="section" id="maintainers">
|
|
467
|
-
<
|
|
473
|
+
<h3><a class="toc-backref" href="#toc-entry-11">Maintainers</a></h3>
|
|
468
474
|
<p>This module is maintained by the OCA.</p>
|
|
469
475
|
<a class="reference external image-reference" href="https://odoo-community.org">
|
|
470
476
|
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
|
|
@@ -474,10 +480,11 @@ mission is to support the collaborative development of Odoo features and
|
|
|
474
480
|
promote its widespread use.</p>
|
|
475
481
|
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
|
|
476
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>
|
|
477
|
-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-switzerland/tree/
|
|
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>
|
|
478
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>
|
|
479
485
|
</div>
|
|
480
486
|
</div>
|
|
481
487
|
</div>
|
|
488
|
+
</div>
|
|
482
489
|
</body>
|
|
483
490
|
</html>
|
|
@@ -6,6 +6,7 @@ import os
|
|
|
6
6
|
from os.path import dirname, join
|
|
7
7
|
|
|
8
8
|
import requests
|
|
9
|
+
from lxml import etree
|
|
9
10
|
from vcr import VCR
|
|
10
11
|
from xmlunittest import XmlTestMixin
|
|
11
12
|
|
|
@@ -20,6 +21,12 @@ class CommonCase(TransactionCase, XmlTestMixin):
|
|
|
20
21
|
cls._super_send = requests.Session.send
|
|
21
22
|
super().setUpClass()
|
|
22
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):
|
|
23
30
|
cls.service = cls.env["ebill.postfinance.service"].create(
|
|
24
31
|
{
|
|
25
32
|
"name": "Postfinance Test Service",
|
|
@@ -30,7 +37,7 @@ class CommonCase(TransactionCase, XmlTestMixin):
|
|
|
30
37
|
}
|
|
31
38
|
)
|
|
32
39
|
cls.country = cls.env.ref("base.ch")
|
|
33
|
-
cls.company = cls.env.ref("
|
|
40
|
+
cls.company = cls.env.ref("base.demo_company_ch")
|
|
34
41
|
cls.env.user.company_id = cls.company
|
|
35
42
|
cls.company.vat = "CHE-012.345.678"
|
|
36
43
|
cls.company.name = "Camptocamp SA"
|
|
@@ -92,6 +99,9 @@ class CommonCase(TransactionCase, XmlTestMixin):
|
|
|
92
99
|
[("account_type", "=", "asset_receivable")],
|
|
93
100
|
limit=1,
|
|
94
101
|
)
|
|
102
|
+
|
|
103
|
+
@classmethod
|
|
104
|
+
def setUpSaleData(cls):
|
|
95
105
|
cls.product = cls.env["product.product"].create(
|
|
96
106
|
{"name": "Product Q & A", "list_price": 100.00, "default_code": "370003021"}
|
|
97
107
|
)
|
|
@@ -138,6 +148,9 @@ class CommonCase(TransactionCase, XmlTestMixin):
|
|
|
138
148
|
)
|
|
139
149
|
cls.sale.action_confirm()
|
|
140
150
|
cls.sale.date_order = "2019-06-01"
|
|
151
|
+
|
|
152
|
+
@classmethod
|
|
153
|
+
def setUpInvoiceData(cls):
|
|
141
154
|
# Generate the invoice from the sale order
|
|
142
155
|
cls.invoice = cls.sale._create_invoices()
|
|
143
156
|
# And add some more lines on the invoice
|
|
@@ -176,11 +189,12 @@ class CommonCase(TransactionCase, XmlTestMixin):
|
|
|
176
189
|
number_of_lines = len(expected_line)
|
|
177
190
|
for i in range(number_of_lines):
|
|
178
191
|
if generated_line[i].strip() != expected_line[i].strip():
|
|
179
|
-
return "
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
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
|
+
]
|
|
184
198
|
)
|
|
185
199
|
|
|
186
200
|
|
|
@@ -199,3 +213,7 @@ def get_recorder(base_path=None, **kw):
|
|
|
199
213
|
|
|
200
214
|
|
|
201
215
|
recorder = get_recorder()
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
def clean_xml(txt):
|
|
219
|
+
return etree.canonicalize(txt.decode(), strip_text=True).encode()
|