Commit Graph
78 Commits
Author SHA1 Message Date
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
Rémy Voet (ryv) 3c62ca1eb9 [REM] core: remove name_get API
Rationale
=========

Since v8, the `display_name` field is present on all models. By default,
`display_name` uses `name_get` which has pretty much the same purpose
(return record name used by the web client). Gradually, many (backend)
developers (and the ORM: https://github.com/odoo/odoo/commit/6da1c3ac4c036eac289597602976538e243cb939)
started using `display_name` (more convenient than
`record.name_get()[0][1]`) but it still had the `name_get` override.
It becomes more complex than necessary and poeple start to misunderstand
the two (and sometimes override both, leading to inconstiencies between
`display_name`/`name_get`).

To simplify the ORM and the API, we decided to keep only one of them,
the `display_name` field:
- It is much more convenient from a backend point of view
(`record.name_get()[0][1]` vs `record.display_name`)
- It is cached during the same transaction (and invalidated if
its dependencies change)
- It can be overridden like any other compute field (override
`_compute_display_name` with any extra dependencies)
- `name_get` is replaced by `read(['display_name'])`
(API perceptive), which can actually be more efficient
(if `display_name`'s depends are correct, the ORM will only fetch the
fields it needs instead of every prefetchable field)

Changes
=======

- Deprecates `name_get` for the v17 and based the method on
`display_name` (the opposite of before)
- Converts all usage of `name_get`
- Overrides of `name_get` are now overrides of `_compute_display_name`
- For `res.partner`, rename the field store `display_name` into
`complete_name` because `display_name` context-dependent and it makes
no sense to have a compute store that is context-dependent.
- Previously, it was possible to return multiple names for the same
record with `name_get`, but it was tricky and most of the usage of
this `name_get` didn't take this into account. The only example of
this is the `name_get` of `product.product`
(now use `", ".join(<names>)`).

Part-of: odoo/odoo#122085
2023-06-28 17:41:19 +02:00
Anita (anko) 3c9c848e55 [FIX] payment: fix multicompany payment confirmation onboarding step
User was not able to go through onboarding if they switched company.
By default it tried to edit default payment provider that was conected
to the main company so other companies were recieving Access Error.

opw-3281770

closes odoo/odoo#122590

X-original-commit: ffda55101739f9a99cabd6caee52dcb8d18d8fed
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-05-30 18:03:53 +02:00
Horacio TellezandMorgane Demesmaeker aa03d3380a [IMP] payment,sale: also confirm quotation after multiple partial payments
When creating payment links for the customer, the user can now decide on a partial amount to be
paid at the time.

Use case: when the customer cannot pay the SO amount with one payment, e.g. limit on the credit
card, the user will now have the possibility to set a partial amount on the payment links.
The order will be automatically confirmed when the amount chosen is equal to the remaining amount
to be paid.
Additionally, the customer will be notified by email for each payment done instead of only at the
confirmation of the order, which will happens only once the total amount is paid.

Task - 2672713

closes odoo/odoo#109661

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Co-authored-by: Horacio Tellez <hote@odoo.com>
Co-authored-by: Morgane Demesmaeker <edm@odoo.com>
2023-05-16 20:33:07 +02:00
Brieuc-brd 418413e499 [IMP] web, *: directional icons
This commit adapts the directional icons to improve the usability and
maintain consistency with the ui icons library.

task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:22 +02: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
Anita (anko) e5c187ade8 [IMP] payment(_paypal): UX and payment flow improvements
UX was lacking comparing to other payment providers,
important fields were not always shown or were checkboxes
when they should be automatically true.

In order to make payment flow easier and more intitive, unnecessary fields
were removed, email is automatically filled. Now when user cancels transaction
on paypal before paying, it automatically cancels transaction on Odoo. Additionaly, quick
onboarding is only available if user already has paypal account and Stripe
no longer installs ond configures paypal if Stripe's onboarding get canceled.

task-2854184

closes odoo/odoo#104974

Related: odoo/upgrade#4025
Related: odoo/documentation#3063
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-02-17 14:09:43 +01:00
Valentin Vallaeys (vava) 927a2b38db [FIX] payment: move button label to string attribute
Before this commit, the text of a `CopyClipboardButtonField` could be
edited with a `label` option. But this label was never translated.

After this commit, the field `string` is used instead to rename the
button. This is automatically exported for translatation.

task-3054813

closes odoo/odoo#105560

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-12-15 11:30:50 +01:00
Valentin Vallaeys (vava) 4cf5476c18 [FIX] payment: warning display over full wizard screen
closes odoo/odoo#105892

X-original-commit: 521da3aa78371e33ced0de7f9da8d90a5a2d6498
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
2022-11-17 21:58:50 +01:00
Valentin Vallaeys (vava)andValentin Chevalier 693511076d [IMP] Payment: hide the URL payment link
Since the generated payment link is not editable, it is hidden behind
the wizard copy button.

To help the users understand the button, the text on the button can now
be edited in the xml with a `label` attribute.

task-2683480

closes odoo/odoo#100261

Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
Co-authored-by: Valentin Chevalier <vcr@odoo.com>
2022-10-26 15:06:48 +02:00
Damien Bouvy 909ef1ff4a [FIX] payment: onboarding view UI fixes
closes odoo/odoo#103120

X-original-commit: e321002f6a9c7a6f46c7e45cde1fd283da50acfa
Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
2022-10-11 21:23:25 +02:00
Valentin Chevalier a6cd96c5c5 [IMP] (account_)payment, sale: add docstrings
Add docstrings to clarify methods in the payment link wizard.

closes odoo/odoo#100186

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-09-19 08:38:12 +02:00
Horacio Tellez f7b8f07501 [IMP] payment: rename of acquirer to provider
Changing the name of model payment.acquirer to payment.provider
and everything that it touches. It is technically incorrect to
use the term "acquirer" for systems that only provide a service
of payment.
After this commit the model payment.acquirer and all related to
it will be renamed to payment.provider.

Task - 2842088

closes odoo/odoo#90899

Related: odoo/upgrade#3542
Related: odoo/documentation#1981
Related: odoo/enterprise#27131
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-09-09 13:38:08 +02:00
Victor Feyens 61b8c0c1a2 [REF] (account_)payment: extract accounting logic from payment 2022-09-06 13:31:00 +02:00
Victor Feyens 5f41f15e6b [MOV] payment_transfer: rename to payment_custom
The module `payment_transfer` was originally meant to implement a
payment with Wire Transfer flow, which it does not exactly do since all
it does it making transactions follow the payment flow until their
`pending_msg` field's content is shown to the customer. Because of that,
other modules (`website_delivery_ups`, `website_sale_picking`) started
duplicating the base acquirer Wire Transfer to create new payment modes
such as Cash on Delivery and Pay in Store.

To better prepare for a proper dinstinction of the custom modes enabled
by other modules, this commit renames the module `payment_transfer` to
`payment_custom`.

The module `payment_transfer`'s `auto-install` key is also set to
`False` since we no longer want Wire Transfer to be the default payment
acquirer for new databases.

task-2853489

Part-of: odoo/odoo#99400
2022-09-06 12:01:37 +02:00
Fabien Pinckaers 3363e55cac [IMP] cleanup of help messages in all modules
This commit aims at removing unuseful help message to:
1/ reduce translators work, to focus on more useful translations
2/ not sending unuseful information in load_views
3/ reduce help message to useful messages, so that we can mark
   fields having a tooltip in the future UI.
4/ some cleanup of existing messages too

The main use cases:
- REMOVED: help redundant with the field name, providing no extra info
- MOVED TO COMMENT: technical help messages, that should not be in UX

closes odoo/odoo#97279

Signed-off-by: Fabien Pinckaers <fp@odoo.com>
2022-08-02 00:26:53 +02:00
Horacio Tellez c1aa010af7 [IMP] payment: filter out acquirers based on the amount
This commit adds the possibility to define a maximum payment amount that
a given acquirer can process. If the payment amount exceeds the value,
the acquirer is filtered out of the available acquirers listed on the
payment forms.

While we're at it, the field `country_ids` is renamed to
`available_country_ids` to better depict that it is not a property of
the acquirer, but a configuration option. It will also be coherent with
the field `available_currency_ids` that is expected to be added soon.

Task - 2162165

closes odoo/odoo#82411

Related: odoo/enterprise#24412
Related: odoo/upgrade#3703
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-07-26 13:24:57 +02:00
Romeo Fragomeli 1fcd098af5 [REF] *: BS5: migration
Automated change made by a lot of RegEx to change all think that is
possible to automate.

https://getbootstrap.com/docs/5.1/migration

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:24 +02:00
Thibault Libioulle 2e7cc0d82f [IMP] payment{,_stripe},{,website_}sale: clean up stripe connect code
This commit removes deprecated actions and methods kept after the merge
of PR #79621 in stable.

Follow-up
task-2685160

closes odoo/odoo#84789

Related: odoo/upgrade#3256
Related: odoo/enterprise#25369
Signed-off-by: Thibault Libioulle (tle) <tle@odoo.com>
2022-03-29 08:57:43 +02:00
Antoine Vandevenne (anv) adf70bf9dc [FIX] *: retarget documentation links to master
closes odoo/odoo#84990

X-original-commit: 39bdf46
Related: odoo/enterprise#24582
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-02-21 17:01:02 +00:00
Thibault Libioulle c5198b0bab [IMP] payment{,_stripe},{,website_}sale: improve stripe onboarding
This commit lighten payment onboarding form in order to take advantage
of the Stripe Connect Onboarding Flow. It integrates the Stripe
Onboarding using the IAP proxy.

Purpose
=======
Help users easily onboard with Stripe by using the Stripe Connect API.

Specifications
==============
During the payment onboarding, if the user selects Stripe, they will
start the Stripe Onboarding. (NB: The process uses a proxy that handles
the Stripe Onboarding calls and signs them with the Stripe Connect key)
1) A call is made through the proxy to get the Stripe account token;
2) A call is made through the proxy to get the Stripe account link which
   contains the URL of the Onboarding;
