Commit Graph
465 Commits
Author SHA1 Message Date
Horacio Tellez 5badb3fca8 [IMP] payment(_*): normalize logs across all acquirers
The logs for payments contain the transaction reference whenever possible.
Before logs for transactions contained the reference or the id of the
transaction in an inconsitent way. No transactions are identified by
reference whenever possible.

The logs for payments for the same function on different acquirers should
have the same format. Same flow step for different acquirers had
information passed in different formats. Now at each step of a transaction
flow log messages have the same format regardless of the acquirer.

Overall the payment logs should have an uniform format. Hopefully
understanding log messages related to transactions should be easier, as
now log format is independent of the acquirer and transaction are easily
identified by reference.

Task - 2545450

closes odoo/odoo#79547

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2021-11-29 15:40:54 +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) 023e2e636c [FIX] payment_stripe: never assign one currency unit to validation txs
Before this commit, the payment function `_get_validation_amount` was
overridden by Stripe to specify a validation amount of one currency unit
while that amount was in fact never passed to Stripe in the validation
flow. The amount stored on the transaction was therefore incorrect.

This commits removes the override to let the default amount of 0 being
set on validation transactions.

task-2612977

closes odoo/odoo#74543

Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
2021-08-02 11:48:21 +00:00
Antoine Vandevenne (anv) 4f744fddc7 [FIX] payment_stripe: always answer with empty string to webhook events
Prior to this commit, not all operations of the Stripe webhook were
encapsulated in a try/except clause. If a `ValidationError` was raised
outside of that clause, it was returned as-is to Stripe.

This commit encapsulates the whole webhook event processing with a
try/except clause to make sure that only an empty string is returned to
Stripe, hence properly acknowledging events.

task-2612977
2021-08-02 08:32:41 +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
Nasreddin Boulif (bon) 919a441178 [FIX] payment_stripe: display clearer customer description
Issue:

  Payouts reference on Stripe are display as:
  `SUB123 - ODOO_PARTNER_456789`.

Cause:

  When making a Stripe request to create new customer, the description
  is formated as : `ODOO_PARTNER_456789` .

Solution:

  Replace customer description format as :
  `Partner: Mitchel Admin (id:456789)` .
  Inspired by: https://github.com/odoo/odoo/commit/3bc1e0175d85a70806999109e928c234e8cc2ca4

opw-2593621

closes odoo/odoo#74109

X-original-commit: 07033a07ca49923a1c5095c371302fb894363c07
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
2021-07-22 11:05:05 +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
Jeremy Kersten 478068c829 [IMP] *: always use Odoo Response
This branch adds request.redirect on all requests.
In case of a front end request, we do an url_for to the location.

We removed redirect_with_hash that was only for retro compatibility

local_redirect has been renamed to redirect_query, and param keep_hash has been
removed and moved.

Default code for redirect is 303 now instead of 302.

Now redirect and redirect_query make local redirect by default, you need to
pass local=False to make external redirect.

All werkeug.utils.redirect has been replaced by request.redirect.

Http.redirect now use an http.Response type, and it become easy to add an
override like 'set_cookies' e.g.

Dispatch of a website.page return an http.response too, so we first need to
check if it is a cached version before to check if it is an Odoo Response.

Migrate your code:

http.redirect -> request.redirect(location, code, local)
http.local_redirect -> request.redirect_query(location, query, code, local)
http.redirect_with_hash -> request.redirect

Courtesy of odony for help and review ;)

closes odoo/odoo#72599

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-07-08 07:00:06 +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
Antoine Vandevenne (anv) a2fa71a565 [FIX] payment_stripe: fix post refactoring issues
- The acquirer reference was never saved.
- Transactions with operation 'offline' were not processed.
- If Stripe rejected an offline payment, an exception would be raised.
  This lead to Subscriptions assuming that the processing itself failed
  and prevented the transaction to be processed. Instead, the exception
  is now caught and the transaction's state set to 'error'.

task-2494916

closes odoo/odoo#71602

X-original-commit: e93b3b3c5b9bc86768a5d26ed456ef11cfb40734
Related: odoo/enterprise#18680
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
2021-06-02 13:26:23 +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
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
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
Jorge Pinna PuissantandSamuel Degueldre f43a0814ae [IMP]*: configuration of ESLint for specific files
This commit will add the needed ESLint configurations on the JS files.
These configurations are added if the JS file uses a different
environment (serviceworker, node, etc) or if it uses a specific global
(google, ace, etc).

Co-authored-by: Samuel Degueldre <sad@odoo.com>
2021-05-04 13:32:49 +00:00
Valentin Chevalier 99e785b0d3 [FIX] payment_stripe: load Stripe.js library on the payment form
When the payment form is displayed, Stripe.js library isn't loaded, thus preventing the customer to pay online.

When the refactor of assets was done, the link to the Stripe library was moved to __manifest__.py.
As the link does not end with '.js', the file wasn't loaded anymore.

See PR #60632

closes odoo/odoo#69849

X-original-commit: 8535b090a36fe6472c4b3d8211f3be39c7f1c58a
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
Signed-off-by: Valentin Chevalier <chevalierv@users.noreply.github.com>
2021-04-26 14:21:11 +00:00
7cfb0e0e74 [MERGE] *: declare assets in manifest, not in xml
This PR changes the way assets are declared in Odoo modules.

Before: assets were declared in template files. Template bundles were
generated from primary templates, so technically any qweb template could
have been called as an asset bundle, with the 't-call-assets' directive.

Being standard qweb templates, they had access to standard HTML tags
(script, link, with or without raw scripts or style definition), qweb
directives (t-call, t-raw, etc.) and could be inherited by other
templates.

Now: assets are defined in the module's manifest and generated by the
't-call-assets' directive.

More information on the new system can be found on the updated user
documentation (see the "JavaScript Reference" section).

closes odoo/odoo#60632

Task: 2352566
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Lucas Perais <lpe@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Raphael Collet <rco@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
2021-03-31 17:15:51 +02:00
Julien MougenotandSimon Genin 03641610c2 [REF] *: convert all modules to new asset system
Conversion of all modules to the new manifest assets declaration.

Part of task: 2352566

Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
2021-03-31 13:57:18 +02:00
Nicolas Lempereur 86b189bfea [FIX] payment_stripe: special character in reference
Special character in reference (eg. '#' character in invoice sequence)
might cause error after payment not showing it was successful.

With this changeset, when a payment reference is used inside an url, we
quote it.

opw-2479658

closes odoo/odoo#68585

X-original-commit: 47645c2f170d5a7c09ae80d4e0de6c3a821f7b36
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-03-31 11:46:27 +00:00
Prakash PrajapatiandAntoine Vandevenne 4bb840403b [REF] payment_stripe: migrate Stripe to the new payment API
This commits drops the direct payment flow supported by the SetupIntent
API in favor of the payment with redirection flow, supported by the
Checkout API only.

See the merge commit for more details.

task-2333040

Co-authored-by: Antoine Vandevenne <anv@odoo.com>
2021-03-30 09:25:51 +02:00
Martin Trigaux ade40f9028 [I18n] *: export saas-14.1 source terms
closes odoo/odoo#64393

X-original-commit: eaf7ec38b2f13b044768ccb457c5523cd24753f6
Related: odoo/enterprise#15693
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-01-12 10:38:54 +00:00
Goffin Simon a767c5155b [FIX] payment_stripe: Bancontact with mobile
Steps to reproduce the bug:

- Let's make a bancontact payment with Stripe on mobile from the web shop
- Stripe redirects you to Odoo
- Your phone asks on which browser you wanted to redirected to Odoo
- Choose one

Bug:

An internal error was raised.

When you clicked on a browser (the same you were using or a new one, whatever)
Odoo will resend a request to Stripe. But this request will have wrong data in it.

Stripe will answer with:

Stripe: entering form_feedback with post data {'error': {'code': 'resource_missing',
'doc_url': 'https://stripe.com/docs/error-codes/resource-missing',
'message': "No such payment_intent: 'py_1I6c4UKhH8RhRq18TJs2CP0z'",
'param': 'intent',
'type': 'invalid_request_error'},
'reference': 'S00002-1'}

opw:2422031

closes odoo/odoo#64385

X-original-commit: a42075c9f913f4a20b28f97f0f6786f5a7b2968a
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2021-01-12 09:52:08 +00:00
Nicolas Martinelli d218b3321f [FIX] payment_stripe: icon without name
The `name` field is not required on the `payment.icon` model. Therefore,
in case the payment icon name is not set, a traceback is raised due to a
`False.lower()` statement.

opw-2409755

closes odoo/odoo#62646

X-original-commit: 54434a4fdd71b1e344255fb6f3e42d731ba91f3b
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-11-30 18:19:25 +00:00
Benoit Socias 20141a0b91 [FIX] various: not translate the close icon of notifications
Same change in several areas where translations existed:
- website editor notification popup
- elearning share popup
- forum remediation filter popup
- event registration attendees popup
- portal rating popup
- stripe payment error popup
And many other locations where there were no translations yet
"&times;" has been replaced by its UTF8 character.
Also introduced aria-label where missing.

Before this commit the close icon was included in translated resources.
For example, in Spanish the "&times;" had been turned into "&veces;"
thus not rendering an icon anymore

After this commit the close icon is not a translated text anymore and
remains an icon across all languages

https://github.com/odoo/odoo/pull/60186
task-2312878

closes odoo/odoo#62250

X-original-commit: 9896af94ebc887d98ccf44e6568ef7eeb5a27172
Related: odoo/enterprise#14937
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-11-24 15:59:43 +00:00
Adrien Horgnies 6adac428b4 [FIX] payment_stripe: hide disabled local payment methods
If a merchants didn't enable a local Payment Method Type (PMT) on Stripe
 side (such as bancontact), his customers eligible for it (ex.: Belgian
 and paying in EUR) won't be able to pay using it.

This commit fixes this issue by adding a condition on the payment icons
 assigned to Stripe: if the payment icon related to a given payment
 method is not listed as a supported payment icon, the related payment
 method is not offered to customers, unless the payment icon does not
 exist at all.

User can enable PMTs through (Payment Acquirers > Stripe
 > Configuration > Supported Payment Icons). This concerns: ideal,
 bancontact, eps, giropay and p24.

 This solution is not entirely satisfactory but it isn't possible to
  fetch enabled PMT from Stripe.

opw-2335482

closes odoo/odoo#60740

X-original-commit: 1d0f23599bbd425c81131a5f6c1c22531ffcd0ee
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
2020-10-26 13:26:21 +00:00
Martin Trigaux 90d85eb9c5 [I18N] export saas-13.5 source terms
Without demo data

closes odoo/odoo#56869

X-original-commit: 33f251b6489455cd7221f2c62dee0400a69784b8
Related: odoo/enterprise#12836
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-09-01 11:18:00 +00:00
Adrien Horgnies dc4f6ad04f [IMP] payment_stripe: support webhooks
Allow configuring a webhook in Stripe to send s2s notifications to Odoo
when a Checkout payment is completed. Note that SetupIntent and
PaymentIntent events are not listened to, since they are handled 'live'
with the customer actively present; the main use case for Stripe
webhooks is a Checkout session that gets interrupted before the customer
is redirected to Odoo (e.g. network loss, browser crash, closing the
tab, etc.)

The webhook should be configured to send its events to
<base_url>/payment/stripe/webhook and should only subscribe to
checkout.session.completed events to avoid spamming the Odoo server with
useless notifications.

closes odoo/odoo#52754

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2020-08-17 14:16:51 +00:00
Barad Mahendra 00a7f3aaad [IMP] various: Reseuence the module and module category
The purpose of this task is to improve the UI of the 'Apps', by
improving the clarity of the kanban, sequencing the apps and
simplifying the app categories in the searchpanel

So in this commit, Added the new sequences for ir.module.module
and ir.module.category records.

TaskID: 2240257
Related Enterprise: https://github.com/odoo/enterprise/pull/12413
Closes: #55907
2020-08-14 07:38:58 +00:00
jev c18b1598cf [FIX] payment_stripe: show correct stripe error message
Following this commit: https://github.com/odoo/odoo/commit/72e4652983d9c781fd1da8acf3e4b5d7b9acbd4a
Forgot to add this context.

