Commit Graph
369 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) 0885212a83 [FIX] payment_adyen: prevent creating a new session for returning users
Before this commit, users returning from Adyen to Odoo after payment
could see their session renewed, depending on their browser's
implementation of the `SameSite` cookie attribute. This prevented Odoo
from retrieving the transaction from the users' session.

This commit flags the return route of Adyen with `save_session=False`,
hence allowing all users to immediately post-process their transactions
when they return to Odoo.

While we're at it, the docstrings of the return routes of PayUmoney and
SIPS' have been updated for better clarity.

closes odoo/odoo#74763

Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
2021-08-05 13:31:09 +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
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
Adrien Widart 0a87cd21fd [FIX] payment_sips: prevent clearing the session cookie
When buying a product on website shop, after the payment with SIPS, the
page is redirected to an Error message: "We are not able to find your
payment, but don't worry. You should receive an email confirming your
payment in a few minutes. If the payment hasn't been confirmed you can
contact us."

To reproduce the error:
1. In Payment Acquirers, enable Sips
2. Go on website shop
3. Add a product to the cart, Checkout
4. Pay with Sips
    - Visa card number: 4100000000000000
5. Back to Web-shop, if the payment has been successfully processed,
repeat steps 2 -> 4

Error: The message "Your payment has been successfully processed. Thank
you!" is not displayed. Instead, the message "We are not able [...] you
can contact us." is displayed.

This message is displayed when:
https://github.com/odoo/odoo/blob/5945806c151b13d9d4cc13aa0a6c96a6b1bbad5f/addons/payment/controllers/portal.py#L65-L69
i.e., when the transactions list is empty. Here is how to get the list:
https://github.com/odoo/odoo/blob/5945806c151b13d9d4cc13aa0a6c96a6b1bbad5f/addons/payment/controllers/portal.py#L38-L42
It uses the session of the request. The cookie `session_id` is used to
identify the current session. However, after the payment on SIPS, the
page is redirected to `/payment/sips/dpn` with a POST request. Since the
session cookie has the attribute `SameSite=Lax` and the HTTP request is
a POST, the cookie will be filtered out:
https://drive.google.com/file/d/1xfx3YWkfonO3nK-8Rew45uSoR4lkpjpY/view?usp=sharing
(Browser information: This cookie didn't specify a "SameSite" attribute
when it was stored and was defaulted to "SameSite=Lax," and was blocked
because the request was made from a different site and was not initiated
by a top-level navigation. The cookie had to have been set with
"SameSite=None" to enable cross-site usage)
As a result, the server creates a new one. This is the reason why the
transactions list is empty: the list is based on a new session.

Adding the attribute `save_session = False` to the route will prevent
the server from creating a new session cookie and add it in the POST
response.

OPW-2518377

closes odoo/odoo#72611

X-original-commit: 9637a287923c6b82acfd487ed32d6bbc1fdf74b6
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2021-06-23 10:21:04 +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
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
Kevin Baptiste a9ac72d821 [REF] payment_sips: migrate Sips to the new payment API
See the merge commit for more details.

task-2333041
2021-03-30 09:25:51 +02: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
Damien Bouvy bb9ae7b08b [IMP] payment_sips: code improvements
Extend support for all currencies listed in the SIPS documentation,
including the decimal numbers per currency. Move this hardcoded data
is a less annoying place.

Remove unnecessary code (e.g. checking if there is more than one payment
with the same reference, which can't happen due to a SQL unique
constraint from the payment module).

Code clarity while I'm at it.

Task-2259942

closes odoo/odoo#51473

Related: odoo/upgrade#1216
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2020-08-17 13:21:08 +00:00
Damien Bouvy fc9ea2c519 [IMP] payment_sips: testing values
Prior to this revision, setting the provider to the 'test' mode caused
hardcoded values for merchantId, secret and keyVersion to be used
without any possibility to override them.

While somewhat useful, it was quite limiting since it used the 'simu'
environment of Atos Wordline, preventing you from testing any other
platform and from using the 'test' environment for Atos.

This revision removes these hardcoded values, which gives more
flexibility as far as testing goes at the cost of a bit more setup
(since you might need to change some values manually, notably the
keyVersion).

Task-2259942
2020-08-17 12:39:30 +00:00
Damien Bouvy 9392f9cfc8 [IMP] payment_sips: convert config param to proper field
The config param 'sips.key_version' was introduced "some time ago"
in revision a62480ad0f to allow setting the `keyVersion` POST param
to an arbitrary value, allowing other SIPS-comptatible providers to be
used with this module.

This revision (finally) converts this fix to a proper field.

Task-2259942
2020-08-17 12:39:29 +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
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
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
Thibault Delavallée 6b916937c8 [FIX] payment_sips: propagate environment -> state variable renaming
Some bits of code still use old variable.

Task ID 2237300
Closes PR #49462

closes odoo/odoo#49501

X-original-commit: 4d402e94cb18cf5cc7e89ba9a9c305d02542a7f9
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-14 10:06:21 +00:00
Damien Bouvy f023d89dba [FIX] payment_sips: stop log pollution
SIPS sometimes send empty notifications. I have been unable to find out
why or to reproduce the issue; it seems to be linked to a delay on their
end since these notifications usually arrive after a customer is
redirected back to Odoo (at least on their test account).

I'd rather log a warning for those cases (since nothing is wrong on
Odoo's side, there's just no info to act upon) instead of a full
traceback.

closes odoo/odoo#49335

X-original-commit: 100ef1bdb7b90edbeccfa6cd10297acb824b8083
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-09 14:07:07 +00:00
Damien Bouvy 0ef83a729c [FIX] payment_sips: add basic test case
Render the payment form and process feedback from the provider.

X-original-commit: 60445af209d4fef1f93e26c4b5b912df2fffdb50
2020-04-09 14:07:07 +00:00
Damien BouvyandNicolas Martinelli 43caac96ff [FIX] payment_sips: datetime parsing
SIPS date format can be somewhat variable, some sanitation is required
before using the data raw for the ORM.

opw-2224926

X-original-commit: 620e987f326d6da7c3a9b2c1aca7bff16d9ce6c4
Co-authored-by: Nicolas Martinelli <nim@odoo.com>
2020-04-09 14:07:06 +00:00
Richard Mathot a6d38439d5 [REV] payment_sips: 9372ff3ac010bd3428eb866ddd3ecfaf939127c4
Python 3.7 is required for function datetime.datetime.fromisoformat to
work.
Ref: https://docs.python.org/3.7/library/datetime.html?highlight=fromisoformat#datetime.datetime.fromisoformat

This is a temporary revert, to avoid rejecting perfectly valid
transactions.

Ref: https://github.com/odoo/odoo/pull/48581
opw-2179123

closes odoo/odoo#49091

X-original-commit: dedac4efd0872bab71e06796f5a3158e2cf7bf15
Signed-off-by: Richard Mathot (rim) <rim@openerp.com>
2020-04-06 16:50:56 +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
Damien Bouvy 1e5ab1b533 [FIX] payment_sips: datetime parsing
SIPS date format can be somewhat variable, some sanitation is required
before using the data raw for the ORM.

opw-2224926

closes odoo/odoo#48604

X-original-commit: db998d39d7d692779a64522e168bba29b82f1d03
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2020-03-30 12:00:25 +00:00
Nicolas Martinelli c2cd71f576 [FIX] payment_sips: rounding error
- Activate SIPS
- Make a payment of 263.90 on the eCommerce

The SO is not confirmed because there is 0.01 of difference.

This is due to the fact that 263.90 * 100 = 26389.9999...

Using `round` instead of `int` prevents truncating the value.

opw-2179123

closes odoo/odoo#48169

X-original-commit: 60f9cea444df37e685b7f4312c9ff28c395822b3
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-03-23 10:11:08 +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
Damien Bouvy 085c977af5 [FIX] payment_sips: correct automaticResponse URL
The automaticResponseURL should not be the same as the one the customer
uses, as this might mess up with the payment processing page when the
customer actually returns.

Add some logging while I'm here, and remove a useless write on a
non-existing field that generates log warnings (but nothing else).

closes odoo/odoo#46047

X-original-commit: 2e25ff3b1114a222ae8cff76c2ce8d31adf599e4
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2020-02-24 09:59:31 +00:00
Martin Trigaux b7d91ba25b [I18N] *: remove es_AR translations
Followup of a425695e
The terms were back in 12.0
Courtesy of Juan José Scarafía

