Commit Graph
1411 Commits
Author SHA1 Message Date
Victor Feyens 61b8c0c1a2 [REF] (account_)payment: extract accounting logic from payment 2022-09-06 13:31:00 +02:00
Victor Feyens 5f41f15e6b [MOV] payment_transfer: rename to payment_custom
The module `payment_transfer` was originally meant to implement a
payment with Wire Transfer flow, which it does not exactly do since all
it does it making transactions follow the payment flow until their
`pending_msg` field's content is shown to the customer. Because of that,
other modules (`website_delivery_ups`, `website_sale_picking`) started
duplicating the base acquirer Wire Transfer to create new payment modes
such as Cash on Delivery and Pay in Store.

To better prepare for a proper dinstinction of the custom modes enabled
by other modules, this commit renames the module `payment_transfer` to
`payment_custom`.

The module `payment_transfer`'s `auto-install` key is also set to
`False` since we no longer want Wire Transfer to be the default payment
acquirer for new databases.

task-2853489

Part-of: odoo/odoo#99400
2022-09-06 12:01:37 +02:00
Victor Feyens 852c2a13ed [FIX] payment: do not rely on the Wire Transfer acquirer for tests
task-2853489

Part-of: odoo/odoo#99400
2022-09-06 12:01:37 +02:00
Victor Feyens e648489401 [MOV] payment_test: rename to payment_demo
The name "Payment Acquirer Test" of the acquirer bundled with the module
`payment_test` is confusing. It is actually the only acquirer that
doesn't connect to a test API, and its purpose is not to make test
transactions but to showcase the integration of other apps (Accounting,
Sales, eCommerce, Subscriptions) with demo payments.

Hence, the module is renamed to `payment_demo` along with its data and
technical keys to better make the distinction between acquirers' test
environment and demo payments.

task-2853481

closes odoo/odoo#99397

Related: odoo/upgrade#3846
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-09-05 20:13:02 +02:00
Victor Feyens c9072dfe79 [IMP] payment_(alipay,ogone,payumoney,payulatam): deprecate the modules
The four payment acquirers implemented with these modules all present
a subset of the following issues:
- The user experience for the payment step is really bad: All of them.
- The API is poorly documented, breaks often, or is badly designed and
  hard to work with: All of them.
- It is no longer possible to open a new account: PayULatam, PayU money.
- The countries/payment methods/currencies coverage is limited: Alipay,
  PayU money.
- It is not possible to implement additional features such as
  tokenization, manual capture, or refunds: Alipay, PayULatam,
  PayU money.
- They have a better replacement already available in Odoo: All of them.

This commit thus deprecates the above-mentioned payment acquirers. This
means that their module can no longer be installed on new databases and
alternatives are suggested. Existing databases in which the modules were
already installed will keep working.

task-2806832

closes odoo/odoo#99025

Related: odoo/upgrade#3848
Related: odoo/documentation#2686
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-09-05 20:12:54 +02:00
Horacio Tellez 24f33c0282 [IMP] payment: rework the kanban view of acquirers
The present kanban view of acquirers is not the most appealing
one. It is full of useless information (e.g. "online payment") and the
combination of provider logos makes it look "old".

After this commit, the kanban view will hopefully have a "cool" and
concise look simular to the "Apps"'s kanban view.

Task - 284171

closes odoo/odoo#98345

Related: odoo/enterprise#30585
Related: odoo/upgrade#3803
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-09-05 14:50:11 +02:00
Valentin Chevalier c624ed5603 [IMP] payment(_stripe), website_sale(_delivery): support express checkout
This commit enables eCommerce customers to pay with the express payment
methods Apple Pay and Google Pay from the cart page.

For the moment, only Stripe supports this additional feature but it
was designed to make it easy to implement with a new provider.

task-2754209

closes odoo/odoo#88374

Related: odoo/enterprise#29915
Related: odoo/documentation#2392
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-09-05 14:49:33 +02:00
08a7c779cb [ADD] payment_razorpay: integrate with Razorpay's "Payment" gateway
See README for technical details.

task-2800823

Part-of: odoo/odoo#92848
Co-authored-by: Antoine Vandevenne (anv) <anv@odoo.com>
Co-authored-by: Prakash Prajapati <ppr@odoo.com>
2022-09-01 19:16:27 +02:00
Tommy (tong)andAntoine Vandevenne 2f5da9729a [ADD] payment_asiapay: add an integration to AsiaPay
task-2845428