3) The user is redirected to the Stripe Onboarding;
4) The user completes the Stripe Onboarding;
5) The user comes back to the acquirer form of Stripe and is able to get
   their keys.
6) The user can directly create their webhook after having copied/pasted
   their API keys.

During the website sale onboarding, the user doesn't go through the
onboarding wizard but is directly prompted to activate their account.

Note that the Onboarding status isn't stored in the database so there is
no call to Stripe API to validate the account status.

API Documentation :
- Connect Onboarding: https://stripe.com/docs/connect/standard-accounts
- Webhook creation: https://stripe.com/docs/api/webhook_endpoints/create

task-2685160
task-2691213

closes odoo/odoo#84639

X-original-commit: 085f4af4e57c43127413585a8df5b3aa47843339
Related: odoo/enterprise#24376
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Thibault Libioulle (tle) <tle@odoo.com>
2022-02-15 16:51:24 +00:00
Merlin (megu) 2aedbbdd50 [FIX] payment: enable Wire Transfer as payment method
Error raised when trying to add the Wire Transfer payment method in eCommerce

Steps to reproduce:
1. Install the eCommerce app
2. Open the Website app
3. Click on "Set payments" on the eCommerce Dashboard
4. Select "Custom payment instructions", fill in the fields and save

Solution:
Remove the piece of code that raised the error

