Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[13.0][ADD] ebill_paynet v2 #585

Merged
merged 34 commits into from
Sep 27, 2021
Merged

[13.0][ADD] ebill_paynet v2 #585

merged 34 commits into from
Sep 27, 2021

Conversation

TDu
Copy link
Member

@TDu TDu commented Feb 8, 2021

This is to followup on #551.That PR included the ebill_paynet_account_financial_discount which needs to be open on its own #586.
And also the server_env PR #559 related to paynet is now included here.

Copy link
Member

@yvaucher yvaucher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be coherent with other module, please use the english term ISR and not ESR.

We changed from BVR to ISR to have less mixed terms, so always prefer ISR when possible. I suppose that the xml tags can only be ESR du to the ebill standard, but in Odoo all displayed values must be ISR.

ebill_paynet/models/ebill_payment_contract.py Outdated Show resolved Hide resolved
ebill_paynet/models/paynet_invoice_message.py Outdated Show resolved Hide resolved
ebill_paynet/messages/invoice-2003A.xml Outdated Show resolved Hide resolved
ebill_paynet/models/account_invoice.py Outdated Show resolved Hide resolved
{%- if invoice.company_id.vat %}
<Tax-No>{{ invoice.company_id.vat }}</Tax-No>
{%- endif %}
{%- if invoice_esr %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{%- if invoice_esr %}
{%- if invoice_isr %}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does come this value? I don't see it anywhere.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same than below

<Tax-No>{{ invoice.company_id.vat }}</Tax-No>
{%- endif %}
{%- if invoice_esr %}
<Doc-Reference Type="ESR-NEU">{{ invoice_esr }}</Doc-Reference>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<Doc-Reference Type="ESR-NEU">{{ invoice_esr }}</Doc-Reference>
<Doc-Reference Type="ESR-NEU">{{ invoice_isr }}</Doc-Reference>

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is related to Paynet B2C service and is not implemented yet but kept for further reference

selection=[("qr", "QR"), ("esr", "ESR"), ("esp", "ESP"), ("npy", "NPY")],
default="qr",
readonly=True,
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a help text could help to give the full names of QR, ISR, ESP and NPY (I have no idea what the 2 latest are)

@TDu
Copy link
Member Author

TDu commented Mar 18, 2021

@yvaucher I did the changes regarding the naming of esr/isr.
But the build is red and it seems to be related to another module, would you have any idea why ? Changes in the core ?

@TDu
Copy link
Member Author

TDu commented Mar 19, 2021

@yvaucher Regarding the broken tests, I opened this #603

@yvaucher
Copy link
Member

yvaucher commented Aug 5, 2021

some rebase to do

TDu added 18 commits September 23, 2021 14:10
This is migrated from the previous implementation for 12.0
Remove compute on user and password

Improve tree view for messages
Before one job was polling for shipment and downloading/acknowledging
them. This could lead to incoherent state between Odoo and the distant
server.
Now one job polls for shipment and creates one job for each new shipment
to be downloaded and parsed.

Also add improvement in the UI.
Fix the selection of the bank account of the sale order when paynet
transmit method is choosen.
Fix the get_active contract that has been moved to
base_ebill_payment_contract.
Add some fixes proposed by @sebalix.

Some improvements and fixes on invoice message generation :

* Fix the payment reference (it was using the old field pre v13)
* Allow to have a 2nd line in the biller name node, it uses the
company_name_suffix_1 on the company partner for it.
* Change the customer reference for the purchase linked to the invoice.
* Improve or so I hope the account number if it is a postal account the
  specific account number is used otherwise we use the bic.
Implement the QR invoice functionality from SIX specifications.

Add on the ebill contract the choice of payment ESR or QR, so it can be
specific for each customer.
The XML payload has been updated. And the PDF data included improved, so
the correct PDF is generated depending of the type of payment.
 Add the price and tax node for each line item.
 Improve the reference on the sale order.
 Add sale as a dependency and improve the tests by generating the
 invoice from a sale order.
Fix naming of eBill
Improve import statement of zeep
The specifcation accepts only one tax node by line.
The `l10n_ch_postal` field is used for bank account not belonging to the
company (like suppliers).
The `l10n_ch_isr_subscription_chf` field is the one used for bank account
belonging to the company.
The actual invoice and the payment (ESR, QR) reports are not generated
together in one PDF so up to know only the page with the payment was
sent to Paynet.
Now both report are merge and sent to the system.
Having this field stored will create problems for implementation
that uses different stacks (integration/production)
And it is not required
Fix some line with a limited length of 35 char.
Round some decimal.
Use the partner_shipping_id information for the DELIVERY-PARTY node.
Also for all name nodes concerning a res.partner record, add a Line node
with the commercial company name if it is different to the partner name.
When downloading a shipment if a fault occurs on the communication with
the DWS. The module was trying to parse a content set to None.
So the exception must be raised and the information on the error will be
available in the job result.
Comment answered ;) and removed.
Remove invoice line with a display_type value. The filtering can be
overriden, if needed.
Handle properly the invoice line not linked to a product.
Fix some falsy values.

Run pre-commit hooks
Reading the specs it seemed to be the other way around.
But it has been confirmed by someone at SIX. That the reference for
linked sale order must be the customer order reference.
Use the currency of the invoice to generated the message instead of
fixing it to CHF.
Fix the length of a name
TDu and others added 14 commits September 23, 2021 14:11
The payment term node in the Paynet message allows to add a discount
information in case of payment until a certain date.
As this feature does not exist in the standard implementation of Odoo,
this is extracted into another module, to give the option to use
different implementation for it.
See `ebill_paynet_account_financial_discount` for one of them.
This fixes an issue when downloading a shipment from the DWS, while
using a production account.
The module l10n_ch_qr has been renamed to l10n_ch_qriban.

For this to work with an updated Odoo src the following PR is required:

* odoo/odoo#57710
Add a module to allow configuration of paynet.service with the aid of
server environment.
Adds hooks for  interaction with other module.
One for the sale order customer reference.
And another one for managing <OTHER-REFERENCE> node.
@TDu
Copy link
Member Author

TDu commented Sep 23, 2021

It has been rebased.

@TDu
Copy link
Member Author

TDu commented Sep 23, 2021

@yvaucher Rebased done, and Travis is 💚

Copy link

@simahawk simahawk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG overall. Could you add to ROADMAP "consider refactoring on top of EDI framework for v14 or v15"?

@@ -0,0 +1,58 @@
# Copyright 2019 Camptocamp SA

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why components if there's no component here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TDu
Copy link
Member Author

TDu commented Sep 23, 2021

LG overall. Could you add to ROADMAP "consider refactoring on top of EDI framework for v14 or v15"?

Done

@yvaucher yvaucher merged commit b456b3a into OCA:13.0 Sep 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants