Commit Graph
1361 Commits
Author SHA1 Message Date
Valeriya(vchu) 55a3b661dc [IMP] account_payment: set default bank journal on providers
Set the default value of provider's `journal_id` to the first compatible
bank journal, if such exists, to improve the user experience.

Part-of: odoo/odoo#138466
2023-10-18 18:27:28 +00:00
Valeriya(vchu) 997aa444cb [IMP] payment: payment methods improvements
closes odoo/odoo#136525

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-10-13 21:11:53 +00:00
Antoine Vandevenne (anv) 3ef9310ec3 [FIX] (account_)payment, sale: check document access in payment routes
Commit 4d1a1f1c introduced a systematic check on the kwargs passed to
transaction routes of modules integrating with online payments, but
failed to check the access token of documents whose ID is passed to
payment routes. This allowed retrieving the access token of such
documents by visiting a route that did not check the document access
(e.g., /my/payment_method) and passing an arbitrary document ID
(e.g, sale_order_id=123). The route's controller would reroute the
payment flow to the document's portal page and render the landing route
of the flow on the payment form, with the access token included.

This commit makes sure that we always check the access token of a
document before reading rerouting a payment flow.

closes odoo/odoo#138238

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-10-12 13:16:46 +00:00
Anita (anko) 4d1a1f1c99 [IMP] payment, *: verify and reroute payment flows
This commit changes the way transactions linked to a document (sales
order, invoice...) are created in a payment flow. Rather than receiving
and trusting the transaction values from the controller, they are now
read from the linked document, and the payment flow is rerouted to use
the document's module's controllers instead of that of `payment`.

This ensures that no unexpected value can be passed to the `create`
method of a transaction, and simplifies the implementation of the
payment flows of linked documents.

task-3136240

closes odoo/odoo#126425

Related: odoo/enterprise#43212
Related: odoo/upgrade#5124
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-09-23 21:08:01 +00:00
7e012dd544 [IMP] payment, *: replace providers with payment methods in payment forms
Before this commit, the payment providers (e.g., Stripe, Adyen...)
available for payment were displayed on the payment forms. The customer
had to select one to process their payment. After that, the customer had
to select their preferred payment method (e.g., Credit Card,
Bancontact...) from a list of payment methods supported by the selected
provider over which the website administrator had close to no control.
This was making the payment forms confusing because the payment methods
were displayed sometimes more than once, if at all, in a non-controlled
order, and behind the selection of a payment provider that customers
should not have to deal with.

As the payment method was selected in an iframe or directly on the
provider's website, the information on the selection payment method was
not available in Odoo. This posed many problems, among which were the
impossibility of assessing whether a specific feature (e.g.,
tokenization, refunds, manual capture...) was available, not being able
to easily identify payment tokens through the payment method logo,
listing available payment methods on the website, sorting and
fine-grained configuration of the available payment method, subpar
payment method-specific display on the payment form (e.g., PayPal that
requires displaying a "Pay with PayPal" button), etc.

In this commit, the payment providers are thus replaced by the payment
methods on the payment forms. All contextually available (depending on
the country, currency, requested feature...) payment methods are
displayed one after the other on a single-level list and in the order
configured by the website administrator. Each payment method is
"powered by" (i.e., linked) to a single payment provider: the first one,
by model order, to support it. This allows, for example, offering the
PayPal payment method through Mollie, which charges low processing fees,
while also offering Klarna through Stripe, which supports more payment
methods but charges higher processing fees.

While doing so, the two different payment forms, "Checkout" and
"Manage", are also merged together in a new, configurable case-by-case,
payment form that is entirely redesigned to offer a better user
experience.

After payment, the information on the selected payment method is saved
on the transaction and eventual payment record and updated with the
information received from the provider.

task-2882677

closes odoo/odoo#120446

Related: odoo/upgrade#5103
Related: odoo/documentation#5717
Related: odoo/enterprise#40666
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Co-authored-by: Anita (anko) <anko@odoo.com>
Co-authored-by: Brieuc-brd <brd@odoo.com>
Co-authored-by: Valeriya (vchu) <vchu@odoo.com>
2023-09-22 13:32:53 +00:00
Antoine Vandevenne (anv) 5b5f69352c [CLN] payment(_*): correct code styling inconsistencies
This commit mainly removes the extra indent level left over after commit
odoo/odoo@8ec2e8cf. It also cleans up purely cosmetic code styling
inconsistencies.

