Commit Graph
174 Commits
Author SHA1 Message Date
fda-odoo 1423ad9379 [Fix] payment: hide save_token field if the payment_mode is in form mode and change typo 2018-01-24 15:34:39 +01:00
Martin Trigaux ff0abd214c [FIX] untranslated defaults
The field was translatable but the default value was untranslated

Fixes #22059
2018-01-10 08:57:12 +01:00
Nicolas Lempereur dc61861f90 [FIX] payment: py3 error payment icon save
Code to thumbnail payment icon image had an error for python3 because
from RPC the image would be a text string instead of an expected
bytestring.

This change accepts both and made another small fix in the view since
image_medium doesn't exist (and image is already thumbnailed).

A third fix was that removing an image caused an error.

opw-803722
closes #22088
2018-01-08 15:58:30 +01:00
Martin Trigaux cab7e0d204 [FIX] *: add missing space in multilines messages
Courtesy of @Yenthe666
2018-01-03 11:09:09 +01:00
Nicolas Lempereur a1da9eec41 [FIX] payment: reload on kanban acquirer install
When installing a payment acquirer from the kanban view, this would by
luck display the form view correctly.

But if we go back to the listing then forward to the form view, things
go awry.

This is because the listing action views have not been updated after the
module installed, this worked at install because we loaded a new action.

This commit change the action so when installing a payment acquirer from
the kanban view, the view is simply reloaded.

opw-786454
closes #21757
2017-12-20 14:14:43 +01:00
Thibault Delavallée 7cb704a324 [IMP] payment: add acquirer computation tools to ease future additions
* add a method computing available acquirers and payment tokens for a
   given partner and company. Those data will be used notably in customer
   portal when displaying the payment form;
 * raise if no partner_id set in s2s process. Indeed this field is
   required but values come from a dict. Current code raises an error
   about None being converted to Int instead of giving the real error;
2017-09-04 14:09:54 +02:00
tbe-odoo be650c5979 [IMP] Fixing the code to fit the reviews 2017-08-29 17:16:42 +02:00
tbe-odoo 2a2a1c7b28 [IMP] payment,website_sale/quote: Renaming a field and labels 2017-08-29 17:16:42 +02:00
tbe-odoo ad095e492f [IMP] payment,website_payment: Change payment.option model name to payment.icon 2017-08-29 17:16:42 +02:00
tbe-odoo 83fdc63b68 [IMP] payment: Fix crash on install
- Fixed a crash when installing payment module.
- Set a more specific css selector to display error on payment form where required input are empty
2017-08-29 17:13:58 +02:00
tbe-odoo 6b38cd8b85 [IMP] payment: UI changes & Fix 500 errors
- Fixed 500 errors when trying to display payment form because of variables partner_id/acquirer_id missing.
- Accepted credit cards are now display next to the acquirer name on the payment form
2017-08-29 17:13:58 +02:00
tbe-odoo 11bc680ae9 [IMP] payment: Remove ugly render() hack
- Removed an ugly hack that renders s2s forms then display them using t-raw, we're now providing the xml_id of the s2s forms and uses t-call instead.
2017-08-29 17:11:23 +02:00
tbe-odoo 194d52e8fd [IMP] website_quote/sale,payment: Support of the new payment form
- Online quotation and e-commerce now use the new payment form.
- Added the ability to chose on an acquirer if it uses only form/s2s or both.
(Still need some code cleaning)
2017-08-29 17:11:23 +02:00
tbe-odoo 64ae5e2bc3 [IMP] payment: Supported payment options
- Added the ability to specify which payment option each payment acquirer supports and,
    displays those payment option on e-commerce footer.
2017-08-29 17:11:23 +02:00
Olivier Dony 695716efb0 [FIX] P3: remove pycompat.{keys,items,values} helpers
Now that we're closer to switching to P3 for good, these helpers have
outlived their usefulness, and mostly add noise.

All remaining dict.iter*() or dict.view*() must be converted to the
normal keys(), values() or items() calls.

Whenever the result is likely to be used for more than the scope of a
loop, or when the dict needs to be modified during iteration, the calls
must be wrapped in a ``list()``, to protect the new P3 semantics.
Those cases are very exceptional.

Also removed some dead code or improved the API to remove unnecessary
conversions.
2017-08-20 23:25:54 +02:00
Xavier Morel 481a00dc4b [FIX] P3: hash/hmac payload must be bytes 2017-08-20 23:25:54 +02:00
tbe-odoo 2df9c22d80 [IMP] Payments & subscriptions: Improved Payments
- When registering a payment token, validating it using a payment of a small amount (~1.50€) followed by a refund allows ensuring
    that the payment method is valid (i.e. checksumming the card number simple ensure the number is valid but not that the card exists).
    This commit introduces a generic approach that must be implemented for each acquirer that has tokenization support.
    This commit also introduces a generic payment token registration/usage template that can be adapted according to one's need.
- Introducing a new payment form that handles payment, deletion and adding payment method (only for server2server for the moment).
- On /my/payment_method, changed strings 'Payment Acquirers' to 'Payment Methods' which is more clear.
- Stripe can now be used to pay subscriptions.
2017-08-14 08:30:59 +02:00
tbe-odoo 7d428c871b [IMP] payment, website_payment: generic mechanism to verify payment tokens on registration
When registering a payment token, validating it using a payment of a small amount followed by a refund
allows ensuring that the method is valid (i.e. checksumming the card number simple ensure the number
is valid but not that the card exists). This commit introduces a generic approach that must be implemented
for each acquirer that has tokenization support. This commit also introduces a generic payment token registration/usage template that can be adapted according to one's need.

payment_ogone: add support for tokens validation
2017-07-14 11:57:19 +02:00
Elkasitu 0e39cc9345 [IMP] payment: Add search for token_implemented
Since subscriptions only accept tokenizable (credit-cards and such)
payment options, we must use the token_implemented field to filter out
non-tokenizable payment options (such as wire transfer) and because
token_implemented is a computed field, a search function had to be
created
2017-07-07 20:06:41 +02:00
Christophe Simonis dd43071638 [MERGE] forward port branch saas-16 up to 278e478d55 2017-06-27 14:19:31 +02:00
Christophe Simonis 34b432d528 [MERGE] forward port branch saas-15 up to 4d79a1ff58 2017-06-26 19:19:39 +02:00
Christophe Matthieu 4d79a1ff58 [FIX] payment: prevent access error for manual payments
Rev. cf1df16aea introduced new callback
fields with restricted access. The lazy hash generation in create() was
however causing access errors for manual transactions created by users
who are not administrators (e.g. Accountants).

Those manual transactions do not typically need a callback, but checking
the presence of the callback requires a limited sudo() context.

Similarly, the execute_callback() method may be called for a manual,
non-admin transaction, and should not do anything if there is no
callback, instead of crashing with an AccessError.

The generation of the hash and execution of the callback should be done
with a normal environment, though, as these must only be used for
transactions run by the system.

opw-747536
2017-06-26 15:09:13 +02:00
Yannick Tivisse e4152792ff [IMP] payment: Set automatically a default value for journal_id if not set
Purpose
=======

The field journal_id on a payment.acquired is required on the view. The only issue is that the journals cannot be created before having installed a localization. When the payment acquire module is installed before the localization, the journal id is not set on the payment acquire and it's impossible to make a call to `write` (For example publish the acquire)

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

When making a write or a create on a payment acquire, udpate the journal_id with a default value if not set.
2017-06-02 15:53:09 +02:00
Yannick Tivisse 4aa2fad313 [IMP] payment: Remove auto_confirm field and simplify views.
PURPOSE
=======

The field auto_confirm is complicated to understand for common users. Furthermore, on of its options is only useful for authorize module.

SPECIFICATION
=============

