Commit Graph
1311 Commits
Author SHA1 Message Date
Valentin Chevalier 46be53f2c1 [FIX] payment,sale: access error in payment link
When a user was opening the payment_link_wizard and tried to select a
preferred payment acquirer, he was getting an AccessError telling that
he was not allowed to access 'payment.acquirer' records.

Fix PR #69334 (task-2504225)

task-2666881

closes odoo/odoo#80005

X-original-commit: 2ff580c073ac105219582dbf2108a1437645c9b5
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2021-11-18 18:45:11 +00:00
Victor Feyens ab022ec12d [FIX] *: target v15.0 documentation with doc links
X-original-commit: acc95ec204baa1dddbe292c379a1768fe1deccbf
Part-of: odoo/odoo#77923
2021-10-07 17:59:52 +00:00
Demesmaeker 11433284cf [FIX] payment_(adyen, authorize): fix traceback and tune the refund
- This replaces the name of `refund_amount` to `amount_to_refund`
for a variable that was renamed elsewhere, which caused a traceback.
- Adyen and authorized `_send_refund_request` now have their return,
as their parent.
- When a refund is initiated from Adyen, it's now easier to change
the merchant reference, thus, we can't count on it anymore to get
the source transaction.
- Fix the automatic refund for authorize.net with the manual capture

task-2634184

closes odoo/odoo#77916

X-original-commit: 747dbf44f37407fd415af645dac652199ac7fa6b
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2021-10-05 18:05:46 +00:00
Valentin ChevalierandVictor Feyens 1ded4e3689 [FIX] payment: add req param to the landing route
When a payment is made, add required parameters to the landing route.

This issue was introduced with 7fccbac

task-2645216

X-original-commit: cfcf4c64caac951783a1b39b63c024028b07b434
Part-of: odoo/odoo#77874
Co-authored-by: Victor Feyens<vfe@odoo.com>
2021-10-05 15:41:33 +00:00
Denis Ledoux d979f5970d [FIX] payment: compute methods shouldn't write
`compute` shouldn't write things. This means `writes` can occur
just by reading records.

Instead, when you want to assign multiple compute fields at once,
`update` should be used.