closes odoo/odoo#98441

Related: odoo/documentation#2628
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Co-authored-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-08-30 20:22:44 +02:00
Horacio TellezandAntoine Vandevenne 15058b6739 [ADD] payment_mercado_pago: integrate with Mercado Pago
Mercado Pago is the largest online payment platform in Latin America,
supports more countries, currencies and payment methods in the region
than other PSPs, and is more accessible to small businesses.

This commit integrates Odoo with a combination of the Checkout Pro and
Checkout API solutions of Mercado Pago to implement payments with
redirection to the provider's payment page.

Task - 2704764

Part-of: odoo/odoo#83957
Co-authored-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-08-30 20:21:54 +02:00
Valentin Chevalier 7612de7227 [FIX] payment(_transfer): only leave the status page when state is final
Before this commit, customers never waited on the status page for their
payment to be confirmed. Instead, they were redirected to the landing
route before that the transaction reaches a final state.

Although this bug is present since version 15.0, it not considered as a
problem worth fixing in stable since redirecting customers in advance is
already supported. It is fixed in master to lay ground for further work
that will require customers to wait for the payment confirmation.

After this commit, customers will remain on the status page until their
transaction state is updated to a final state ('authorized', 'done',
'error'). An exception is made for Wire Transfer's payments that are
never confirmed and should not block the customer on the status page.

task-2908493

closes odoo/odoo#95933

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-08-27 03:33:03 +02:00
Alvaro Fuentes adf534f2bf [FIX] payment: compute related_partner_ids with sudo
`related_partner_ids` is used in the form view of account.payment
https://github.com/odoo/odoo/blob/43fccd7aaa83117c95babc52d60dd1c26b28335a/addons/payment/views/account_payment_views.xml#L14
It is only needed for electronic payments to display the payment token
ids (as part of its domain)
https://github.com/odoo/odoo/blob/45f5167b956521f0a183ff1b1cc75fa1b273866c/addons/payment/models/account_payment.py#L13-L21
and for draft payments only.
https://github.com/odoo/odoo/blob/43fccd7aaa83117c95babc52d60dd1c26b28335a/addons/payment/views/account_payment_views.xml#L16

Before this change the form view will fail when partner_id has a company
that is not in the context. This is not incorrect, but it is unexpected
as `related_partner_ids` is not needed to just show the form view. A way
to reproduce the issue is to confirm a payment, then change the partner
company to a company not accessible for current user.

This causes issues during migrations: the form view for the failing
payments is displayed just fine for versions <=13.0

closes odoo/odoo#98623

X-original-commit: a126f007573a41d22108d9d7887f92b6926ef3ec
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Alvaro Fuentes Suarez (afu) <afu@odoo.com>
2022-08-22 22:56:27 +02:00
Denis Ledoux 0501bbd62e [IMP] base: uniform "groups" in back-end view
This revision is to make uniform the behavior of the `groups` attribute
on the Python model fields
and on the node in the view architecture.
In both cases, remove the node from the view completely.

Before this revision,

in a back-end view:
 - In the Python model, if a field has the `groups` attribute set
   and the user is not part of
   the groups, the field is removed, completely, from the view.
 - In the view architecture, if a node has the `groups` attribute set
   and the user is not part of
   the groups, the node is made invisible (not completely removed, just
   made invisible).

in a front-end view:
 - if a node has a "groups" or "t-groups" set and the user
   is not part of the groups, the node is removed from the view.

So it's 2/3 cases removing nodes restricted to a group.
and 1/3 case making invisible nodes restricted to a group.
It's simpler to have a uniform behavior for the 3 cases,
simpler to understandard for developers.

In addition, this will help for the goal to cache back-end views.
It makes possible to convert views using the `groups_id` field
by moving the content of these views directly
in the view to which they add content which is suppose to be completely
removed when the user has not the according group.
By getting rid of the `groups_id` many2many field on `ir.ui.view`,
it makes possible to cache the view architecture without
requiring to use the groups in the cache key.
Currently, if we want to cache the view architecture,
it would be required to use the intersection of the user
groups with the `groups_id` groups of the view,
making it costly to compute the cache key,
therefore altering the performance point to cache the view
architectures.

closes odoo/odoo#95729

