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
closesodoo/odoo#80005
X-original-commit: 2ff580c073ac105219582dbf2108a1437645c9b5
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
- 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
closesodoo/odoo#77916
X-original-commit: 747dbf44f37407fd415af645dac652199ac7fa6b
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
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>
`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
closesodoo/odoo#77752closesodoo/odoo#77827
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
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.
closesodoo/odoo#77737
X-original-commit: 743031ed400b26f05775fc01c04ff63ef597a723
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
*: 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>
*: 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
closesodoo/odoo#75852
Related: odoo/upgrade#2804
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Co-authored-by: Antoine Vandevenne (anv)
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
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
closesodoo/odoo#70881
Related: odoo/upgrade#2689
Related: odoo/enterprise#19829
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
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.
closesodoo/odoo#74990
X-original-commit: a3a2fcb0b299fafbf359ec9015da5c85cdb57b3a
Related: odoo/enterprise#20193
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
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
closesodoo/odoo#74707
Related: odoo/enterprise#20060
Related: odoo/upgrade#2710
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
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.
closesodoo/odoo#74668
X-original-commit: 493b1ca54d6831f044726b2d8942e7e7f7ce3098
Signed-off-by: William André (wan) <wan@odoo.com>
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.
closesodoo/odoo#74245
Related: odoo/design-themes#48
Related: odoo/enterprise#19862
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
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
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
closesodoo/odoo#73275
Taskid: 2588233
Related: odoo/enterprise#19464
Signed-off-by: Kevin Baptiste <kba@odoo.com>
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.
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
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
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'.
closesodoo/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>
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.
closesodoo/odoo#73731
X-original-commit: e94b4f09a4c5664360594bee6475cb2ef756be47
Related: odoo/enterprise#19663
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
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
closesodoo/odoo#70076
Related: odoo/enterprise#18036
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
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 #2573145closesodoo/odoo#73596
X-original-commit: 9122b367baea10e59b66e45bf7c458a6f1e82efb
Related: odoo/enterprise#19623
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
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
closesodoo/odoo#72992
X-original-commit: 6c13a361400332955cdf5ac5a14bd1970b4f66ef
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
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
closesodoo/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>
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.
closesodoo/odoo#72645
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
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
closesodoo/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>
The "Installed" filter domain in the search view payment.acquirer was wrong,
showing only uninstalled acquirers.
Task Id - 2494916
closesodoo/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>
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
closesodoo/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>
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
closesodoo/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>
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 #2414749closesodoo/odoo#67331
Related: odoo/upgrade#2500
Related: odoo/enterprise#17258
Signed-off-by: William André (wan) <wan@odoo.com>
- 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
Closesodoo/odoo#68952
Co-authored-by: Antoine Prieels <anp@odoo.com>
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 #2504225closesodoo/odoo#69334
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Co-authored-by: Valentin Chevalier <vcr@odoo.com>
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
closesodoo/odoo#70636
Taskid: 2513785
Signed-off-by: Arnaud Joset <arj-odoo@users.noreply.github.com>
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
closesodoo/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>
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)
closesodoo/odoo#70920
X-original-commit: bc9c1eef538ba6095e74c19d5d9ed9e01625ec7c
Related: odoo/enterprise#18361
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
`_(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.
closesodoo/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>
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?
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
closesodoo/odoo#69996
X-original-commit: 4f7e463fb8b13506caa8aff0beeef5eb0720bf00
Related: odoo/enterprise#17997
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>