Remove the auto_confirm field. The destinies of its options are the following:
- none: Simply disappear.
- authorize: Become capture_manually. It has nothing to do with the auto_confirm field has it's related to the autorize module (And could be extended to other payment acquirers too).
- confirm_so: Remove it. Will be automatic, and we will always validate the sales order and generate the accounting entries on acquirer validation.
- generate_and_pay_invoice: Is linked to the journal_id. The field journal_id is always set and we will use it to validate the sales order and generate the accounting entries on acquirer validation.

Bonus: website_sale: Allow to create/validate invoice automatically on `Mark as Paid`
2017-06-02 15:31:47 +02:00
Olivier Dony 5d2869cbc8 [MERGE] Forward-port saas-16 up to ba15df47cb 2017-06-01 01:46:13 +02:00
Olivier Dony ba15df47cb [MERGE] Forward-port saas-15 up to 17b847c0f6 2017-06-01 01:10:29 +02:00
Olivier Dony 5dd2cc8e63 [MERGE] Forward-port saas-14 up to b9e2207267 2017-06-01 00:37:30 +02:00
Olivier Dony b9e2207267 [MERGE] Forward-port 10.0 up to 7e44444878 2017-06-01 00:15:27 +02:00
Yenthe V.G 717002c2da [FIX] payment: untranslated string
Closes #17256
2017-05-29 10:57:14 +02:00
Yenthe V.G c80a32f9df [FIX] payment: untranslated message
Without this the error message will always be in English, no matter the language
of the end-user.

Closes #17141
2017-05-22 10:16:30 +02:00
Jitendra Prajapati b6d636617c [FIX] payment: perform small code improvements
* add a constraints about authorized state for tx and authorize feature
   available on acquirer;
 * order acquirers first by publish, then sequence then name;
 * add a sequence on some provider data and use a default to have some
   popular acquirers first;
 * use update instead of write in an onchange;
2017-05-17 14:41:00 +02:00
Jitendra Prajapati de5433f415 [IMP] payment: improve usability of tx views
* add provider, related on acquirer_id.provider, in order to display
   certain piece of information on tx depending on their provider;
 * better tx form view and partner address display;
 * remove unnecessary notebook on tx form view as it is not used;
 * rename Payment Acquirers menu into Payment Methods, easier to
   understand;
 * acquirer kanban view improved to install / activate / configure them
   depending on their state;
 * be able to publish / unpublish acquirers without having to wait for
   website_payment to add a button;