task-2882677

Part-of: odoo/odoo#120446
2023-09-22 13:32:53 +00:00
Anita (anko) a4fb297d32 [IMP] account_payment, sale: show the user's tokens on all portals
Before this commit, each module had its own logic regarding payment
flows in the portal. With this commit, we enforce that if the user is
logged in, they see their tokens, while logged out users see the tokens
of the customer (the contextual partner).

task-2836870

closes odoo/odoo#124631

Related: odoo/enterprise#42999
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-09-21 16:52:05 +00:00
niyasraphy 36cf1708a4 [FIX] (account,website)_payment, sale: pass argument values in super call
before this commit, on inheriting the function
_get_custom_rendering_context_values the argument values are not received
in the inherited function as it is not passed along with the super

scenario:
* consider that the payment link is shared to customer
* customer made the full payment
* once the sale or invoice is fully paid, the link has to
be shown as fully paid or expired
* for doing this, if we inherit the above function, the
arguments is not passed to the function

after this commit, the argument values are passed to
super and the value can be used re used in the further
inherit of this function

closes odoo/odoo#134195

X-original-commit: 49b91e47c6c24e0023110365e7f9084a2c13ca5a
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-09-05 12:22:22 +00:00
althaf shaik 07dea7ba45 [FIX] account_payment: handle error while computing suitable payment token
This traceback may arise while computing suitable payment tokens,
when a user clicks register payment in invoice.

Because in '_compute_suitable_payment_token_ids' method,
instead of 'paymet.token' 'payment.tokeb' is used.
Which is an invalid model name. It leads to keyerror

Error: 'KeyError: 'payment.tokeb''

See:
https://github.com/odoo/odoo/blob/60598dff9d8482bcea2f32fea6df1b1b71c760d6/addons/account_payment/wizards/account_payment_register.py#L36-L41

sentry-4380761438

closes odoo/odoo#132725

X-original-commit: f169d92454bba61547dc5bbbc3a6f9c45798562e
Signed-off-by: Achraf Ben Azzouz (abz) <abz@odoo.com>
2023-08-22 20:01:08 +02:00
prye-odoo 1c16fb7844 [FIX] account_payment: uninstall payment provider(s) with payment line
When the user uninstalls a payment provider module(s) and there are some
transaction lines linked with the 'account.payment.method' record(s),
It will throw the "ForeignKeyViolation" traceback. This commit raised the
UserError message.

Steps to produce (Example only):
- Install website_sale module.
- Go Invoicing > Configuration > Payments > Payment Providers
- Search "PayPal" and install it, open it, and fill up the credentials tab.
- Create an order from the website and pay with PayPal.
- Go to the Apps menu and search the "payment_paypal" module and try to
uninstall it.
After that traceback will be generated.

Error: update or delete on table "account_payment_method" violates
foreign key constraint "account_payment_method_line_payment_method_id_fkey" on
table "account_payment_method_line"

sentry-4261586022

[WIP]payment_provider raise msg improvement

closes odoo/odoo#132251

X-original-commit: 9eb5ea9746cf277f09f5258dbc276162280b275b
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2023-08-21 12:39:33 +02:00
Antoine Vandevenne (anv) d5bee8b86f [REM] payment(_alipay,_demo,_paypal), website_payment: drop fees support
The "fees" or "extra fees" or "customer fees" feature was meant to make
customers pay for the processing fee charged by the payment provider
they choose to make their payment. The fee was also displayed on the
payment form to deter customers and encourage them to choose another,
cheaper, payment provider.

In practice, it didn't hold up because:
1. the provider's API must allow sending the fee as a separate amount,
   and PayPal was the only supported provider to do it;
2. charging extra fees is highly discouraged by providers, and forbidden
   in Europe;
3. the final fee amount depends on the customer, country, payment
   method, risk profile... rendering charging the actual fees amount
   infeasible;
4. most of the time, only one payment provider is enabled at a time,
   thus alienating customers who would have no other choice than paying
   the fee;

task-3358581

closes odoo/odoo#132104

Related: odoo/documentation#5517
Related: odoo/upgrade#5053
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-08-19 09:06:59 +02:00
Gorash 774a3fad0e [REF] base,all: Update modifier syntax: view migration
Apply of the migration script to update all view modifiers.

Part-of: odoo/odoo#104741
2023-08-18 09:49:13 +02:00
Bastien PIERRE 65242e31e9 [IMP] *: Remove alias in JS files
Rename all imports with alias old system to the new js module system
Task ID: 3266759

closes odoo/odoo#127414

Related: odoo/design-themes#671
Related: odoo/enterprise#43716
Signed-off-by: Bastien Pierre (ipb) <ipb@odoo.com>
2023-07-27 11:58:34 +02:00
william-andre 0479b2b594 [IMP] account,*: manage subsidiary companies
Allow sharing records between company
* accounts
* taxes
* fiscal positions
* products
* ...and some related models

These records can be read and used in children companies.

This can be used to
* have different branding for different businesses
* allow more complex security rules
* consolidate branches differently
* manage different tax reports with different tax ids in the same
  country

task-3371677

closes odoo/odoo#125642

Related: odoo/enterprise#43215
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2023-07-20 11:49:06 +02:00
Victor Feyens fd2fb212c5 [IMP] payment: allow custom providers to follow standard payment logic
* Generate account payments (and require a journal)
* Be displayed as their custom mode instead of always 'Custom'
...

Commit also includes some side bugfixes/cleanup

task-3347338

closes odoo/odoo#126929

Related: odoo/enterprise#43418
Related: odoo/upgrade#4944
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-07-20 03:56:19 +02:00
Claire Bretton (clbr) 3d895b9f87 [FIX] payment: fix constraint on account.payment.method.line
Change a constraint that was meant to prevent deletion of an
account.payment.method.line when related provider is in 'enabled'
or 'test' state. The constraint is now handled only on the payment method
lines that are actually modified, and not on everything like previously.
This constraint was failing during upgrades because it was too broad,
its initial purpose was to raise error to user at the moment he tries
to remove payment method lines from its journals.

closes odoo/odoo#128214

X-original-commit: fca76bcc6c8be6e38827641555d62ab2973ab1fe
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Claire Bretton (clbr) <clbr@odoo.com>
2023-07-12 09:15:09 +02:00
Xavier ALT 4b2106298d [FIX] sale, account_payment: fix saleman payment transactions access error
Since odoo/odoo@2b1e2abda3 user need at least 'Account / Billing'
access to read payment.transaction, that not the case for most salesman.

So for user that don't have 'Account / Billing', this commit do:

- compute the 'amount_paid' as superuser
  (fixing "Generate Payment Link" wizard access errors)

- hide "Payment Transaction" smart-button on invoice

closes odoo/odoo#127835

X-original-commit: ad2c3a873a926ac8c94d014af24ed400b493493e
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Xavier Alt (xal) <xal@odoo.com>
2023-07-10 08:56:27 +02:00
Florian Charlier 77f9ff50db [REF] *: use onboarding module
* = account{_payment}, base, onboarding, payment{_stripe},
sale{_management}, web, website_sale

Use the dedicated onboarding module introduced in 16.0 instead of
the res.company model to store onboarding progress.

It allows
 * onboarding steps to be reused across panels
 * to support steps that should be completed per-database or per-company
 * to clean the res.company model from many fields and methods,
 * to remove many views, controllers, actions

Module-specific notes:
* account: We also clean the remaining two steps that are not
part of an accounting panel but make the most sense to be kept here.
* account_payment: Following 8e4e8eb8, the payment provider step is
added to the invoicing onboarding panel. We apply this change here too.
Also impacts the website_sale_dashboard panel (see related ENT PR).
(The "sale tax" one is currently used for to the website sale dashboard).
* payment: Note that the step was already not part of an onboarding
panel within this module.
* website_sale: We clean
  * a field not used (The website_sale dashboard onboarding panel used
  the payment_provider_onboarding_state field).
  * a method that was only called from website_sale_dashboard, so it is
  moved there. See related ENT PR.

Includes a few tests.

Moving views/templates/styling, as well as cleaning residual onboarding-related fields and methods in base, including populate.

This also includes restoring the "onboarding_complete" overlay panel
animating it to disappear after a few seconds so that it doesn't hide
text and block buttons to re-open steps.

Task-3025136

Part-of: odoo/odoo#104223
2023-06-30 23:37:50 +02:00
Louis Wicket (wil) 04189318cc [I18N] *: update master translations
Currently, only stable releases see their translations updated. This has
resulted in master accumulating outdated stuff for years, which can be
confusing for users testing master on runbot.

This one-shot commit resynchronizes master translations based on the
content from 16.0 and removes empty PO files (i.e. no longer containing
translations).

closes odoo/odoo#121629

Related: odoo/enterprise#41171
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-05-22 17:52:07 +02:00
Martin Trigaux 077bbd0b0b [I18N] *: export master source terms
closes odoo/odoo#121563

Related: odoo/enterprise#41140
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-05-17 10:34:00 +02:00
Horacio Tellez 2b1e2abda3 [IMP] payment,*: restrict access to payment.transaction records
Since 15.0, it is no longer possible to have partnerless transactions.
Nonetheless, migrated databases could contain transactions without a
`partner_id` set.
This commit cleans existing rules to make those transactions are not
accessible to unwanted users.

We take the opportunity to clean the security of payment.transaction
records globally.
Now only admin and accounting users have access to payment.transaction
records. The code of different applications has been adapted accordingly.

Task - 3102824

closes odoo/odoo#113515

Related: odoo/upgrade#4564
Related: odoo/enterprise#40939
Signed-off-by: Masereel Pierre <pim@odoo.com>
2023-05-15 15:07:13 +02:00
Elisabeth Dickinson 45b9e04db4 [IMP] *: status buttons fix
Part-of: odoo/odoo#116641
2023-05-12 22:59:23 +02:00
Xavier Luyckx (xlu) c1080c8638 [IMP] *: onboarding, milk adaptations
*: onboarding, account, account_payment, sale.

Currently used in the appointment module (See c1cf8bfb).

Related Task-3297572

task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:16 +02:00
Anita (anko) 8e4e8eb81a [IMP] account_payment: add payment onboarding step
To improve onboarding experience, configuring Stripe
has been added in Invoice onboarding process.
For db with other apps(ecommerce or sales) if onboarding is
done in one place it is considered done in other places with
exclusion of Sales, unless it was done in Sales.

task-3208045

closes odoo/odoo#114131

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-05-03 12:39:08 +02:00
Rémy Voet (ryv) 234db70d86 [IMP] *: Use the new API of _read_group for backend use
Part-of: odoo/odoo#110737
2023-04-19 21:58:27 +02:00
Victor Feyens f2ce4b4d46 [FIX] account_payment: show payment link action to accounting users
The 'Generate payment link' action on account move records was only
shown to the users of the group 'Show Full Accounting Feature'
(and to salesman when sale is installed).

This means that if you only have invoicing app (`account` module) installed,
you don't see the action.

This commit makes sure the action is visible to all accounting users, like
the refund wizard.

closes odoo/odoo#118800

X-original-commit: 8cf2aebe9582a12b0f2309f25844e0b2d82ed3e2
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-04-17 16:35:11 +02:00
Martin Trigaux 69f911d994 [IMP] *: enforce usage of Markup in mail
When using message_post, the body format must be explicitly specified.
If html is expected, a Markup object should be used.
If text is given, the content will be escaped.

Before this PR:
message_post was unaware if the content of a message was HTML or
text. This lead to multiple situation where the content was
incorrectly considered as HTML and led to display errors.
In
  self.message_post(body="Hello %s!" % self.name)
if the name contained HTML, it would be evaluated.

In
  self.message_post(body="Contact Raoul <raoul@caramail.be>")
the email would not be displayed as considered as unknown HTML and
discarded by the sanitizer

Now each call must explict the type of content.
Use the escape() helper to properly combine Markup and translations.
It would also be acceptable to use Markup() to wrap a static
translation but escape is better as one can not guarantee the content
of a translation.

closes odoo/odoo#111850

Related: odoo/documentation#3612
Related: odoo/enterprise#36728
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-04-13 16:39:48 +02:00
Michael (mcm) ff0d6dd580 [REF] *: replace odoo module by native one
This commit converts almost all odoo module by native module.
The goal is to deprecate odoo.define in favor of native module and then
simplify boot.js by removing the regexp that finds module dependencies.

task id: 3162300

closes odoo/odoo#117305

Related: odoo/enterprise#39118
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-04-03 17:07:24 +02:00
Martin Trigaux 1be5eae8ef [I18N] *: remove nl_BE files
They dates from < 2027 and are quite outdated. Favour the nl
translation instead.
n_BE is not on Transifex so it was not possible to correct bad
translations.

closes odoo/odoo#115845

X-original-commit: d04c8b7e484db8306d858c891a7a2b11885fdcd9
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-03-20 16:51:30 +01:00
Victor Feyens bd0a6f9667 [IMP] account(_payment): simplify portal templates
The logic to display the payment status of invoice(s) has been quite
messy for a long time, leading to a lot of confusion and some bugfixes.

This commit tries to simplify and harmonize the logic, and to provide
a clear logic and ordering of the payment states, following
1) the invoice state (cancelled state)
2) the accounting state (related to `account.payment` records and logic)
3) the payment state (related to `payment.transaction` records, holding
states not reflected in accounting logic until effectively confirmed).

closes odoo/odoo#111046

Related: odoo/upgrade#4409
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-03-09 15:54:35 +01:00
Victor Feyens d86238d0a8 [MOV] acc_pay_patch->acc_pay: merge bugfix module
The module ´account_payment_invoice_online_payment_patch´ was added in stable to allow
account_payment users to disable online invoice payment
(without removing the module, critical for other flows).

It can be safely merged into the account_payment module for future versions.

Original bugfix PR: #110177
Related to opw-3114860

Part-of: odoo/odoo#111046
2023-03-09 15:54:34 +01:00
Demesmaeker 7f2ae9ed5b [IMP] payment(_adyen): allow partial capture
Before this commit, it was not possible to partially capture a
transaction from Odoo, and doing so in the provider backend would often
result in a full capture in Odoo when capture was supported.

With this commit, partial captures are made available in Odoo directly
from the sales order or invoice, for providers that support them.
Provider can either only support full capture or also support partial
ones. It also optionally managed the automatic void of the remaining
amount at the user request when multiple captures are supported by the
provider.

As of now, the only acquirer allowing partial capture is Adyen.

task-2728768

closes odoo/odoo#87251

Related: odoo/enterprise#35205
Related: odoo/documentation#2063
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-03-09 10:51:29 +01:00
Horacio Tellez ddda5d4a26 [IMP] payment: allow the public user to pay with tokens
Before this commit the public user did not have access to tokens or the
possibility of saving payment methods.

When receiving a link to pay the customer (even if not logged in) should
be able to use tokens saved by the parter of the document and also save
new payment methods. This is intuitively correct: as the possesor of the
link, the customer have rights to pay with tokens linked to the partner.

After this commit tokens linked to the partner of the document will be
visible to the public user and also the possibily to save payment
methods.

Task - 2799296

closes odoo/odoo#104472

Related: odoo/enterprise#34792
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-03-08 11:36:53 +01:00
Hansun (hale) 415a8b11a1 [FIX] account: control account payment creation
1. Install [Studio], [Accounting] on Apps
2. Enter [Accounting]
- Click the Studio icon second to left on the top right corner
- [Edit Menu]
- [NEW MENU]
- Fill in e.g.`Test`, select [Existing Model], Model: Payment Methods
- Click the icon on the right, check it is `account.payment.method`
- [SAVE & CLOSE]
- [CONFIRM]
- [CLOSE]
3. Click on `Test` menu created next to [Configuration]
- [NEW]
- Type in all info, click to Save
- Error is thrown

Desired: block users from creating a `payment.method` by all means

Impacted versions: 14-master

opw-3148453

closes odoo/odoo#114408

X-original-commit: 59ea0e9802fc9cf98bab8fbdc065d9b5fc023ac7
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
Signed-off-by: Lee, Hansun (hale) <hale@odoo.com>
2023-03-07 02:00:15 +01:00
Anita (anko) 1d846c36d9 [IMP] payment(_*): allow specifying extra allowed states
Some providers require additional allowed states due to their refund or
transaction process justifying it. Until now, these extra states were
specified in the `payment` module, which was not ideal as it allowed
every provider in every flow to accept these additional states.

With this commit, additional states are now specified only in the
coresponding flow of a provider that requires them.

task-2869678

