Commit Graph
233 Commits
Author SHA1 Message Date
Barad Mahendra 4ef4aa2083 [IMP] payment: Log error message on payment transaction failure
Currently when the payment is initiated there is a message in
sale order for waiting for confirmation.

But when the payment returns an error there is no message on
sales order so it's not clear for the end user that payment
is still pending.

Related Task ID : 58741
2019-02-13 06:12:39 +00:00
Christophe Simonis cf52a04979 [MERGE] forward port branch saas-12.1 up to d3b8422c9c
closes odoo/odoo#30614
2019-01-28 13:58:11 +00:00
Toufik Ben Jaa 7f524c393d [FIX] payment: display payment tokens for form acquirers
- The method `_get_available_payment_input` that returns the available
  payments acquirers and the payments tokens for a specific user never
  returns the payments tokens linked to a non s2s payment acquirers.

  This is wrong, the payments tokens should always appears no matter
  what are the acquirers' payment flow.

  The payment flow is used only to specify where the customer should
  input his credit cards details, either on Odoo or on the payment
  acquirer's website (or popup).

  Once a token is created, it is safe to process it since no credits cards
  details are stored on the Odoo database.

closes odoo/odoo#30258
2019-01-16 09:45:38 +00:00
Pierre Masereel 5f724892e7 [FIX] payment: create payment transaction without partner_id
The field partner id is not a required field in payment transaction, and
we try to read its value in the dictionnary given to the create
function, so if a transaction is created without the partner_id, it will
raise a KeyError.

So to fix it, we only complete the pratner values on the payment
transaction if a partner_id is given.
2019-01-10 13:41:49 +00:00
Toufik Ben Jaa 84b976fb7c [FIX] payment: process payments older than 10 minutes
- The payment transaction processing cron retrieves all the transactions
  that need to be processed.

  In some cases, it can causes issues when trying to process payments
  that are being process by the payment polling page after returning
  from the payment acquirer.

  To avoid this concurrency issues, the cron will only process payments
  that have been validated for at least 10 minutes.

closes odoo/odoo#29317
2018-12-06 14:09:24 +00:00
Toufik Ben Jaa f289c9ceef [FIX] payment: set correct payment communication
- When a payment is done through a `payment.transaction` the
  communication should be the transaction's reference instead of its
  invoices reference.

closes odoo/odoo#29187
2018-11-30 12:53:37 +00:00
Christophe Simonis d7c5bc02cc [MERGE] forward port branch saas-12.1 up to 8aa8548d8a 2019-01-09 19:59:27 +01:00
Thibault Delavallée b8197ff178 [REF] various: update tracking parameters
Purpose is to clean the use of tracking parameters on fields. Parameters are
merged and is now tracking=<int> or tracking=True.

This commit is linked to task ID 1903814 and PR #28430.
2019-01-04 11:46:14 +00:00
Xavier Morel 66f0e26f6f [CHG] *: make binary fields default to attachment=True
Check that it makes custom binary fields into attachment as that's the
main reason for the change: when users create binary fields via Studio,
they're necessarily db-stored (as the interface doesn't allow altering
the attachment attribute and it's unclear how we'd handle users
switching it on/off every time), which significantly bloats their
database (and burns storage & backup space), especially as the primary
use case for binary fields is adding images and documents to records.

* check that binary fields are properly created as attachment=True
* add attachment=False on fields where that seems relevant (most but not
  all of the fields previously using the default)
* remove occurrences of attachment=True

closes odoo/odoo#29308
2018-12-07 13:37:34 +00:00
Toufik Ben Jaa ae6ab96629 [FIX] payment: if a payment transaction processing fail, rollback.
- Before this commit when a transaction failed, the code doesn't
  rollback and continue to process the other transaction, thus creating
  record that should be rollbacked.