OPW-2687671

closes odoo/odoo#81929

X-original-commit: 25e153ab652f7a4bcc70e145b47bc138d9fb3790
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
2021-12-27 14:12:45 +00:00
Valentin Chevalier dd8a3674af [REF] payment: cleanup payment link wizard
Delete code that is not useful anymore and was introduced in
task-2666881 (PR #78334)

task-2694027

closes odoo/odoo#80051

Related: odoo/upgrade#3050
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2021-11-30 15:22:01 +00:00
Valentin Chevalier 46be53f2c1 [FIX] payment,sale: access error in payment link
When a user was opening the payment_link_wizard and tried to select a
preferred payment acquirer, he was getting an AccessError telling that
he was not allowed to access 'payment.acquirer' records.

Fix PR #69334 (task-2504225)

task-2666881

closes odoo/odoo#80005

X-original-commit: 2ff580c073ac105219582dbf2108a1437645c9b5
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2021-11-18 18:45:11 +00:00
Victor Feyens ab022ec12d [FIX] *: target v15.0 documentation with doc links
X-original-commit: acc95ec204baa1dddbe292c379a1768fe1deccbf
Part-of: odoo/odoo#77923
2021-10-07 17:59:52 +00:00
Demesmaeker 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
Kevin Baptiste 86aa7b78aa [IMP] *: introduce data-hotkey on form and modal views
Define `data-hotkey` on most used action buttons.

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

closes odoo/odoo#73275

Taskid: 2588233
Related: odoo/enterprise#19464
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-07-15 08:39:49 +00:00
Nicolas (vin) 9e432ed243 [FIX] account, payment: Various fixes for account payments/method lines
There is an issue when computing the suitable payment token ids making it impossible to
open a payment for a user without access to payment acquirers.

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

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

Also fix an issue with the ordering of payment method lines

X-original-commit: 73410a0fd76a70e1730883d35b79fc603741b59c
2021-07-19 15:17:32 +00:00
Demesmaeker 9612ede9ca [IMP] sale, payment: improve the UI
Small UI improvements for clarity/continuity:
1. In the "Sales' onboarding wizard > payment configuration >
documentatlion link", font roboto is now used.
2. In the sales order, the error message when 'there is nothing
to invoice' now also explains also what the user has to do to invoice
"Prepaid" services.
3. In the "Payment confirmation" section of the payment portal,
'Reference', 'From' & 'Amount' fields don't look like editable
fields anymore.
4. In the payment forms, tokens created with the Test acquirer
are now identified with a "Test Token" badge in place of the
verified token checkmark.

task-2505913

closes odoo/odoo#70076

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

Task id #2573145

closes odoo/odoo#73596

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

task-2494916

closes odoo/odoo#72992

X-original-commit: 6c13a361400332955cdf5ac5a14bd1970b4f66ef
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2021-06-30 11:42:43 +00:00
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
Fabrice Henrion 5f476a0f41 [FIX] payment: grammar issue
👮

Finetuning of #69334

closes odoo/odoo#71452

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

Task #2504225

closes odoo/odoo#69334

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Co-authored-by: Valentin Chevalier <vcr@odoo.com>
2021-05-28 09:24:57 +00:00
Victor Feyens 0348b95aee [FIX] *: update documentation links
Following the recent reorganisation of the documentation in 12.0+,
the majority of the documents have been moved and their old links are no longer valid.
Some redirection rules will soon be deployed, but those rules might be dropped in some years
and we want the links to still work, which is why we still replace the links to the new ones.

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

closes odoo/odoo#70920

X-original-commit: bc9c1eef538ba6095e74c19d5d9ed9e01625ec7c
Related: odoo/enterprise#18361
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2021-05-17 19:26:27 +00:00
Antoine Vandevenne (anv)andVictor Feyens 573ed74c12 [REF] payment, *: refactor online payments API
This commit replaces the old online payments API of the `payment`
module with the new one and adapts to it all the implementing modules.

See the merge commit for more details.

task-2085989
task-2119838
task-2165982
task-2289255

Co-authored-by: Victor Feyens <vfe@odoo.com>
2021-03-30 09:25:51 +02:00
nie 3a7db03295 [FIX] payment: link transaction to invoice with payment link
Steps:
- Install account,payment
- Go to Invoicing
- Create an invoice
- Click Actions > Generate a Payment Link
- Follow the generated link
- Pay

Bug:
The transaction is not linked to the sale order in the link table
`account_invoice_transaction_rel`

Explanation:
This fix is broadly mimicking the behavior of the sales module regarding
the link of an order to a transaction, adding `invoice_id`s where they
are needed throughout the payment process in order to link the
transaction to the invoice.

opw:2451534

closes odoo/odoo#67296

X-original-commit: 7c6d06fa5858f79f3b22cdeaf74cdc26a642742f
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: backspac <backspac@users.noreply.github.com>
2021-03-04 19:28:25 +00:00
nie e8fac631c8 [FIX] payment,sale: Use record website domain in links
Steps:
- Go to Settings > Users & Companies > Companies
- Create a new company (1)
- Install a payment acquirer and Website
- Go to Website > Configuration > Settings:
- Select "My Website 2"
- Assign it to company (1)
- Add a custom domain
- Save
- Switch to company (1)
- Go to Invoicing
- Create a new Invoice:
  - Add a product line
- Post it
- Click Action > Generate a Payment Link

Bug:
The base domain is used instead of the domain of the website linked to
the invoicing company.

Explanation:
The app only uses the URL on which the user has logged in to generate a
payment link. If the user has multiple companies, this can confuse
customers if they land on another domain than the one they are used to.
This commit makes the app use the domain of the website of the record
linked to the payment if it has one.

opw:2440251

closes odoo/odoo#65938

X-original-commit: 700dba53843e71f5f34c86305cc658d9273914aa
Signed-off-by: backspac <backspac@users.noreply.github.com>
2021-02-11 10:08:25 +00:00
Laurent Smet 516b80fc07 [FIX] account,payment: Fix payment token flow after payment refactoring
- The field 'invoice_ids' no longer exists on account.payment.
- When registering a payment using a payment token, the payment is not posted directly but the payment transaction is processed instead.
It means the payment is not posted until the CRON call. Since 14.0, the journal items can't be reconciled if not posted and then, we can't wait the CRON to update the payment state.
- The payment token is no longer available when registering a payment for invoices.

closes odoo/odoo#60918

Task: 2352628
X-original-commit: 0ad8979cb345805b7b1bdc330621b42e1d625593
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-10-29 09:25:19 +00:00
Martin Trigaux 6156f98288 [FIX] *: adapt action content retrieval
Use _for_xml_id to replace all the self.env.ref().read()[0]
This has the advantage of having a single point of control and to add
the fields filtering and model verification.

Add sudo for other operations on ir.actions.*
2020-08-17 09:09:02 +00:00
Xavier Morel 6835aeb0de [REM] core, *: deprecate <act_window> and <report>
Convert deprecated tags through the codebase.
2020-07-28 13:03:13 +00:00
Anh Thao Pham (pta) cc8c036f87 [FIX] payment: use currency precision when comparing amounts in Payment Link wizard
In Sales, in Payment Link generation wizard, when entering manually the total of the quotation
as Amount, it can happen that the Validation Error asking to set an Amount smaller than the total
is triggered.

opw-2287794

closes odoo/odoo#54309

X-original-commit: a7034b75383f23f309d97a86cbde7d9f8176ed6d
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-07-10 09:41:08 +00:00
Martin Trigaux 400cc4f14e [FIX] *: correct all or improve code translation lookup
This commit fixes all issues detected by the new pylint
gettext-variable test.
It converts some calls to the new syntax
  _("Foo %s", bar)

to progressively migrate the code to the new syntax.

A few calls were not technically incorrect but still detected by the
linter.

  _("Foo" +
    "Bar")

has been converted to

  _("Foo"
    "Bar")

as it has the same effect and make sure the argument is of type
asteroid.Const instead of BinOp).