2017-05-17 14:40:35 +02:00
Jitendra Prajapati 327be89d0b [IMP] payment: improve labelling and description of various acquirers
Be less ecommerce centric and try to explain a bit better the various
payment options. Purpose is to ease user understanding.
2017-05-17 13:14:54 +02:00
Olivier Dony 5f4db9df66 [MERGE] Forward-port saas-16 up to 5afe894f44 2017-05-16 18:23:15 +02:00
Olivier Dony 5afe894f44 [MERGE] Forward-port saas-15 up to 878fbc75ff 2017-05-16 17:09:45 +02:00
Thibault Delavallée a995e28554 [FIX] payment: set enviroment back in its own environment 2017-05-16 15:35:11 +02:00
Olivier Dony 61c2b8efd5 [MERGE] Forward-port of saas-14 up to 9b3ca1af23 2017-05-16 12:47:44 +02:00
xmo-odoo fffaf735f5 [FIX] P3: list -> iterable builtins (#16811)
In Python 3:

* various builtins and dict methods were changed to return
  view/iterable objects rather than lists
* and the separate Python 2 view/iterable builtins and methods were
  removed altogether

This is problematic when using these items as list (which the happens
repeatedly in Odoo), but more viciously when iterating *multiple times*
over them (which also happens, which I've messed up multiple times while
writing this, and which is a pain to debug even when you've just created
the issue).

Convert all code using these to semantics-matching cross-version
helper functions to get the LCD behaviour between P2 and P3, and
forbid the builtins via lint.

issue #8530
2017-05-10 09:39:55 +02:00
xmo-odoo b4429c2a91 [FIX] Various P3-related import changes
* LDAP import: python-ldap is not python3-compatible, pyldap is

  Warning: only supported from debian Stretch (current testing)?
  https://packages.debian.org/search?searchon=names&keywords=pyldap

* implicitly relative imports
* imports of moved or removed stdlib modules

issue #8530
2017-04-28 09:06:53 +02:00
Christophe Simonis 39ab200cd3 [MERGE] forward port branch saas-15 up to 780064ea89 2017-04-18 18:37:24 +02:00
Christophe Simonis 6c02d0de41 [MERGE] forward port branch saas-14 up to 2b3a5c8ec8 2017-04-18 18:16:13 +02:00
Christophe Simonis 2b3a5c8ec8 [MERGE] forward port branch 10.0 up to 72b7eb7e6e 2017-04-18 17:59:08 +02:00
Nicolas Martinelli 31dc6b888e [FIX] payment, website_sale: SIPS adaptation
SIPS payment has two limitations:
- A payment reference can only be used once, even if the payment was not
  proceeded
- A payment reference can only contain alphanumerical characters

These limitations do not fit the payment process which:
- Reuses existing transactions
- Introduces a `-` character when creating a new transaction for the
  same order.

First issue is solved by an ugly hack since there is no link module
between `website_sale` and `payment_sips` in order to override the
behavior of `sale_get_transaction`.

Second issue is solved by modifying the character to `x`. In this case,
we could consider overriding the method `get_next_reference` in
`payment_sips`. However, this method is called before the creation of
the transaction, and we should do a crappy workaround using the context
to get the `acquier_id`.

opw-728209
2017-04-13 16:18:09 +02:00
Fabien Pinckaers 525d094ef6 [IMP] account: misc UX improvements
Allow to configure the bank statement import mode from kanban
    When doing a manual journal entry, don't show the maturity date
    Removing Issued total, using credit instead (less code, more
    useful to have due amounts, instead of overdue)
    Creating a bank, set a name 'BofA Current' and an
    account number (that way, the account.account is based
    on name)
    Settings Wizard & menus: better sentences
    Statement CSV Import: installed by default (it
    does not add any menu)
    remove use_in_payment: complex field, only
    used for a default value
    Small code cleanup
[IMP] sale: moving order date to secondary tab (strange on a quotation)
2017-04-08 16:52:05 +02:00
Thibault Delavallée cf1df16aea [IMP] payment_*, website_quote: change callback_eval string to parameters
callback_eval is currently a code string that is evaluated directly
at payment confirmation. This commit changes it to have parameters
on the record and method to call on it. Moreover a hash done once at
transaction creation ensure that a modified transaction does not allow
to execute code on other records.
2017-02-13 16:58:47 +01:00
Christophe Simonis 6a942a9e96 [MERGE] forward port branch 10.0 up to 8a0151b4bc 2017-02-02 12:42:51 +01:00
Nicolas Martinelli a63ea592d4 [FIX] payment: payment reference length
The payment reference of a S2S transaction has the given format:
'PAYMENT-9-170110_200204'. However, the reference is too long for some
providers such as Authorize (limited to 20 characters).

We make the reference less verbose as a first step to solve the issue.
However, case-by-case solutions will need to be found since the
reference depends on the id, which will ultimately grow.

opw-704615
2017-01-26 15:00:36 +01:00
Christophe Simonis 6c4389df41 [MERGE] forward port branch 10.0 up to 6804085b8c 2017-01-23 14:33:53 +01:00
Nicolas Martinelli d4a4d440f5 [FIX] payment: token domain
The token domain should be extended to the commercial partner and its
siblings.

opw-705441
2017-01-23 13:12:40 +01:00
Nicolas Martinelli f96bbfd956 [IMP] payment: token order
Sort the payment tokens by descending id, so that the default token
selected for a partner is the last one.

opw-705441
2017-01-23 13:12:40 +01:00