See opw-2272262

closes odoo/odoo#55514

X-original-commit: bddac7937c188848f27fb507f82a2a1147d42f72
Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2020-08-06 08:19:40 +00:00
Laurent Smet 85e187ebb5 [IMP] payment(_*): Remove dependency to AccountTestCommon
l10n runbot builds are all failing when running at least one test depending of AccountTestCommon because it:
- doesn't create a sandboxed testing environnement to manage the multi-currency, multi-company, the default company's currency, the exchange rates...
- doesn't setup a testing user then all tests are done using the superuser.
- doesn't provide a fully setup chart of accounts: exchange difference journal is not set, accounts have bad types, etc...
- is run sometimes at-install.

--task: 2296213
2020-07-16 07:25:52 +00:00
Adrien Horgnies 12be287552 [IMP] payment: add new local payment method type for Stripe
- bancontact (be; eur)
- eps (at; eur)
- giropay (de; eur)
- p24 (pl; eur, pln)

X-original-commit: 1b7da6d0fe06fcab623f06508cee1093b10273a4
2020-07-14 09:32:57 +00:00
jvm-odoo 9b2c05742d [FIX] payment_stripe: fix can pay a cancelled order
Issue

	- Install eCommerce, Stripe
	- Setup stripe for testing
	- Order something
	- Open stripe payment interface (not with odoo)
	- Go back with the stripe interface button

	Order Cancelled

	- Go back with browser back button
	- Enter your data

	Can pay but order still cancelled so
	you paid for nothing

Cause

	I fixed a linked error in
	b8b9a04ff5b5b2ba40b26632

	but I didn't mind that we should cancel
	the stripe payment intent too

Solution

	Cancel the stripe payment intent so that
	filling the stripe form by following
	those step will returns an error from
	stripe

OPW-2282946

closes odoo/odoo#53819