closes odoo/odoo#53683

Related: odoo/enterprise#11467
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-06-30 10:19:59 +00:00
jev-odoo 2ef534a6d5 [FIX] payment: Add email warning when generating payment link
As some payment acquirers require the email to be set,
a warning is shown when generating a payment link if
the partner does not have an email.

OPW-2254011

closes odoo/odoo#51857

X-original-commit: 6f61e89ab9b947ca54cfd8dbd5470083a625d24e
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2020-05-26 08:56:03 +00:00
Damien Bouvy 34867df728 [FIX] payment,sale: company information in payment wizard link
When generating a payment link through the payment link wizard, the
company was previously not included. This could cause accounting issues
if the acquirer displayed to the customer were not part of the same
company as the underlying document that generated the link.

This commit add a new computed field 'company_id' on the wizard model
that gets computed based on the underlying model; this field will be
included in links generated by the wizard to limit the acquirers
displayed to those of the that company, preventing extra acocunting
steps (interco reconciliation).

opw-2254011

closes odoo/odoo#51441

X-original-commit: a6fcd7e0cfec8d4c62620a53b5fa806561e239af
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2020-05-18 12:07:34 +00:00
Raphael Collet ea3e39506a [IMP] models: use slots for BaseModel
This restricts the attributes of a BaseModel instance to `env`, `_ids`
and `_prefetch_ids`.  This way, one can only assign fields on a record;
other assignments are programming errors.