closes odoo/odoo#28748
2018-11-22 11:44:36 +00:00
Ivan Yelizariev a0bda6bcf2 [FIX] account: fix code of transfer account
Transfer accounts created for payment acquirers was ignoring the prefix of the main transfer accounts and was always creating accounts with code 000001, 000002, etc.

The reason is because the method was called on an empty recordset

closes odoo/odoo#28789
2018-11-20 07:41:48 +00:00
Christophe Simonis 43b63a0465 [MERGE] forward port branch saas-11.4 up to 57e387b645 2018-10-01 16:01:54 +02:00
Adrian Torres 3f4f77fd9d [REF] *: adapt code to new related default behaviour
This commit adapts the business code to changes introduced by
the parent commit in order to keep the same behaviour as before.

All readonly=False fields will have to be checked afterwards to confirm
that the business case requires write access to the source field.
2018-09-27 12:10:23 +02:00
Nimesh Jethva 7246170de6 [IMP]account_*: Improvement in model description
Purpose of this commit is to give description more "business oriented"
because those descriptions appears in Odoo Studio which is supposed to be used by end users, not only by developers.

Related Task ID : 37311
2018-09-21 11:45:14 +02:00
sed-odoo 3a883e6728 [IMP] l10n_ch,account,website_sale: Add SwissQR Code on invoice and improve the SEPA QR Code usability
Purpose
=======

 - Add the SwissQR Code on the invoice in aim to replace the actual ISR
 - Improve the settings of the SEPA QR Code to make it more user friendly

Specifications
==============

 - ln_ch:

   - Add a SwissQR Code on the invoice to fit the Switzerland QR-Bill Format
   - Use the "partner_bank_id" field to generate the QR Code
   - Add function to get the address number out of the field "street" and "street2"

 - account:

   - Remove the SEPA QR Code's journal settings from the general setting
   - Display the "partner_bank_id" field on the invoice "Other info" page
   - Use the "partner_bank_id" field to generate the QR Code

 - website_sale:

   - Add a check box on the payment acquirers to use the SEPA QR Code on the e-commerce
   - Use the payment acquirer "journal_id" field to generate the SEPA QR Code
2018-09-20 09:41:06 +02:00
Toufik Benjaa 6ed44181d0 [IMP] payment_*: payment acquirers error handling
This commit aims to improve the user experience when using payment acquirers. There currently are no error feedback with some acquirers, which leaves the user wondering what is going on and what is the real status of its payment.
In some cases, the user is currently being redirected to the home page even though the payment has failed. We want to make it more obvious to the user that something unexpected has happened by redirecting to an intermediate page that will provide good feedback on payments status.

Another goal of this commit is to order acquirers by sequence instead of by flow and to select the first acquirer by default. This feature was already implmented in commit fe294fd43e521bd2d339e962f43acf46c3d4cb97, some UI adaptations were needed though.

Related to task #36680
Closes #26958
2018-09-19 18:25:32 +02:00
Toufik Benjaa d30fa83114 [FIX] payment: crash when validating a payment.transaction
- If a payment.transaction is already linked to an account.payment, the
  transaction validation crashes.
2018-09-19 14:08:00 +02:00
Christophe Simonis 9c77066f34 [MERGE] forward port branch saas-11.4 up to 6c103589c1 2018-09-14 16:00:17 +02:00
Christophe Simonis f3fa5a5ef7 [MERGE] forward port branch saas-11.3 up to 1e0a92c996 2018-09-13 19:30:33 +02:00
Laurent Smet 99f599232b [REM] account, payment, website_sale: remove dead code 2018-09-11 15:04:10 +02:00
Christophe Simonis 826cd9b3d3 [MERGE] forward port branch 11.0 up to c3ea0a7811 2018-09-10 19:21:57 +02:00
Christophe Simonis 86ff929ad6 [MERGE] forward port branch saas-11.4 up to 1199451606 2018-09-10 17:06:18 +02:00
Nikunj Ladava 2ea7d9b10e [IMP] payment: Improved error message for an empty field in payment.acquirer form view
- payment.acquirer have many fields with 'required_if_provider'
   attribute and while saving form it gave an error like "Required
   fields not filled", so it was confusing to know  which required fields were empty.

 - after this commit, it is displayed like "Required fields not filled (field name)"