closes odoo/odoo#107110

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-02-24 18:16:00 +01:00
Horacio Tellez 0f2de18849 [IMP] payment: only give access to tokens when required by the flow
Until this point the access to tokens was somehow arbitrary and
illogical.
After this commit we will uniformize the tokens access rule where by
default an user can only access its own tokens by default and in
function of the use case then relax the rules.

Task - 2832561

closes odoo/odoo#104808

Related: odoo/enterprise#33541
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-02-17 13:06:53 +01:00
Valentin Vallaeys (vava) e534ab41e7 [REF] payment, (website_)sale: factorize payment values logic in controllers
The payment values in the Qweb context of sale, sale_subscription and
website_sale were computed separately, although there is a large common
basis. This split made it hard to communicate between modules and
generated a lot of duplicates. The new function `_get_payment_values`
in sales is now used as a common basis method for all sale_* modules to
get the common payment values.

closes odoo/odoo#107788

Related: odoo/enterprise#34922
Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
2023-02-03 17:40:58 +01:00
Denis Ledoux b4a7996e96 [IMP] base, *: change the API of init hooks to pass env
This is mostly a cleaning/refactoring change.

The current API for init hooks (pre, post, uninstall) is to pass
`cr, registry`.
But the first thing which was done by most
post init and uninstall hooks was to create an env using
the cr passed
e.g.
`env = api.Environment(cr, SUPERUSER_ID, {})`
and the `registry` argument was unused in all these hooks,
completely.

By changing the API of hooks to pass `env` instead
of `cr, registry`, we gain in average two lines in every
hooks:
- the line creating the env `env = api.Environment(cr, SUPERUSER_ID, {})`
- the line importing `api` and `SUPERUSER_ID`

Therefore removing ~250 lines of repeated code lines accross odoo/odoo and
odoo/enterprise.
In addition to these lines removed,
it also ease the API of init hooks for Odoo developers,
who are used to that `env` and not so much how to create an `env`
from a cursor.

Part-of: odoo/odoo#108254
2023-02-01 10:25:01 +01:00
Victor Feyens 35e474b615 [FIX] account_payment: allow disabling payment of invoices on portal
Since e3eb7d9bef, the accounting logic
has been moved out of the payment module, to be only in the
account_payment bridge module.

This bridge module has been set as strict dependency of
module providing payment & invoicing abilities, e.g. sale .

Nevertheless, the account_payment module also held the logic to
allow users to pay for their invoices on the portal and there
was no dedicated setting to enable/disable this feature.
This means that in 16.0+, you cannot disable online invoices
payment without removing sale and subsequent modules.

This commit introduces a temporary bugfix module to allow
disabling invoices payment without uninstalling the
account_payment module.  It will be merged in the core
account_payment afterwards.

opw-3114860

closes odoo/odoo#110843

X-original-commit: be242cf658e7742600dec4824ba96a89f4d6142a
Related: odoo/documentation#3396
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-01-24 16:18:33 +01:00
Martin Trigaux 776689b0f4 [I18N] *: export saas-16.1 source terms
closes odoo/odoo#110752

X-original-commit: 56b2b52287a8f2192d80ea417c7efac80a87c0a9
Related: odoo/enterprise#36173
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-01-24 10:20:30 +01:00
Anita (anko) 5cc86c3bb1 [IMP] payment: Rename Payment Icon to Payment Method.
Payment Icon sounds confusig comparing to what it really is,
payment method name makes it clearer for user to understand
what it is.

task-2882564

closes odoo/odoo#105678

Related: odoo/enterprise#33908
Related: odoo/upgrade#4029
Related: odoo/documentation#2955
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-01-20 18:54:44 +01:00
Antoine Vandevenne (anv) 42e90fcf15 [FIX] payment, *: re-use the partner of the document
*: account_payment, sale, website_payment, website_payment

opw-3097856

closes odoo/odoo#109695

X-original-commit: a452221c51f5659c88cb479ded192a2ad395e7d6
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-01-11 22:43:22 +01:00
Valentin Vallaeys (vava) 90af85c2e4 [IMP] payment(_*): show available currencies for payment providers
Before this commit, the lists of supported currencies by payment
provider were hard-coded in the Python scripts, which made them
unavailable to the users.

With this commit, the implemented initial lists of supported currencies
are displayed on the form view and are editable, because Odoo lists may
not be up-to-date. Empty lists do not trigger any filtering on the
payment providers to access payment methods.