```
2021-10-04 12:42:21,132 61 ERROR db_40421 odoo.upgrade.base.tests.test_mock_crawl: FAIL: TestCrawler.test_check
Traceback (most recent call last):
  File "/tmp/tmpn37k1zm_/migrations/testing.py", line 208, in test_check
    self.check(value)
  File "/tmp/tmpn37k1zm_/migrations/base/tests/test_mock_crawl.py", line 85, in check
    self.assertFalse(diff, msg)
AssertionError: [('payment.payment_acquirer_menu', 217, 'Accounting > Configuration > Payments > Payment Acquirers', 312)] is not false : At least one menu or view working before upgrade is not working after upgrade.

('payment.payment_acquirer_menu', 217, 'Accounting > Configuration > Payments > Payment Acquirers', 312):
 Traceback (most recent call last):
   File "/home/odoo/src/odoo/15.0/odoo/api.py", line 879, in get
    return field_cache[record._ids[0]]
 KeyError: 8

During handling of the above exception, another exception occurred:

 Traceback (most recent call last):
   File "/home/odoo/src/odoo/15.0/odoo/fields.py", line 1057, in __get__
    value = env.cache.get(record, self)
   File "/home/odoo/src/odoo/15.0/odoo/api.py", line 882, in get
    raise CacheMiss(record, field)
 odoo.exceptions.CacheMiss: 'payment.acquirer(8,).show_credentials_page'

During handling of the above exception, another exception occurred:

 Traceback (most recent call last):
   File "/tmp/tmpn37k1zm_/migrations/base/tests/test_mock_crawl.py", line 182, in crawl_menu
    self.mock_action(action_vals)
   File "/tmp/tmpn37k1zm_/migrations/base/tests/test_mock_crawl.py", line 293, in mock_action
    mock_method(model, view, fields_list, domain, group_by)
   File "/tmp/tmpn37k1zm_/migrations/base/tests/test_mock_crawl.py", line 319, in mock_view_form
    [data] = record.read(fields_list)
   File "/home/odoo/src/odoo/15.0/odoo/models.py", line 3227, in read
    return self._read_format(fnames=fields, load=load)
   File "/home/odoo/src/odoo/15.0/odoo/models.py", line 3247, in _read_format
    vals[name] = convert(record[name], record, use_name_get)
   File "/home/odoo/src/odoo/15.0/odoo/models.py", line 5867, in __getitem__
    return self._fields[key].__get__(self, type(self))
   File "/home/odoo/src/odoo/15.0/odoo/fields.py", line 1106, in __get__
    self.compute_value(recs)
   File "/home/odoo/src/odoo/15.0/odoo/fields.py", line 1265, in compute_value
    records._compute_field_value(self)
   File "/home/odoo/src/odoo/15.0/odoo/models.py", line 4249, in _compute_field_value
    getattr(self, field.compute)()
   File "/home/odoo/src/odoo/15.0/addons/payment_transfer/models/payment_acquirer.py", line 21, in _compute_view_configuration_fields
    super()._compute_view_configuration_fields()
   File "/home/odoo/src/odoo/15.0/addons/payment/models/payment_acquirer.py", line 168, in _compute_view_configuration_fields
    'show_cancel_msg': True,
   File "/home/odoo/src/odoo/15.0/addons/payment_transfer/models/payment_acquirer.py", line 41, in write
    res = super().write(values)
   File "/home/odoo/src/odoo/15.0/addons/payment/models/payment_acquirer.py", line 234, in write
    self._check_required_if_provider()
   File "/home/odoo/src/odoo/15.0/addons/payment/models/payment_acquirer.py", line 260, in _check_required_if_provider
    _("The following fields must be filled: %s", ", ".join(field_names))
 odoo.exceptions.ValidationError: The following fields must be filled: Email
```

upg-40421

closes odoo/odoo#77752

closes odoo/odoo#77827

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2021-10-05 12:36:04 +00:00
Olivier Dony 2cf2b8cb6f [FIX] payment: fix access error in tx processing
The `callback_hash` and `callback_is_done` fields are not accessible
for non-admin users, so it will cause an access error whenever trying
to verify the hash inside `_execute_callback()`, and when marking the
callback execution successful.

Accessing it as `sudo` like other restricted transaction fields solves
the problem, and is safe, as the value is never leaked outside the
function.

Introduced in 573ed74c12.

closes odoo/odoo#77737

X-original-commit: 743031ed400b26f05775fc01c04ff63ef597a723
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2021-10-04 15:31:27 +00:00
Martin Trigaux ef8ad324b0 [I18N] *: export 15.0 source terms
closes odoo/odoo#76542

X-original-commit: 63e6807437295519a0f4705fb88644d6d557ca3a
Related: odoo/enterprise#20882
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-09-16 07:17:40 +00:00
Noe Antoine 2c9a76e3a5 [IMP] mass_mailing_sale, * : make fa icons (cart, card, ...) consistent
*: mrp_subcontracting_purchase,payment,purchase_(stock)

BEFORE THIS COMMIT

fa-shopping-cart was used for different purchase-related contexts.
This icon should only be used for online shopping / ecommerce.

AFTER THIS COMMIT

Wa make sure one icon is used for one concept.
- fa-shopping-cart : ecommerce / add to cart
- fa-credit-card : purchases
- fa-credit-card-alt : replaces other uses of fa-credit-card
- fa-pencil-square-o : quotations in marketing modules

Icons are updated accordingly. Other icons are also changed to
increase readablity.

--- Links ---

Task Id - 2593306
COM PR - odoo/odoo#75694
ENT PR - odoo/enterprise#20478

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-09-08 07:55:53 +00:00
Victor FeyensandAntoine Vandevenne (anv) fbfd99e680 [REM] adyen_platforms, *: remove Odoo Payments modules
*: extensions of `adyen_platforms`, namely:
   - pos_adyen: remove related code, records, views, ...
   - payment_odoo: remove the module
   - sale_payment_odoo: remove the module