opw:1881054
2018-09-10 16:46:21 +02:00
Toufik Benjaa 29cd2c33eb [FIX] payment: allow to set done a payment.transaction in pending state
- If a payment.transaction is in pending state, it was impossible to set
  it to done.
2018-09-10 10:41:37 +02:00
Christophe Simonis 68d36512ef [MERGE] forward port branch saas-11.4 up to d78f23df84 2018-09-07 20:20:45 +02:00
Toufik Benjaa d78f23df84 [FIX] payment,sale_payment: extract code to overridable methods
- We extract some code logic to methods to allow to override them.
  This is needed for the subscription module where a payment token need
  to be copied from a transaction to a subscription.
  The subscriptions is created from a sale order and before the
  payment.transaction holding the payment.token id is validated.
  Since the payment.transaction is not validated, the subscription
  module doesn't find the correct transaction.

  By extracting this code logic, we can override exactly when it should
  be.
2018-09-07 19:26:51 +02:00
Toufik Benjaa e11c0a45f2 [FIX] payment: Fix reference computation to avoid duplicates
- The method to compute the reference of a payment.transaction and avoid
  duplicate was missing some edge cases (for example if there was a '-'
  in the reference).

- The creation of transactions in the route /website_payment/pay was not
  checking for duplicate payment.transaction.
2018-09-06 16:03:01 +02:00
Toufik Benjaa 541e049d96 [FIX] payment: properly set communication field on account.payment
- After 01216345e2 the field communication
  on account.payment was not properly set when created by a
  payment.transaction.
2018-09-06 15:57:27 +02:00
Christophe Simonis 6fc061a96d [FIX] payment: force company when posting payments 2018-09-06 14:25:23 +02:00
Laurent Smet ef42e03b69 [IMP] sale: add reference on SO + improve usability
Like invoices, a reference is now computed on sales orders.
The configuration of such reference is done through the Wire Transfer acquirer.

The usability of the communication feature (on invoices/SO) has been a bit improved to be more clear.

Was task: 1870121
Was PR #26152
2018-08-14 14:44:11 +02:00
eco-odoo 687f9243bd [IMP] sale,account: Improve payment acquirers onboarding step
Purpose
=======

- Propose other payment acquired than the predefined ones
- Improve the layout for this step
2018-08-10 16:50:54 +02:00
eco-odoo 89e358caa8 [FIX] onboarding: Fix/Update onboarding to v2.0
Specification
=============

- Fix lots of bug due to the BS4 migration
- Improve steps
- Validate some steps (Like the company configuration) in all the
  onboarding bars if done in one onboarding bar.
- Only animate the confetti one time if a step is done, instead of
  on each view loading

For more information, see: https://www.odoo.com/web#id=1869513&action=333&active_id=965&model=project.task&view_type=form&menu_id=4720
2018-08-10 16:08:47 +02:00
Olivier Colson 87f0d2eefb [REF] account, account_check_printing, payment, l10n_do, l10n_de, l10n_fr, l10n_nl, l10n_mx: chart templates installation: remove old useless wizards and move everything to account.chart.template
Was task 1858974
Was PR https://github.com/odoo/odoo/pull/25243
2018-08-07 17:11:08 +02:00
Raphael Collet 896e36edab [REF] *: adapt create to work in batch 2018-07-24 16:58:14 +02:00
eco-odoo d1ec3306b8 [ADD] account: onboarding panel for invoicing
Add an onboarding panel for invoicing, it appears above the invoice
list.
After going through the steps the system should be all set to send real invoices.