This also reduces the memory footprint of records from 168 to 64 bytes
(-62%), and makes their instanciation faster.

closes odoo/odoo#51075

Related: odoo/enterprise#10529
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-05-18 09:51:43 +00:00
Laurent Smet caeb782841 [IMP] account,*: Improve bank statements/payments workflow
- Create journal entries as soon as bank/cash statement lines are created, temporary booked on a suspense account set on the journal.
- Simplify the management of "blue" lines in the reconciliation widget. A "blue" line is now a journal item using a temporary liquidity account (outstanding payment/receipt accounts, set on the journal).
- Adapt and simplify the bank reconciliation report.
- Remove the bank reconciliation threshold date. The reconciliation report will show the not already reconciled journal entries using a liquidity account and the not already reconciled journal entries using a temporary liquidity account. Without accounting, an account.payment will involve directly the liquidity account and then, will be considered as a statement line directly.
- Remove the post_at bank reconciliation feature. The "paid" state will be set on the invoices only if reconciled with a journal entry involving the journal's liquidity account.
    With invoicing, the payment will do that so the "in_payment" state should never be shown up.
    With accounting, only the statement lines have the power to move an invoice to the "paid" state.
- Fix various corner cases about the management of multi-currency in bank statement lines.
- Fix the conversion dates in multi-currency: Since the bank/cash is always used on the statement lines, it will use always the real "bank" date instead of the fictive payment one.
- Ensure the 'reconcile' method will raise an error if the involved moves are not posted.

related enterprise PR odoo/enterprise#7019

closes odoo/odoo#41301

--task: 2092096
Related: odoo/upgrade#1018
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2020-04-10 09:47:24 +00:00
Swapnesh Shah cf42c2e27c [FIX] sale,payment: Encode Payment URL correctly
Before this commit, Payment URL was not encoded correctly which can compute Payment refernece Wrongly on website.

Eg,
  Enter Description which contains Special Characters
  Go to Payment Page using Computed URL.
  There will be wrong Payment Reference on Payment page.

With this commit, We encode Payment reference before generating Payment URL.

closes odoo/odoo#47387

X-original-commit: 6ebcc43d177b9333afa73ee90e976d57111aaf3d
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-03-11 12:25:06 +00:00
Paul Morelle 35ab45e46c [FIX] payment: prevent ACL denial when unlinking onboarding wizard
Since wizards shall not be unlinked by anyone, but as we want to get rid
of this specific one immediately to get rid of eventual credentials,
do it with elevated privileges.

Before this commit, the behavior was an authorization error when trying
to applying the payment method, in a fresh invoicing configuration.

closes odoo/odoo#45363

X-original-commit: c8ee9c73d4ac9989d05843a32abc535b20d761b4
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-02-14 08:45:57 +00:00