Modules related to Odoo Payments are already all merged since 14.0 and
14.4 (depending on the module). As the plan is to merge the final
version of Odoo Payments in 15.0 soon after the release, we want to
avoid all the complications that inevitably come with huge diffs, model
changes, XMLID collisions, etc. when merging in a stable version. Even
though it is possible to install these modules since 14.0, no
information could be lost during the upgrade since the entry point of
the application has never been activated.

task-2637770

closes odoo/odoo#75852

Related: odoo/upgrade#2804
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Co-authored-by: Antoine Vandevenne (anv)
2021-09-06 14:35:58 +00:00
Benoit Socias 7fccbac004 [IMP] payment, website_payment: perform the donation payment
This commit adds /donation/* routes to perform the donation:
- /pay: shows the form with the contact details and donation details
- /transaction: creates the partner_id if missing and executes the
transaction
- /confirm: displays the payment success page

PR-63133

task-2398403

Part-of: odoo/odoo#63133
2021-09-03 02:03:15 +00:00
Parth GajjarandKishan Gajjar 6e67c17538 [ADD] payment_mollie: added mollie payment acquirer
closes odoo/odoo#74136

Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
Co-authored-by: Kishan Gajjar <kig@droggol.com>
2021-09-01 11:05:44 +00:00
Demesmaeker e0233a1010 [IMP] payment(_adyen): allow to refund confirmed transactions
Before this commit, it was not possible to refund a payment from Odoo.
Users had to go through the payment acquirer's backend and update the
payment accordingly in Odoo.

With this commit, refunds are made available in Odoo directly from the
payment form, for acquirers that support them. Acquirer can either only
support full refunds or also support partial refunds.

As of now, the only acquirer allowing refunds is Adyen, with partial
refund support.

task-2527891

closes odoo/odoo#70881

Related: odoo/upgrade#2689
Related: odoo/enterprise#19829
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
2021-08-23 10:54:17 +00:00
Nicolas (vin) f7b45aa032 [FIX] payment: suitable payment token and acquirer fix
Fix two issues:

The search of suitable payment token was searching on the journal_id
field of the payment acquirer that is no longer stored.
Change it to now search on the acquirer_id directly, since we have
this information.

The _inverse_journal_id method on payment acquirers would create
new payment line with the manual payment method when no provider
are given to an acquirer, or no payment method is existing for
a given provider. This would cause issues with the creation of
multiple line with the same name on a same journal, which would
trigger the constrains blocking that.

closes odoo/odoo#74990

X-original-commit: a3a2fcb0b299fafbf359ec9015da5c85cdb57b3a
Related: odoo/enterprise#20193
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-08-12 07:56:16 +00:00
Antoine Vandevenne (anv) dbefe34af5 [IMP] payment(_authorize): rework validation transactions refund flow
Before this commit, the validation flow with verification (payment of a
small amount with immediate refund) was performed with the use of
validation routes: after payment, the customer was redirected to the
validation route stored on the transaction to trigger the refund. This
implementation had an issue: if the customer never reached the
validation route, they were not refunded their validation amount. This
could happen if the customer closed the tab after paying with an
acquirer offering payments with redirection, or if the validation
payment was asynchronously confirmed through a webhook notification.

This commit gets rid of validation routes and requires acquirers to
immediately refund the validation amount when the payment is confirmed.
This way, a payment confirmation coming from a webhook can trigger the
refund too.

As the only acquirer that implements the validation with verification
flow, Authorize.net now voids validation transactions as soon as they
are authorized.

While we're at it, the logging of processing values is adapted to only
log specific rendering values if a redirect form is rendered.

task-2612977

closes odoo/odoo#74707

Related: odoo/enterprise#20060
Related: odoo/upgrade#2710
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
2021-08-04 13:03:27 +00:00
Arnaud Baes 98c403a1bf [FIX] payment: _inverse_journal_id behaviour when missing a payment_method
When computing the inverse of `journal_id` on a batch of
`payment.acquirer`, a payment method is created if there isn't any.
As this process can only be done for one acquirer at a time, we must
populate the data accordingly.

closes odoo/odoo#74668

X-original-commit: 493b1ca54d6831f044726b2d8942e7e7f7ce3098
Signed-off-by: William André (wan) <wan@odoo.com>
2021-08-03 17:47:18 +00:00
Xavier-Do 288595f558 [FIX] *: add explicit license to all manifest
The license is missing in most enterprise manifest so
the decision was taken to make it explicit in all cases.
When not defined, a warning will be triggered starting from
14.0 when falling back on the default LGPL-3.

closes odoo/odoo#74245

Related: odoo/design-themes#48
Related: odoo/enterprise#19862
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2021-07-26 13:09:57 +00:00
Antoine Vandevenne (anv) 9dcaa4cc70 [FIX] payment: show tokens in the manage form even without any acquirer
This commit fixes the /my/payment_method page which wouldn't show
available tokens if not suitable acquirer was found.

task-2494916

closes odoo/odoo#74039

Related: odoo/enterprise#19769
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
2021-07-26 13:41:15 +00:00
Antoine Vandevenne (anv) 6df3cdaaa7 [IMP] payment: make the distinction between tokenization and validation
Before this commit, it was not possible for an acquirer to support
tokenization while not supporting validation because the acquirer would
be thought to be compatible with either flow based on the
`support_tokenization` field. This was a false assumption because some
acquirers, such as Ogone, can offer to tokenize a payment method in
payment with redirection flow while not allowing tokenizing a payment
method for future usage, without payment.

Note that this was not an issue for acquirers supporting the direct
payment flow because they could either support validation natively, or
seamlessly charge a small amount and refund it immediately to tokenize a
payment method.

This commit makes it possible for a module implementing the validation
operation to filter acquirers based on whether they support it,
regardless of their support for tokenization.

task-2494916
2021-07-26 13:38:49 +00:00
Kevin Baptiste 86aa7b78aa [IMP] *: introduce data-hotkey on form and modal views
Define `data-hotkey` on most used action buttons.

For the modals, the following keys are dedicated for "special"
actions:
 - Alt+G: add
 - Alt+V: save
 - Alt+Z: cancel

closes odoo/odoo#73275

Taskid: 2588233
Related: odoo/enterprise#19464
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-07-15 08:39:49 +00:00
Xavier Morel 492fcca54c [FIX] payment: de-traw-ify
Mark `display_message` (feedback from payment provider) as markup-safe.
2021-07-20 05:41:36 +00:00
Xavier Morel 67e7190611 [IMP] *: convert dialog title to t-out
Need to check and mark legit uses of HTML as Markup. Also fix some
title formattings which are not great (mostly around translations) and
de-escape titles which don't need to be escaped anymore.
2021-07-20 05:41:30 +00:00
Xavier Morel 27b02d2ec9 [FIX] web, *: de-t-raw kanban views
Add HTML fields support to kanban view (currently bespoke but maybe it
should be done via `format`), and remove t-raw for HTML fields there.

Also just strip some t-raws which were completely unnecessary to start with
2021-07-20 05:40:55 +00:00
Nicolas (vin) 9e432ed243 [FIX] account, payment: Various fixes for account payments/method lines
There is an issue when computing the suitable payment token ids making it impossible to
open a payment for a user without access to payment acquirers.

Also, the default computation of payment token was wrong and would never set it
correctly.

The compute for the method lines in payment would not filter unavailable acquirers
line and thus select them by default if they were first in line.

Also fix an issue with the ordering of payment method lines

X-original-commit: 73410a0fd76a70e1730883d35b79fc603741b59c
2021-07-19 15:17:32 +00:00
Laurent Smet e2fdac55f6 [FIX] payment: Fix payment access rights for not admin users
The journal needs to access the payment acquirers to determine with payment method is still available.
Since the acquirers can't be accessed only for admin users, an accountant doesn't any right to read them, and then, an access error was raised when opening the journal form view.

Also, the 'payment.acquirer' was accessed from the 'account' module instead of being overridden in 'payment'.

closes odoo/odoo#73761

X-original-commit: 7b4580c3756657c902eceb9840984dde76429dcd
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-07-15 10:50:14 +00:00
Nicolas (vin) 3a98bf80ec [FIX] account: payment method dependencies
Change dependencies of a few computed fields in order
to avoid triggering them wrongly when migrating.

Also add a company check on the constrains blocking
deletion of payment method lines linked to an active
acquirer.

closes odoo/odoo#73731

X-original-commit: e94b4f09a4c5664360594bee6475cb2ef756be47
Related: odoo/enterprise#19663
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-07-14 15:22:31 +00:00
Demesmaeker 9612ede9ca [IMP] sale, payment: improve the UI
Small UI improvements for clarity/continuity:
1. In the "Sales' onboarding wizard > payment configuration >
documentatlion link", font roboto is now used.
2. In the sales order, the error message when 'there is nothing
to invoice' now also explains also what the user has to do to invoice
"Prepaid" services.
3. In the "Payment confirmation" section of the payment portal,
'Reference', 'From' & 'Amount' fields don't look like editable
fields anymore.
4. In the payment forms, tokens created with the Test acquirer
are now identified with a "Test Token" badge in place of the
verified token checkmark.

task-2505913

closes odoo/odoo#70076

Related: odoo/enterprise#18036
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
2021-07-14 09:34:43 +00:00
Nicolas (vin) c1693581d7 [IMP] account: payment method improvements
To improve the payment method system, proceed to a few changes
such as changing the view a bit, making sure payment acquirers are not
linked to a journal by default and that only the manual payment method
type can be used multiple times in a single journal.

Task id #2573145

closes odoo/odoo#73596

X-original-commit: 9122b367baea10e59b66e45bf7c458a6f1e82efb
Related: odoo/enterprise#19623
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2021-07-12 18:10:36 +00:00
Martin Trigaux 6758868731 [I18N] *: export saas-14.4 source terms
Without demo data

closes odoo/odoo#73560

X-original-commit: 802e46541117573e028b711ea33dad9df9075a39
Related: odoo/enterprise#19602
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-07-12 10:57:37 +00:00
Victor Feyens 21b5101319 [FIX] payment: accept invoice ids in payment links
This commit brings back the possibility to pass invoice ids in payment
links, a feature that was lost with commit 573ed74c. If such an id is
present in the payment link URL, the transaction that is created must
have a reference starting with the name of the invoice, and must be
linked to it.

task-2494916

closes odoo/odoo#72992

X-original-commit: 6c13a361400332955cdf5ac5a14bd1970b4f66ef
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2021-06-30 11:42:43 +00:00
Antoine Vandevenne (anv) 1b2c7cbb43 [FIX] payment, payment_ogone: bring back the Hosted Payment Page API
With commit 139dd9d, the Hosted Payment Page API of Ogone was entirely
replaced by the FlexCheckout API. This new API allows customers to
tokenize a payment method for a later use without the need of making a
purchase. However, it proved itself to be less convenient for regular
purchases as it offers less payment options than the HPP, and payments
are no longer cardholder-initiated transactions but merchant-initiated
transactions which have a higher chance of triggering an authentication
check. Furthermore, the payment flow itself is more complicated than
before.

This commit brings back the Hosted Payment Page API to work in parallel
with the FlexCheckout API and the other APIs that were left untouched.
It will be exclusively used for making online payments with a new card.
The validation flow is managed by the FlexCheckout API while the
DirectLink API manages the payment by token and offline payment flows.

task-2494916

closes odoo/odoo#72991

X-original-commit: 4fa7b772c71979f61eb098ff8d005deba834527c
Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
2021-06-30 12:18:50 +00:00
Xavier Morel ded278b9c2 [FIX] core: have HttpCase automatically set the base url
While HttpCase did set `web.base.url` before starting a browser, in
the non-browser test cases (or cases which would mix browser and
non-browser) it would not do so.

This is an issue when installing the database with one http-port and
running tests with an other e.g. after duplicating the database (or
even not duplicating it) in order to run multiple test instances
concurrently, which requires using different http ports.

Tests would then see the base url generated during installation,
embedding the port used at installation, and would break weirdly (at
best exploding due to not finding any server to bind to, and at worst
making request on the wrong instance entirely). Simply updating the
base url during setup seems to fix most of the tests.

Notes:

* Some tests (e.g. survey) don't flush() their create/update before
  calling `start_tour` or `browser_js`, the implicit flush because of
  the ICP handled the issue. Perform an explicit flush of base
  (similar to `url_open`) to ensure they keep working correctly.
* `url_join` should handle absolute URIs correctly, it does imply
  slightly different semantics in case the `base_url` has a non-empty
  path, but that seems like a very limited risk (and possibly
  convenient to boot).
* `payment` needed a fix because the vagaries of the MRO led to the
  extra parameter internally used by the thing to be passed to
  `HttpCase`'s `setUpClass`, which would not expect it.

closes odoo/odoo#72645

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2021-06-25 09:13:49 +00:00
Valentin Chevalier 24fa119533 [FIX] payment: restore the delay before post-processing a transaction
Since the payment post-processing cron runs every ten minutes, it is
important that it ignores the transactions that were updated in the same
last ten minutes. This is necessary because customers can only see the
payment confirmation message for transactions that were not already
post-processed.

Commit 573ed74 mistakenly changed the post-processing delay from ten
minutes to one minute. This commit changes it back to 10 minutes.

task-2494916

closes odoo/odoo#72742

X-original-commit: 502a13b87971b0bf36493770dd3bcb4f9d9b7c2a
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
Signed-off-by: Valentin Chevalier <chevalierv@users.noreply.github.com>
2021-06-24 16:14:10 +00:00
Victor Feyens 109745eac8 [FIX] payment: "Installed" search filter not working as expected
The "Installed" filter domain in the search view payment.acquirer was wrong,
showing only uninstalled acquirers.

Task Id - 2494916

closes odoo/odoo#72487

X-original-commit: 9082e36a9b150ded361f26beff5525b31738e0e0
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2021-06-21 18:13:19 +00:00
Antoine Vandevenne (anv) 2327aa461d [IMP] payment: prevent validation transactions from creating payments
Before commit 139dd9d, only validation transactions made with a validity
check (transfer of a small amount with immediate refund) led to the
creation of an `account.payment` record for the reconciliation. As that
amount was never perceived, there was in fact nothing to reconcile.

With commit 139dd9d, it is possible to make $0-validations (the validity
check is handled by the provider). As this feature now sheds light on
the flawed behavior described above, it has been decided to entirely
stop creating `account.payment` records for validation transactions.

This commit thus prevents the post-processing of validation transactions
from preparing their reconciliation.

task-2494916

closes odoo/odoo#72137

X-original-commit: f460d7a5a995cd7b934d32f82b50aede43efbace
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
2021-06-14 13:49:51 +00:00
Antoine Vandevenne (anv)andToufik Ben Jaa 1969d48f15 [FIX] payment: don't send customer IP address when running a cron
If a payment request is made from a cron (e.g., Subscriptions' cron for
recurring payments), the worker is not bound to an HTTP request and
therefore the value of `request.httprequest.remote_addr` is an instance
of the 'LocalProxy' object, which is not serializable.
If we're in this scenario, don't send the customer IP address.

task-2494916

closes odoo/odoo#71717

X-original-commit: e85464ad2281f25cbaf7ded0c1e5d7659a322696
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
Co-authored-by: Toufik Ben Jaa <tbe@odoo.com>
2021-06-04 06:54:28 +00:00
Nicolas (vin) 04522f01e6 [IMP] account: allows multiple payment acquirers on a journal.
Users may want to be able to have transactions coming from multiple
payment acquirers to be registered in the same journal.

This will allows that.

Task id #2414749

closes odoo/odoo#67331

Related: odoo/upgrade#2500
Related: odoo/enterprise#17258
Signed-off-by: William André (wan) <wan@odoo.com>
2021-06-03 10:00:26 +00:00
Kevin BaptisteandAntoine Prieels 208a82f344 [IMP] adyen_platforms,payment_odoo: add notification support
- Improved onboarding / KYC flow
    - Display KYC stage for each "document" (identity, bank account,
    shareholder, etc.)
    - Only update to the API what's been updated by the user to prevent
    undergoing another full round of data verification

- Show new pricing

- Support refund of adyen.transaction

- Simplify payouts (let Adyen automatically handle them)
    - They are now automatically handled by Adyen and not manually
    triggered by a cron

- "Balance" dashboard
    - Show the balance per currency
    - List of payouts and their status

- Handle account/transaction notifications
    - Show split of fees
    - Details on payment method (card country, card type, etc.) used
    - Display details from the linked payment.transaction

- Verify proxy signature for notifications
    - Notifications are now signed and authenticity verified

TaskID: 2129218
Closes odoo/odoo#68952

Co-authored-by: Antoine Prieels <anp@odoo.com>
2021-06-02 14:12:40 +00:00
Romain Derie 92175d3341 [IMP] *: replace web.base.url ICP by helper method
Previous commit introduce an helper to get the most suited URL for a record
instead of always using the ICP, which is not correct in a website context.

This commit replaces calls to ICP by the helper method.

Community: https://github.com/odoo/odoo/pull/68201
Enterprise: https://github.com/odoo/enterprise/pull/17538
Upgrade: https://github.com/odoo/upgrade/pull/2372

task-2476101
2021-06-02 10:04:29 +00:00
Fabrice Henrion 5f476a0f41 [FIX] payment: grammar issue
👮

Finetuning of #69334

closes odoo/odoo#71452

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2021-06-01 09:51:55 +00:00
Morgane DemesmaekerandValentin Chevalier 41b13d530f [IMP] payment, sale: add an acquirer dropdown when generating payment link
Actually, salesmen have to add manually the acquirer_id to the link, and it isn't user-friendly. The dropdown will show the possibility to add the acquirer_id.

Task #2504225

closes odoo/odoo#69334

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Co-authored-by: Valentin Chevalier <vcr@odoo.com>
2021-05-28 09:24:57 +00:00
Rushi Sathawar 6b9acb23bc [IMP] base: open upgrade apps page in a new tab
Currently, clicking on the "upgrade" button from Apps in community
opens the corresponding page in the same tab. As a consequence, the
user completely leaves his database and it can quickly become tedious
to get back to it.

so in this commit, clicking on the 'upgrade' button should open the
corresponding webpage in a new tab

closes odoo/odoo#70636

Taskid: 2513785
Signed-off-by: Arnaud Joset <arj-odoo@users.noreply.github.com>
2021-05-11 10:50:23 +00:00
Demesmaeker 5fd86a5c9f [IMP] payment: add a sequence to the payment icons
The user can reorder the payment icon to put his favorite forth.

task-2512101

closes odoo/odoo#69972

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2021-05-19 14:09:14 +00:00
Nasreddin (bon) 8e0a75ba15 [FIX] payment: enable pay button when clicking back button
Issue

    Use Safari (or equivalent) browser

    - Install e-commerce
    - Go to Website -> Configuration -> Payment Acquirers
    - Activate Ingenico in test mode
        (write aaa in required fields)
    - Go to shop, and add product to card
    - Go to checkout
    - Select Ingenico payment mode
    - Click on Pay button
    - When on the ingenico page, press back

    The page is blocked and the button is disabled.

Cause

    When clicking on Pay button, the page is locked and
    the button is disabled.
    With Chrome, when coming back to previous page,
    this one is regenerated and therefore adapt the button.
    In Safari, it is not the case.

Solution

    On `pageshow` event, if event have `persisted` attribute set to
    to true, meaning using cache, then reload page.

Fixes https://github.com/odoo/odoo/issues/69453

opw-2510281

closes odoo/odoo#70906

X-original-commit: c89224940bcc59aab4bddefa95b2b0ef7713e02f
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
2021-05-17 16:50:53 +00:00
Laurent Smet 41438824f7 [FIX] payment*: Make tests inheriting of AccountTestInvoicingCommon
This makes tests independant of any demo data and ensure the company configuration is always consistent.
2021-05-18 05:18:52 +00:00
Victor Feyens 0348b95aee [FIX] *: update documentation links
Following the recent reorganisation of the documentation in 12.0+,
the majority of the documents have been moved and their old links are no longer valid.
Some redirection rules will soon be deployed, but those rules might be dropped in some years
and we want the links to still work, which is why we still replace the links to the new ones.

FW-Port of odoo/odoo#70675 (13.0)

closes odoo/odoo#70920

X-original-commit: bc9c1eef538ba6095e74c19d5d9ed9e01625ec7c
Related: odoo/enterprise#18361
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2021-05-17 19:26:27 +00:00
Martin Trigaux 41d8b8cf68 [I18N] *: export saas-14.3 source terms
closes odoo/odoo#70673

X-original-commit: bcb9ff784e44462384b0a43a0a23eed7a1111bc5
Related: odoo/enterprise#18269
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-05-11 12:28:28 +00:00
Xavier Morel 79a4d11e24 [FIX] *: bunch of mismarked translation specifiers
`_(xyz)` will wrap them in an underscore.js object, which when used in
a string context will just return the string. So it's basically a
no-op, but it certainly doesn't translate the terms.

closes odoo/odoo#70476

X-original-commit: 92352ed2b5524c97b0aeeba3193c6a8d93ed82a1
Related: odoo/enterprise#18172
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-05-06 12:06:22 +00:00
Simon Genin (ges) ecfe85db84 [REF] web: static/src/(img|fonts) => static/(img|fonts) 2021-04-29 07:34:40 +00:00
Xavier Morel 8d2a8ff2c3 [FIX] payment: de-t-raw-ify
The *_msg fields are HTML fields so there's no reason to do anything.

A few of the values are a bit more debatable though:

* Thanks_msg seems pretty much never used?
* The `message` value comes from `state_message`, looking at how
  that's set it doesn't seem like there's any reason for it to ever
  contain markup?
2021-04-29 05:34:21 +00:00
Antoine Vandevenne (anv) c902e02317 [FIX] payment(_*), account_payment: fix post-refactoring issues
account_payment:
  - Processing fees computation was done based on the wrong country.
payment:
  - The acquirer's cancel message was missing from the
    /payment/confirmation page.
  - `redirect_form_view_id` field was declared with attribute 'name'
    instead of 'string'.
  - Uninstalling a payment acquirer would fail with a traceback.
  - The first acquirer was not automatically selected if it was the only
    selectable payment option of a 'manage' payment form.
  - Specifying a preferred acquirer to the /payment/pay page would show
    not acquirer at all if the preferred option was incompatible with
    the constraints, rather than falling back on showing all acquirers.
payment_adyen:
  - When the value of the API URL fields is malformed (e.g., missing the
    "https://"), clicking on the confirm button raised a traceback.
payment_ogone:
  - There was a typo in the return route.
payment_paypal:
  - PayPal acquirers were not filtered out if the currency was not not
    supported.
  - Returning to the webshop without paying would raise a traceback.

task-2494916

closes odoo/odoo#69996

X-original-commit: 4f7e463fb8b13506caa8aff0beeef5eb0720bf00
Related: odoo/enterprise#17997
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
2021-04-28 11:39:26 +00:00