Related: odoo/enterprise#29592
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2022-08-19 19:10:39 +02:00
Laura Schauer c1b41bcd08 [IMP] payment(_*): allow dynamic token name
Before this commit, tokens were prefixed with usually 12 X’s. To improve
readability, modernity and to shorten the length, this commit changes
token prefixes to a standard of •••• 1111.

task-2832669

closes odoo/odoo#94978

Related: odoo/upgrade#3738
Related: odoo/enterprise#29190
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-08-19 14:28:08 +02:00
Victor Feyens 4c185d4a3f [FIX] payment: correct message for validation transactions
The message returned by `_get_sent_message` for validation transaction
was wrong, refering to a token, but there is no token on validation transactions.

This doesn't have to be fixed in stable since validation transactions are not linked to
any specific document, so the wrong message was never posted anywhere.

Now that we improve the display logic of payment tokens and noticed the problem,
this commit fixes it (for code consistency, and if any custom code/... uses this
message as well.

Part-of: odoo/odoo#94978
2022-08-19 14:28:08 +02:00
Romeo Fragomeli bff483f4a3 [FIX] payment,website: Deletes and migrates col-*-offset- BS3 class
This rule has no effect for a while!

In settings, we had to delete it because converting it would add
space in the first column.

In payment, it seems that this offset was used to center the content.
We prefer to convert it.

closes odoo/odoo#98438

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-08-19 10:31:24 +02:00
Antoine Vandevenne (anv) d104ef0a50 [FIX] payment: move _build_url to the test class that supports it
Calling `_build_url` for a test class that only inherited from
`PaymentCommon` would raise an error, as the method depends on the
`HttpCase` test class that is only inherited by `PaymentHttpCommon`.

closes odoo/odoo#95860

Related: odoo/documentation#2532
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-08-17 17:20:50 +02:00
Laura Schauer 5ac27efc72 [ADD] payment_aps: add Amazon Payment Services
See README for technical details.

task-2802678

Part-of: odoo/odoo#95860
2022-08-17 17:20:49 +02:00
Antoine Vandevenne (anv) 011567782e [FIX] payment: fix the condition for the "Manage payment methods" button
The button should only be shown if a tokenization-capable acquirer is
enabled (or if a token already exists), but a typo made the button being
shown regardless of that (first) condition.

closes odoo/odoo#97276

X-original-commit: b301844cbdcb07b4e13186cae85257b18ca54654
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-08-02 10:32:00 +02:00
Fabien Pinckaers 3363e55cac [IMP] cleanup of help messages in all modules
This commit aims at removing unuseful help message to:
1/ reduce translators work, to focus on more useful translations
2/ not sending unuseful information in load_views
3/ reduce help message to useful messages, so that we can mark
   fields having a tooltip in the future UI.
4/ some cleanup of existing messages too

The main use cases:
- REMOVED: help redundant with the field name, providing no extra info
- MOVED TO COMMENT: technical help messages, that should not be in UX

closes odoo/odoo#97279

Signed-off-by: Fabien Pinckaers <fp@odoo.com>
2022-08-02 00:26:53 +02:00
Horacio Tellez f8bebc407b [FIX] payment: do not add fee for validation transaction
When making transaction with 'validation' type and where fees
were active, fees were added to the amount.
This behaviour is problematic because
validation operations are used for tokenization for example where
no credit should charged to the customer.
Now validation operations have no fees even if fees are active
on the acquirer.

Task - 2784765

closes odoo/odoo#96712

X-original-commit: 69b04e753ab4e90e68b9d3e678ebea277586e7ac
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-07-29 14:31:49 +02:00
Victor Feyens d3c935ff27 [CLN] payment: unnecessary csrf token
The csrf token given to the assignTokenRoute is not necessary
and will trigger warnings in the logs.

closes odoo/odoo#94020

Related: odoo/enterprise#28595
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-07-28 10:27:55 +02:00
Victor Feyens 5e2d675149 [IMP] payment: provide the access token to the assign route
to be able to safely check the user is allowed to modify the specified
portal record.

Part-of: odoo/odoo#94020
2022-07-28 10:27:54 +02:00
Antoine Vandevenne (anv) b7181334a9 [REF] payment: reuse the transaction status template wherever possible
The alert block content and style for the transaction status after
payment were computed in two different places: In the dedicated
`payment.transaction_status` QWeb template, and in the
/payment/confirmation` route's controller which, for some reason, was
re-inventing the wheel instead of relying on the dedicated template.
This commit combines the slightly different behaviors in the template
and gets rid of the duplicated logic in the controller to:
- Handle the states 'draft' and 'error'.
- Always show the transaction's state message, and not only when the
  transaction was in a state for which there exists no pre-defined
  message (`draft` and `error`).

task-2924873

closes odoo/odoo#96348

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-07-26 15:48:53 +02:00
Horacio Tellez c1aa010af7 [IMP] payment: filter out acquirers based on the amount
This commit adds the possibility to define a maximum payment amount that
a given acquirer can process. If the payment amount exceeds the value,
the acquirer is filtered out of the available acquirers listed on the
payment forms.

While we're at it, the field `country_ids` is renamed to
`available_country_ids` to better depict that it is not a property of
the acquirer, but a configuration option. It will also be coherent with
the field `available_currency_ids` that is expected to be added soon.

Task - 2162165

closes odoo/odoo#82411

Related: odoo/enterprise#24412
Related: odoo/upgrade#3703
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-07-26 13:24:57 +02:00
Laura Schauer 6965066e9c [IMP] payment: allow (un)publishing of payment acquirers
Before this commit, it was impossible to migrate from one payment
acquirer to another as the only way to do so was to change a payment
acquirer’s state to ‘disabled’, subsequently disabling all tokens of that
acquirer (detrimental for eg. running subscriptions).

After this commit, payment acquirers have an additional boolean
‘Published’. With this functionality, users can safely migrate by
keeping an acquirer ‘enabled’, but invisible for customers.

There are five combined states an acquirer can take:

‘enabled’ & ‘published’: Visible to all users
‘enabled’ & ‘unpublished’: Visible only to internal users
‘disabled’ & ‘unpublished’: Same as previously ‘disabled’
‘test’ & ‘published’: Same as previously ‘test’
‘test’ & ‘unpublished’: visible only to internal users

task-2871459

closes odoo/odoo#94242

Related: odoo/upgrade#3688
Related: odoo/documentation#2308
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-07-19 20:12:58 +02:00
Valentin Chevalier a26ff947ff [FIX] payment: show the specific message for authorized transactions
When a customers paid a transaction through the `/payment/pay` route and
the transaction was authorized, the message for confirmed transactions
would be shown on the `/payment/confirmation` route instead of the one
specific to authorized transactions.

task-2527323

closes odoo/odoo#78843

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-07-19 20:12:55 +02:00
Laura Schauer 2ee4251d07 [IMP] payment(_adyen, _authorize): disable tokens of disabled acquirers
Before this commit, zombie payment tokens (= tokens linked to disabled
acquirers) could still
1) be used by internal users and
2) reactivated when the acquirer’s state changed to ‘test’ or ‘enabled’.
This is not desirable because zombie tokens should neither be used,
nor reactivated.

After this commit, all tokens related to an acquirer are unassigned
from linked documents and archived as soon as the acquirer’s state is
changed to ‘disabled’. Creating a payment with an archived token is
prohibited. In addition, archived tokens cannot be un-archived anymore.

task-2649806

closes odoo/odoo#93774

Related: odoo/enterprise#28661
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-07-12 03:09:44 +02:00
David Tran c779ee3f26 [FIX] payment: cron miss online payments of long verification
Sometime Paypal took 3 or 4 days for some payment verification due to
weekend. This raises the retry limit days for 4 days instead of 2 to
solve the issue

closes odoo/odoo#95522

X-original-commit: 5aaaaf8f072b3f8ab66a269bb3dba02714b593ad
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-07-07 16:07:04 +02:00
Antoine Vandevenne (anv) 889fbffb7f [FIX] payment: hide the tokenization input when required by the provider
Due to an oversight, the "Save my payment details" checkbox was shown on
the inline payment form of SEPA Direct Debit acquirers, which should
never happen because the transaction is *always* tokenized with those.

With this commit, the `_is_tokenization_required` method is slightly
refactored to read the provider from the current `payment.acquirer`
record rather than from the kwargs. This conveniently fixes the issue
and prevents it from happening again elsewhere.

closes odoo/odoo#95519

X-original-commit: ebeebd87ed6d687b96dda3006b81356dfa76d0a0
Related: odoo/enterprise#29237
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-07-07 14:44:48 +02:00
Romeo Fragomeli 1fcd098af5 [REF] *: BS5: migration
Automated change made by a lot of RegEx to change all think that is
possible to automate.

https://getbootstrap.com/docs/5.1/migration

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:24 +02:00
Laura Schauer ace3c1e53c [FIX] payment: Standardize validation transaction reference
Before this commit, the reference of a validation transaction followed
this format: “validation-20220222072710”, which did not match the
standard format for refund transactions (”R-S000001”). Moreover, some
providers limit the length of transaction references which forced us to
truncate the quite long reference.

With this commit, future validation transactions will have a reference of
the format: “V-20220222072710”.

task-2830826

closes odoo/odoo#94921

Related: odoo/enterprise#29076
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-07-06 17:10:07 +02:00
Valentin Chevalier b5dab9b119 [IMP] account_payment: hide pay button when paid
Hide the 'Pay Now' button for invoices which transactions total amount
equals their total amount.

When the total amount of all transactions related to the invoice is
equal to or greater than the total amount of said invoice, the 'Pay Now'
button should no longer be displayed.

task-2527323

closes odoo/odoo#95262

X-original-commit: de81225d39e7951ea9a63e24bab3a0138a6942e3
Signed-off-by: Achraf <abz@odoo.com>
2022-07-05 12:42:33 +02:00
Valentin Chevalierandxlu-odoo 2d81dffd23 [IMP] payment_test: support all additional features
After the payment apocalypse, `payment_test` was cleaned and stripped of
all useless parts. It was a very basic testing acquirer that allowed to
enter fake arbitrary payment details, choose whether they should be
tokenized, and then pay. It was intended to test the payment flow of
various applications (Sales, Subscriptions, Invoicing, ...) for a single
scenario: successful payments with immediate capture.

In order to extensively test an app's payment flow (explore other
scenarios), we need `payment_test` to have additional features.

Now, `payment_test` will allow profound testing of these features:
- separate authorization and capture
- customer fees computation
- tokenization
- refunds
- on the /pay page, users will be able to select the status of the
  payment
- on the payment transaction form view, users can change the status of
  a payment 'pending' to either succeed or fail
- on the payment token form view, users can change the state of future
  transactions made with that token

task-2512196

closes odoo/odoo#78083

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Co-authored-by: xlu-odoo <xlu@odoo.com>
2022-07-01 19:37:10 +02:00
Victor Feyens 49fb5e111a [FIX] payment: unexpected test behavior
Some payment tests were unexpectedly relying on the 'transfer' payment acquirer
to work because of a multi-company issue in the core payment tests setup.

This commit fixes the problem and adds an additional check in the tests to
make sure they rely correctly on the 'dummy' acquirer created in the payment
tests common.

closes odoo/odoo#94972

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-06-30 18:52:44 +02:00
Aaron Bohy 4f984568e1 [REF] *: adapt code to new kanban view
This commit makes various adapations in addons with respect to
the introduction of the owl kanban view. Mainly, some selectors
in scss and in tests needed to be adapted. Moreover, in some tests
that we haven't adapted yet, we must ensure that legacy form and
list views are still used (useLegacyViews).

It also contains some adaptations in kanban templates, e.g. the
replacement of moment by luxon, the removal of underscore...

Part-of: odoo/odoo#92475
2022-06-30 09:29:45 +02:00
Sebastien LANGE 475f98421b [FIX] payment: rounding approximation in to_minor_currency_units method
Before this commit, the `major_amount` was rounded before the conversion
to the minor currency unit, leading to an approximation error when
multiplying a float.

After this commit, the conversion of the `major_ amount` to the minor
currency unit is done before the rounding, ensuring no float approximation.

closes odoo/odoo#94698

X-original-commit: 4a4e0129c09e2db11c46a90a07704dc37cb4fb20
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-06-28 14:06:03 +02:00
Wolfgang Taferner 873add0dd6 [FIX] payment: if image is missing icon view will crash
closes odoo/odoo#93533

X-original-commit: e0fe725df5e2522c1abf3e7c1fec6f3c1696e35c
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Wolfgang Taferner <w.taferner@wtioit.at>
2022-06-17 19:30:58 +02:00
Antoine Vandevenne (anv) 06084a8420 [FIX] payment: stop preventing non-admin users from deleting views
closes odoo/odoo#93532

X-original-commit: bc90dbb577c974c5b9c3a429ef8379e8af1a9ca7
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-06-17 14:14:19 +02:00
Antoine Vandevenne (anv) 33ae932413 [FIX] payment: fix broken call to ensure_one
closes odoo/odoo#93448

X-original-commit: f1be16ffe6a65aa85bc35443b09e517161244559
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-06-13 16:51:39 +02:00
Martin Trigaux 5acb6db891 [I18N] *: export saas-15.4 source terms
closes odoo/odoo#93246

X-original-commit: 5ff6d185f70650c26c28a6aef7dd37c859ab58d2
Related: odoo/enterprise#28218
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-06-10 07:27:26 +02:00
Alvaro Fuentes d5f2fc2e37 [FIX] payment: fix misplaced sudo
On 02eba891cb8cd58985837090f2b60cf263bce065
we changed
https://github.com/odoo/odoo/blob/b5cf1ee3e21f2e60b8edd64f24c04c952fb7df3f/addons/payment/models/account_payment.py#L47
to
https://github.com/odoo/odoo/blob/02eba891cb8cd58985837090f2b60cf263bce065/addons/payment/models/account_payment.py#L47-L48
Effectively moving the place where `sudo` is called.

This causes issues during migration of some DBs
upg-328570

closes odoo/odoo#92651

X-original-commit: 90c321cc8bad04f7f094a221a39ca6f647944f5d
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-06-01 16:26:32 +02:00
Horacio Tellez 557a3e28ed [IMP] payment, sale: prevent paying for a canceled SO/invoice
Before this commit, sales orders/invoices that had been canceled could
still be paid from a payment link. Now, when trying to pay for a
canceled sales order/invoice, the amount to pay is set to zero.

Task - 2735019

closes odoo/odoo#85728

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-06-01 15:22:55 +02:00
Horacio Tellez e4c63126b4 [ADD] payment_authorize: add refund for Authorize.
Users can now ask for a refund from Odoo for their transactions done
through Authorize.net. A refund will be triggered from Odoo when
necessary.
Only full refunds are possible.
Note that unsettled transactions will be voided as they cannot be
refunded.

Task - 2678757

closes odoo/odoo#92279

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-06-01 13:13:55 +02:00
Victor Feyens 987b0d49f9 [IMP] payment: clean test utils
All utilitary test methods will be private, to clearly separate
test methods and utils.

Task - 2848326

Part-of: odoo/odoo#90716
2022-05-31 19:17:20 +02:00
Victor Feyens 5ac5b2ea96 [MOV] payment: rename test files
`test_payments` -> `test_account_payment`
`test_transactions` -> `test_payment_transaction`

Task - 2848326

Part-of: odoo/odoo#90716
2022-05-31 19:17:19 +02:00
Victor Feyens 677589d01f [IMP] payment: merge common into unique test class using it
The multi-company common of payment was only used in a single specific
test class of the same module.  Since we don't aim to test multi-company
flows in specific payment_ modules, we might as well remove the common
and move the setup content in the only class using this common.

Task - 2848326

Part-of: odoo/odoo#90716
2022-05-31 19:17:19 +02:00
Victor Feyens 26976477c4 [IMP] payment: simplify test commons
During the payment pocalypse, new tests common were introduced. Those
commons were split into different classes to be as modular as possible
but we noticed during the following months (/year) that they weren't so
easy to understand and use.

Therefore, this commit aims to simplify those commons by removing the
core PaymentTestUtils common, integrating it in the base PaymentCommon,
and making the HttpCommon depend on the core PaymentCommon, instead of
using only the utils.

This doesn't require much changes in the tests since they all used
either the PaymentCommon or both PaymentCommon and PaymentHttpCommon.

Task - 2848326

Part-of: odoo/odoo#90716
2022-05-31 19:17:19 +02:00
Antoine Vandevenne (anv) 94bddadf4e [ADD] payment_flutterwave: integrate with "Flutterwave standard" gateway
See README for technical details.

task-2759117

Part-of: odoo/odoo#85514
2022-05-31 16:02:08 +02:00
Raphael Collet 6cf8db906f [REF] *: adapt code to new flush API
closes odoo/odoo#87527

Related: odoo/upgrade#3497
Related: odoo/enterprise#26939
Signed-off-by: Raphael Collet <rco@odoo.com>
2022-05-25 18:00:47 +02:00