For Authorize.net and Asiapay payment providers, the specific
`(authorize,asiapay)_currency_id` are removed and the generic payment
provider field `available_currency_ids` is restricted to a single-item
list when one of those providers is enabled.

task-2926016

closes odoo/odoo#101018

Related: odoo/enterprise#34158
Related: odoo/documentation#2788
Related: odoo/upgrade#4069
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-01-05 16:51:56 +01:00
momegahed 636601c4a4 [FIX] payment: user is able to delete linked journals
Steps to reproduce:

1- install any payment acquirer (e.g. stripe)
2- configure the payment acquirer and link it to a journal
3- try to delete the journal
4- the journal can be deleted which will create an internal server
error when this payment acquirer is used

Bug:

There is no restriction on deleting `account.journal` linked to
payment acquirers

Fix:

add a restriction that forces the user to remove the journal from the
payment acquirers first

OPW-3089006

closes odoo/odoo#108403

X-original-commit: 3ec6fe4ab1df3e3368fd06ff0e18a240caf088e5
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Mohamed Megahed Abbas Megahed SALLAM (mome) <mome@odoo.com>
2022-12-21 15:35:53 +01:00
Goffin Simon 4be998412a [FIX] payment: Wrong use of write method on not stored field
Steps to reproduce the issue:

- Accounting > Configuration > Journals
- Click on Journal
- View metadata of Journal

Bug:

Even if no modification has been made to the journal, it marked current time
in Latest Modification By/Date

opw:3089551

closes odoo/odoo#107875

X-original-commit: 47999e7b1c9a52059f84abaafeac388f2991a621
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-12-13 19:11:22 +01:00
niyasraphy 89c95544d6 [FIX] *: make some user errors translatable
*: base, account_payment, l10n_ar, mrp_subcontracting, point_of_sale, pos_restaurant, purchase, sale

closes odoo/odoo#107264

X-original-commit: edd928cd0c63a01d1ee8b28ed344f61e9b6d0b54
Related: odoo/enterprise#34676
Signed-off-by: Julien Castiaux <juc@odoo.com>
2022-12-09 11:48:50 +01:00
Antoine Vandevenne (anv) 78dee0874c [IMP] payment_demo: store a dummy provider reference on transactions
As provider references are included in the memo of `account.payment`
records, it makes sense to set one on demo transactions to mimic what
is done with other providers.

task-3063368

closes odoo/odoo#106486

X-original-commit: 73865f2bd03c7d224f0a64659652e8e40c4ba192
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Horacio Tellez Perez (hote) <hote@odoo.com>
2022-11-29 17:22:54 +01:00
Horacio Tellez 376ad4a429 [IMP] account_payment: Better reference for account payment memos
The Memo field in the form view of the `account.payment` model
(the `ref` field) was a little cryptic and did not supplied a lot
of information about the payment.
After this commit the Memo will (if available) provide information
about the sales order, the partner and the payment transaction.

Task - 3063368

X-original-commit: 414fb09b718a100cb96857725523e7a9109135cf
Part-of: odoo/odoo#106486
2022-11-29 17:22:53 +01:00
Demesmaeker 05a8f79b46 [IMP] payment, *: better handle company mismatches
Rather than hiding all payment providers and payment tokens from the
payment form, a warning is now shown to the user if their company is
not the same as that of the document (SO, invoice, ...) they're paying
for.

task-2983985

closes odoo/odoo#100375

Related: odoo/enterprise#31424
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-11-24 19:24:57 +01:00
Stefan-Calin Crainiciuc (stcc) eadca2ee0a [FIX] account_payment: typo in portal template
Steps to reproduce:

- Setup Wire transfer as Payment Provider
- Create a sale from shop
- Use Wire transfer as payment method
- Go to Sales > Confirm the quotation
- Create Invoice
- Click 'Preview' to view invoice in customer portal view

Issue: internal server error

The `provider` field has been renamed to `provider_code` in b7f5eb54453737f371eda4ca897300b89abd9c2e

opw-3031308

closes odoo/odoo#104441

X-original-commit: 4841aae833c462cd28fe3dbc81f12fb35afc8187
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
Signed-off-by: Stefan-Calin Crainiciuc (stcc) <stcc@odoo.com>
2022-10-28 14:20:59 +02:00