In the payment module, add a payment acquirer step and add it to the invoice onboarding panel.

task: 60668
2018-07-20 11:59:12 +02:00
Christophe Simonis 182c2c6919 [MERGE] forward port branch saas-11.4 up to 8285630ad2 2018-07-16 12:34:20 +02:00
Toufik Benjaa 03d8f528b7 [FIX] payment: Avoid accessing a field on an integer
- When clicking on the invoices stat button on payment transactions via
the form view a traceback is displayed.
  This is due to the fact that the code is trying to access to a
member/field named "id" on an integer.
  "invoice" is an integer, not a record/object.
2018-07-11 14:15:55 +02:00
sed-odoo f56ad6daf8 [IMP] base,*: Improve the res.partner form view UX
Purpose
=======

The Contact form is one of the most used/important view. It is quite
important to find the piece of information easily and to navigate in
a few clicks to the related views.

Specification
=============

Stat buttons
------------

- Restructure stat buttons with the following order:
Opportunities  -> sales user
Meetings    -> sales users
Sales    -> Sales users
POS Sales -> pos users
Subscriptions   -> Subscription users
Events    -> event user
Tasks -> project user
TIckets -> helpdesk user
Purchases   -> purchase user
Due -> billing: user
Invoiced     -> billing: user
Vendor Bills -> billing: user
Customer/Vendor Partner Ledger -> accounting: billing
Analytic Accounts -> accounting: billing
Credit Cards -> sales user
Direct Debit Mandates -> accounting: billing user
Publish
- Use better/more relevant icons
- Check that the proper access rights are set
- Remove the bank accounts stat buttons and replace it by a one2many
  tree on the Invoicing page.

Fields
------

Move some res.partner fields from the "Accouting" page to the
"sale & Purchase" page:
- Fiscal positions
- Payment terms

Miscellaneous
-------------

- Remove dead code.
- Display nothing instead "Please complete customer's informations and email"
  on the popup when sending an email to a contact without email address.
2018-07-04 15:43:25 +02:00
Romain Derie a7e2bd8666 [IMP] account(_payment), payment, web: show residual amount..
.. & hide transaction list + page numbers on HTML report.

1. Before this commit:
   Portal Invoices were displaying the total amount instead of the residual
   amount. The pay button would also trigger a payment for the total amount

   Now:
   If part of the invoice is already paid, we show the residual amount and
   payment transaction amount are set to residual amount so the client is asked
   to pay what he really needs to pay.

2. Processed transaction results in a bootstrap alert message displayed at the
   top of the page, showing warning, success or alert depending of the result.
   This alert is supposed to show thank message `post_msg` only if it set.

   Before this commit:
   Since `post_msg` is an html field and editable through summernote, it will
   never be empty. Indeed, empty field with summernote are replaced by a `br` tag
   inside a `p` tag.
   The condition would never be false, resulting in an empty `p` with a `br`
   inside being displayed at the bottom of the alert, making it looks like it is
   bugged.

   Now:
   The condition also consider summernote's empty string as such.

3. Remove the transaction list from the invoice portal template since it is not
   an important information to the client.
   Some client would not even understand what it is.