closes odoo/odoo#41624

X-original-commit: 85d0c7001a997748d7691205bbb8d066597591a5
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-12-10 10:00:18 +00:00
Jorge Pinna Puissant 6d2d30d6f5 [FIX] payment_*: multiwebsite base_url
Fine-tunning of 937b5c076e7175bec664ed0cf4b77505e342f1e2

Have a multiwebsite setup
have a payment installed for one of the two websites

Make an order on that website and try to pay

Before this commit, the transaction doesn't come back to odoo's
payment success controller
This was because the return url was set to the web base url ICP

After this commit, the payment success page is opened as we took
the request's url as the return url

opw-2080352

closes odoo/odoo#39643

X-original-commit: a9fb15b33fd041ee420581a5ba450017db06e0c7
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2019-10-31 12:33:56 +00:00
Odoo Translation Bot b6e7ed6c7b [I18N] Update translation terms from Transifex 2019-10-07 09:11:11 +02:00
Odoo Translation Bot 40deff7cbe [I18N] Update translation terms from Transifex 2019-10-01 21:21:46 +02:00
Odoo Translation Bot d7b8831ea8 [I18N] Update translation terms from Transifex 2019-09-29 01:22:33 +02:00
Victor Feyens 07631a5185 [IMP] * : manifest module categories cleanup
closes odoo/odoo#35754

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-09-25 14:03:45 +00:00
Odoo Translation Bot e80b81dca1 [I18N] Update translation terms from Transifex 2019-09-15 01:30:37 +02:00
Christophe Simonis 5a273e74f0 [MERGE] forward port branch saas-12.4 up to fe59754c52
closes odoo/odoo#36721

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-09-13 13:32:51 +00:00
Christophe Simonis 51354fadb0 [MERGE] forward port branch saas-12.3 up to 50e571acf7
closes odoo/odoo#36491

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-09-11 09:39:33 +00:00
Goffin Simon 18335d355e [FIX] payment_sips: Wrong test and production URLs
The production/test urls were inverted.

opw:2061123

closes odoo/odoo#36623

X-original-commit: 5325c4388c5cae38b78b88d74220f3a5dca3fc26
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-09-10 11:59:26 +00:00
Odoo Translation Bot 4af010bdec [I18N] Update translation terms from Transifex 2019-09-01 06:24:20 +02:00
Jorge Pinna Puissant 92990ad30e [FIX] i18n: missing Slovenian translation
Slovenian language, as many others languages, is not present in the
beta/master projects in Transifex.

For some reason, Transiflex removed all current translations, this was
already fixed in 12, but as there are not automatic forward-port for
translations, this is a manual forward-port.

opw-2060055

closes odoo/odoo#36374

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-09-03 11:32:39 +00:00
Christophe Simonis 4528f75cb0 [MERGE] forward port branch 12.0 up to 82c0e9b620 2019-09-03 12:41:08 +02:00
Goffin Simon 82c0e9b620 [FIX] payment: Publish Sips online payment
Steps to reproduce the bug:

- When trying to publish the sips payment acquirer not in debug mode

Bug:

It raised a access rights error because the fields: sips_test_url, sips_prod_url, sips_version
were not readable in function _check_required_if_provider and  a default value was set for all
these fields.

opw:2061123

closes odoo/odoo#36346

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-09-03 08:13:49 +00:00
Odoo Translation Bot 72fff6ae7e [I18N] Update translation terms from Transifex 2019-09-01 01:39:46 +02:00
Odoo Translation Bot 5a18c8e71b [I18N] Update translation terms from Transifex 2019-08-25 01:16:15 +02:00
Odoo Online 19727047ce [I18N] Update translation terms from Transifex 2019-08-18 06:20:13 +02:00
Martin Trigaux 8be6470a82 [I18N] *: export saas-12.4 source terms 2019-08-13 11:53:38 +02:00
Odoo Translation Bot 86809804f9 [I18N] Update translation terms from Transifex 2019-09-01 01:28:13 +02:00
Martin Trigaux b247aa3252 [I18N] *: export saas-12.5 source terms
That will be used a the basis for the future 13.0 version
Without demo data

closes odoo/odoo#36057

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-26 09:38:09 +00:00