X-original-commit: 5acb2a649a2f2490725283c7f4cff5a5183d8ed0
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-06-29 14:38:56 +00:00
Martin Trigaux 80e97e98ce [IMP] *: use named placeholders in translated message
When more than one parameter is present in a message, it helps the
translation to use named placeholder. This way, the order can be
changed. It also helps the comprehension of the message.
2020-06-18 13:03:34 +02:00
Martin Trigaux ba244cef01 [IMP] *: replace to new _() syntax
Using a few regex like
\((_\(.*%s.*)(\) % )([\w\[\]][\w .\[\]\(\)'"]*)\)
($1, $3))

Old syntax is still compatible but starts the migration to the new
syntax that catches error.
2020-06-18 13:03:34 +02:00
jev-odoo 013831b176 [FIX] payment_stripe: Request error handling with automatic flow
PR https://github.com/odoo/odoo/pull/49964 fixed manual payment flow
but broke automatic payment flow.

This commit should allow both by raising the exception only for
manual flow, giving only an error for automatic flows.

FW-PORT of https://github.com/odoo/odoo/pull/50908/commits/46e977a21743644a2e98344e3491f0dd6fcbe892

closes odoo/odoo#52151

X-original-commit: a40089d67b66b593a09b0fa4c4cd24f6ce5fcc71
Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2020-05-29 09:36:02 +00:00
Anh Thao Pham (pta) 12d77d271c [FIX] payment_stripe: fix "lower()" applied to bool with stripe payment
- Go to Website > Configuration > eCommerce > Payment Acquirers
- Activate Stripe
- Configure Stripe
- Go to Sales
- Create a quotation
- Send quotation by email
- Click on "Customer Preview" smart button
- On Website, click on "Sign & Pay" or "Pay Now" if already signed
- Sign it and confirm on "Accept & Sign"
- On payment wizard, select "Credit Card (powered by Stripe)"
- Validate with "Pay & Confirm" button
An error message appears.

opw-2262990

closes odoo/odoo#51815

X-original-commit: 3c5117eaac96604a3306c90480d106e0e36fed2f
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-05-25 13:24:11 +00:00
Damien Bouvy 1ecdaa3491 [FIX] payment_stripe: fix ideal fiximp
Revision 29b3b67a16 introduced payment with iDeal but accidentaly
introduced an issue where some payments did not go through (in fact,
some cards could not be saved, preventing the payment to occur).

This fix prevents this issue from happening by clearly differentiating
between returns from the Checkout process and from the Elements process;
in the case of a Checkout flow, the 'card' key is always present in the
data dict but can be equal to None if a non-card payment method was used
(e.g. iDeal) while in the case of an Elements (payment from Odoo) flow,
the 'data' key is never present and the card information has to be
downloaded using a get request to the Stripe API.

opw-2253269

closes odoo/odoo#51269

X-original-commit: f0ba15cda070e968699cf77ac0ba58234dbdaf51
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2020-05-14 13:39:51 +00:00
Damien Bouvy 3b80166e6d [FIX] payment_stripe: iDEAL payments
closes odoo/odoo#50546

X-original-commit: 29b3b67a168b905a72be36ef14ff428c9771a40a
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2020-05-04 09:12:37 +00:00
Adrian Torres 0cb6f111b8 [FIX] payment_*: reset payment acquirers to default on uninstall
The `payment` module introduces a certain amount of payment acquirers,
each one corresponding to a `payment_` module.

When a `payment_` module is installed, this data is updated so that
payments done with the corresponding acquirer change in behaviour using
the provider installed by the `payment_` module.

When a `payment_` module is uninstalled, this data should be reset to
default, more especifically the `view_template_id` and the `provider`
fields of `payment.acquirer`.

This was not possible before this commit, and more importantly it would
make the uninstallation of such `payment_` module impossible as the
`view_template_id` is a required m2o ondelete='set null', which will
make the registry crash. Even if the former wasn't a problem, the
provider field would remain set to a non-existing selection option,
which would make the registry crash (eventually, when checking a record
with such a selection option).

With this commit, we reset these fields to their default value upon
module uninstall.

In 13, the issue with `view_template_id` should be fixed, as required
m2o that are ondelete='set null' are no longer possible. As for the
provider Selection field, a fix should arrive in master soon.

opw-2225333

closes odoo/odoo#48916

X-original-commit: 4f0c1c1bfd71dd1ff6793d0a91b49984c54d1351
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
2020-04-02 21:47:21 +00:00
Adrian Torres 1daf8eb127 [FIX] *: set ondelete policy of required Selection fields
With this commit, Selection fields with `required=True` which are
extended via `selection_add` are given proper ondelete policies to
ensure the cleanup of records containing these extended options during
uninstall of the extending module.

This commit also cleans up leftover uninstall hooks that were being used
to handle the same set of problems prior to the ondelete mechanism being
implemented for Selection fields.

closes odoo/odoo#46325

Related: odoo/enterprise#9117
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-03-30 13:42:04 +00:00
jvm-odoo 0f0d0e59bc [FIX] payment_stripe: fix empty error when cancelling payment
Issue

	- Install eCommerce
	- Set Stripe up (API keys)
	- Go on Shop
	- Add a product > Checkout
	- Pay with stripe
	- Go back when arriving on Stripe payment page
	  (top left link)

	Empty error box

Cause

	This behavior is not handled by payment_stripe

Solution

	Cancel transaction when going back.
	It will display a message "transaction cancelled"

OPW-2195385

closes odoo/odoo#47113

X-original-commit: b8b9a04ff5b5b2ba40b26632e2395b7cdb7ea300
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-03-06 15:53:22 +00:00
Yannick Tivisse 4c291e3f70 [IMP] base: Display searchpanel on ir.module.module views
Purpose
=======

The current kanban view is messy. It is difficult to identify which
apps are installed or not. The user can completely miss a module
that might have interested him. A search panel would make things way
more readable.

closes odoo/odoo#44401

Taskid: 2181557
Related: odoo/enterprise#8144
Related: odoo/upgrade#879
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-03-05 14:03:45 +00:00
Jason Van Malder 1c14419e93 [FIX] payment_stripe: fix traceback when error has no event
Issue

    - Install eCommerce
    - Add Stripe
    - Pay with invalid cart

    Traceback

Cause

    When I improved stripe error, I didn't checked if
    an error could have no event

Solution

    Check if the error has an event

OPW-2186385

closes odoo/odoo#44414

X-original-commit: 772c02743b5e6610a75e65e408c956eb6057a47d
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-01-31 16:28:08 +00:00
Damien Bouvy 525d363b56 [FIX] payment_stripe: better error handling
In some cases, Stripe will return the result of a transaction with
a faulty HTTP Status (e.g. 4XX statuses) - not because the request
was malformed, but because the payment failed. It is a bit unfortunate
that Stripe would not differentiate between payment status and request
validity, but that's the state of things.

This commit ensures that such a response will be logged correctly, by
making the call to `raise_for_status` conditionnal on the response object's
status code and internal structure, forwarding the response's json to the
validation flow if the status is in the 4XX range and a `code` key is
found in the response, as described in https://stripe.com/docs/error-codes

While testing this fix, it became apparent that some error message
processing in the frontend was not correctly handled as well - instead
of purely rejecting the promise, a failed payment should still send its
payload to the backend, to allow the server to put the transaction in
the correct state according to the response.
2019-12-31 09:19:34 +00:00
Jason Van Malder 22df074e7b [FIX] payment_stripe: fix bad request not displaying
Reproduce the issue

    - Install eCommerce
    - Activate stripe, use testing credentials and select
      Configuration > Payment Flow > Payment from Odoo
    - Create a contact that has a trailing whitespace at the beginning
      of the email
    - Grant him portal access, and a password
    - Open your browser devtools
    - Login to the web shop with this portal user and buy an item using
      stripe

    1. Error Dialog: Server Error (HTTP 500)
    2. The exception received by the front-end is not clear
    3. When the 500 error is fixed, we still have a error dialog
       => bad UX

Cause

    1. The raise was removed but we need to keep it because
       it allows the true error to be raised (bad request)

    2. The "invalid email address: x" is lost when we raise the
       exception

    3. In V13, all catch & guardedCatch open a error dialog if we
       don't set preventDefaulted to true on the error's event

This commit changes restore the raise, change the error message and
disable the error dialog for this case.

OPW-2126196

closes odoo/odoo#41087

X-original-commit: b8d013285ba54c8d3ab4a3857604dfca3e479b39
Signed-off-by: Jason Van Malder <jasonvanmalder@users.noreply.github.com>
2019-11-29 06:59:42 +00:00
Nicolas Martinelli f02bfd3daa [FIX] payment_stripe: avoid internal error
In case the Stripe API call fails, an Internal Server Error page is
displayed to the user, which is not user friendly.

opw-2126196

closes odoo/odoo#40678

X-original-commit: 95a452f6d928de2e8532027893a353167ffdd389
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-11-22 09:41:05 +00:00
Nikunj Ladava 9019645a5d [FIX] payment_stipe: fix empty card error
before this commit, when try to make payment with
empty card details, it will raise error dialog.

after this commit, error will be append to acquirer
form

task - 2089999

closes odoo/odoo#39729

X-original-commit: 01b143b971a85d6da673df6c536917ad4754b83a
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-11-04 11:17:13 +00:00
fw-bot b973577803 [FIX] payment_stripe_sca: include payment reference in dashboard
Makes it easier for users to match Odoo payments with information
from the Stripe dashboard.

closes odoo/odoo#39465

X-original-commit: 0a55cb29542da20bb9d0543e2b30d125124f861b
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-10-28 15:48:55 +00:00
Damien Bouvy b87a0ba88f [FIX] payment_stripe: correct tests
Adapt the API changes in Stripe. Use correct test data existing in
Stripe dashboard for our test account.

closes odoo/odoo#39455

X-original-commit: 4dab64285ab410f239935437b273a0c97951e902
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-10-28 14:16:50 +00:00
Christophe Simonis d74b451805 [MERGE] forward port branch 13.0 up to f4105eb9c7 2019-10-09 02:08:17 +02:00