4. Hide page numbers on HTML report since they are not split in pages and page
   number remains empty, resulting in `Page: /` (Or empty square with the
  'clean layout.)
2018-06-22 18:32:49 +02:00
Christophe Simonis f36e6917bd [MERGE] forward port branch saas-11.3 up to 37eed7c509 2018-05-29 17:34:43 +02:00
Richard Mathot a01f7b0e0b [IMP] payment: faster search on transaction reference 2018-05-29 10:06:44 +02:00
qdp-odoo 01216345e2 [REF] account,payment(_*),sale*: downgrade transactions into debug items
It was very confusing for the user to distinct account.payment and payment.transaction. From now on, the transactions are
technical objects and, in the backend, we only refer to it in log messages (Front end will be adapted in the same fashion
later on). They are hidden in debug mode in accounting\configuration\payments as their purpose is now purely technical/log

This commit also aims to reduce the gap between the accounting app and the transactions: account.payment objects are
created/validated upon completion of transaction.

To ease the capture/voiding of pending transactions, the related buttons are now displayed directly on the SO/invoice
instead of the transactions.

Was task: https://www.odoo.com/web#id=35857&view_type=form&model=project.task&action=333&active_id=967&menu_id=4720
Was PR #24043

[FIX] add domain based on journal to payment tokens

Was opw: https://www.odoo.com/web?debug#id=1828206&view_type=form&model=project.task&menu_id=5200
2018-05-23 15:44:55 +02:00
Christophe Simonis fa8a67ee5f [MERGE] forward port branch 11.0 up to 5a943390f2 2018-05-15 20:18:14 +02:00
Nicolas Martinelli 429bcd9464 [FIX] payment_sips: special characters
The field `transactionReference` of Sips must contain only
alphanumerical characters. Previous commit 31dc6b888e solved
the special case of several attempts to pay, but a much simpler case may
appear in v11. Paying an invoice is likely to fail since the reference
contains by default `/`.

In the previous commit, we could simply modify the common `payment`
module code. In this specific case, however, we only change the
reference if the acquirer is Sips.

opw-1841483
2018-05-15 08:33:06 +02:00
Christophe Simonis 87e21ccdc5 [MERGE] forward port branch 11.0 up to 521414b1c1 2018-05-02 19:36:16 +02:00
Laurent Smet 5439e72a4e [IMP] payment*: auto-create journal for payment.acquirer
This commit adds the auto-creation journal for installed acquirers.
This is not easy because:
- The acquirers are created on the 'payment' module but are enabled only when the specific module
is installed. E.g. Paypal is enabled with 'payment_paypal'.
- To create a journal, a chart of accounts is required. However, the post_init_hook on the
'account' module makes the installation order harder. E.g install payment_paypal directly:
The module are installed in the order: account -> payment -> payment_paypal -> l10n_generic_coa.

To fix the problem, the journals are created at two moments:
- During the installation of the chart of accounts.
- At the installation of an acquirer module. E.g. payment_paypal.

Was PR #23904
Was task: 1831620
2018-04-26 11:26:22 +02:00
Christophe Simonis 6773bdbe32 [MERGE] forward port branch 11.0 up to e8f630e44d 2018-03-21 19:36:58 +01:00
Nikunj Ladava cbd395ec36 [IMP] payment, sale_payment: set invoice id in payment transaction form after payment being done from sale order.
Until now invoice_id is filled on the transaction only when we make
payments through invoice. However if we make payments through sale order
then invoice_id is not filled.

This commit fixes that issue. As there is no common point between
sale_payment and account_payment except payment, a void method is added
in payment and an override done in account_payment. That was when both
modules are installed code is correctly triggered.

This commit is related to task ID 1813602. Closes #22746 .
2018-03-20 16:16:27 +01:00
Christophe Simonis e0345a4a3f [MERGE] forward port branch 11.0 up to 2835d29979 2018-03-20 11:45:11 +01:00
Joren Van Onder e94912b9a9 [FIX] payment: do not refund transactions if they need 3DS validation
This was already the intended behavior, but in Python a return inside
of a try...finally does not behave this way. From the Python
documentation [1]:

When a return, break or continue statement is executed in the try
suite of a try...finally statement, the finally clause is also
executed ‘on the way out.’

This can cause issues because some payment acquirers will return an
error when refunding a pending transaction. This puts the transaction
in the 'error' state which means it won't be refunded anymore.

Additionally, putting s2s_do_transaction in a try...except like this
hides any traceback that occurs which makes troubleshooting harder.

[1] https://docs.python.org/3/reference/compound_stmts.html#finally
2018-03-15 14:56:34 -07:00