Skip to content

[16.0][MIG] contract_payment_auto: Migration to 16.0 #1231

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

Open
wants to merge 27 commits into
base: 16.0
Choose a base branch
from

Conversation

9184Lucky
Copy link

No description provided.

@9184Lucky 9184Lucky force-pushed the 16.0-mig-contract_payment_auto branch 2 times, most recently from 6204ed6 to 38deab5 Compare April 30, 2025 10:36
@rousseldenis
Copy link
Contributor

/ocabot migration contract_payment_auto

@rousseldenis
Copy link
Contributor

@9184Lucky Could you improve your commits messages in order to make module name appear in it ?

Like [IMP] contract_payment_auto: (...)

image

Moreover, if you think some can be squashed with migration one, it could be great.

lasley and others added 22 commits June 13, 2025 16:06
…en (OCA#167)

When a contrat had no payment token but the corresponding partner had
one, the transaction was created without an acquirer, leading to an
integrity error in postgres.

This change makes sure the token used to test the ability to pay an
invoice is passed along to the transaction creation call.

Tests were also added to check the ability to use the contract token if
present, but the partner's in the opposite case.

This change fixes OCA#165.
Currently translated at 100.0% (25 of 25 strings)

Translation: contract-10.0/contract-10.0-contract_payment_auto
Translate-URL: https://translation.odoo-community.org/projects/contract-10-0/contract-10-0-contract_payment_auto/de/
The `_recurring_create_invoice` contract method returns multiple
invoices potentially coming from different contracts, which may have
different values for their `is_auto_pay` attribute.

Without this patch, this case simply crashes (a unit test with more than
one contract to be invoiced is a must-have in this module!).
Change the mock method to patch the Contract class instead of the contract object:
patching the object is less reliable and depends on the implementation too much.
This implementation changed and the tests were no more working. Mocking the class
method fixes the problem.
The payment acquirer API requires an implementation of a _get_feature_support
method. This is done using a temporary mock where required.
Also pass the invoice to the transaction reference computation mecanism
so that it reflects the invoice's number.
louck added 5 commits June 13, 2025 16:06
This allows a cleaner overriding of _send_payment_request and improve
code readability.
Initial purpose was to pass tests on a database with
l10n module installed but it also simplifies the setUpClass method.
@9184Lucky
Copy link
Author

@rousseldenis Done ! I squashed all commit directly related to migration and fixed the other's messages.

If anyone feels that some other commit should be merged feel free to asks but i think the ones I left were improvement more than migration...

@rousseldenis
Copy link
Contributor

@9184Lucky Not yet pushed 😅

@9184Lucky 9184Lucky force-pushed the 16.0-mig-contract_payment_auto branch from 38deab5 to 60087a5 Compare June 13, 2025 14:22
@9184Lucky
Copy link
Author

Oups ^^'

@9184Lucky
Copy link
Author

@rousseldenis I pushed the new version but forgot to ping you, sorry !

@rousseldenis
Copy link
Contributor

@rousseldenis I pushed the new version but forgot to ping you, sorry !

No problem. I'll check this later today

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.