Commit Graph
101 Commits
Author SHA1 Message Date
Thibault Delavallée a969931f9c [MIG] payment: new API
No functional change.
2016-07-06 15:10:45 +02:00
Thibault Delavallée 82d68747c3 [CLN] payment_*: dead code removal
Old s2s prototype code has been removed. It is not used anywhere and not
supported. Moreover ogone s2s implementation use its own set of methods.
In a near future a neat implementation of s2s for paypal will be added.
2016-07-06 13:53:00 +02:00
Thibault Delavallée 88126f95d3 [REF] payment_*: method signatures
Methods with signature

 - cr, uid, id
 - cr, uid, <browse_record>

have been refactored to be future multi ensure one methods.
2016-07-06 11:47:39 +02:00
Joren Van Onder d713a3ecc6 [IMP] payment: only show fees configuration if fees are implemented 2016-06-17 13:09:18 +02:00
Joren Van Onder 4e5815c1c3 [IMP] payment: create and use an electronic account.payment.method 2016-06-17 13:09:18 +02:00
Joren Van Onder e3730cf1f2 [IMP] payment*,website: rename payment.method -> payment.token
payment.method was not a good name because it was too easy to confuse
with account.payment.method.
2016-06-17 13:09:18 +02:00
Joren Van Onder 101a9693b3 [FIX] payment*: fix invalid coding
-*- coding: utf-'8' "-*-"

is not a valid encoding. Introduced by
666387a274 I think. It was probably a
typo/replace gone bad and it got copy-pasted everywhere. Emacs complains
every time you try to save changes to files with this invalid encoding.

This changes all of them to

coding: utf-8

adhering to eae045949d.

Done with:

find . -name '*.py' -print0 |\
xargs -0 sed -ie 's/-\*- coding: utf-'"'"'8'"'"' "-\*-"/coding: utf-8/'
2016-06-17 13:09:18 +02:00
Joren Van Onder a40840690c [IMP] payment: allow account.payment creation with payment.method 2016-06-17 13:09:18 +02:00
Joren Van Onder 8a761721d1 [IMP] payment: add options to automatically confirm SO's through website
Introduces two new options:
- confirm_so: to confirm the sale order on acquirer confirmation
- generate_and_pay_invoice: confirm_so + generation of invoice and
                            payment registration
2016-06-17 13:09:18 +02:00
Martin Trigaux 43f619ed76 [FIX] payment: correctly trigger the constraints
The third parameter expects a list of field, not some random string.
This made the constraints for the fields tagged with required_if_provider to be
never checked.

Closes #12458
2016-06-16 15:51:50 +02:00
Christophe Simonis dda0d3d62d [MERGE] forward port of branch saas-10 up to baf494c
# Conflicts:
#	addons/hr_timesheet/project_timesheet.py
#	addons/sale_layout/i18n/es_PE.po
#	addons/sale_layout/i18n/hu.po
#	addons/sale_layout/i18n/lo.po
#	addons/sale_layout/i18n/pl.po
#	addons/sale_service/i18n/es_MX.po
#	addons/sale_service/i18n/es_PE.po
#	addons/sale_service/i18n/lo.po
#	addons/stock/stock.py
#	addons/stock/stock_view.xml
#	addons/warning/i18n/es_PE.po
#	addons/warning/i18n/lo.po
#	addons/warning/i18n/ru.po
#	addons/web/i18n/cs.po
#	addons/web/i18n/ja.po
#	addons/web/i18n/lo.po
#	addons/web/i18n/th.po
2016-06-15 12:59:39 +02:00
Christophe Simonis baf494c67b [MERGE] forward port of branch saas-9 up to 1d81bb0
# Conflicts:
#	addons/account_extra_reports/i18n/ca.po
#	addons/account_extra_reports/i18n/fi.po
#	addons/account_extra_reports/i18n/pl.po
#	addons/account_extra_reports/i18n/te.po
#	addons/account_extra_reports/i18n/zh_CN.po
#	addons/account_full_reconcile/i18n/hu.po
#	addons/account_full_reconcile/i18n/pl.po
#	addons/crm/crm_lead_menu.xml
#	addons/crm_claim/i18n/es_PE.po
#	addons/crm_claim/i18n/hu.po
#	addons/crm_claim/i18n/ja.po
#	addons/crm_claim/i18n/pl.po
#	addons/delivery/views/delivery_view.xml
#	addons/product/product_view.xml
#	addons/project_timesheet/i18n/es_PE.po
#	addons/stock/stock_view.xml
2016-06-15 12:40:59 +02:00
Christophe Simonis f9072c789d [MERGE] forward port of branch 9.0 up to bfbe2d6
# Conflicts:
#	addons/marketing/i18n/es_PE.po
#	addons/marketing/i18n/hu.po
2016-06-14 19:27:16 +02:00
Olivier Dony 0f5f960c60 [FIX] payment: render acquirer form values even if partner is missing
When no `partner_id` was passed to `render()` and the acquirer
had a fees computation method, (e.g. Paypal), it would crash.
Could happen when coming through the /website_payment/pay
controller, for instance.
2016-06-13 19:21:02 +02:00
Christophe Simonis 658989868c [MERGE] forward port of branch saas-10 up to aa6ebd1 2016-04-05 20:08:50 +02:00
Christophe Simonis aa6ebd146a [MERGE] forward port of branch saas-9 up to 549daaa 2016-04-05 19:27:34 +02:00
Olivier Dony b5a7491b64 [MERGE] Forward-port of saas-7 up to rev. 83a08c4791
Conflicts:
	openerp/addons/base/res/res_partner.py
2016-04-02 01:09:07 +02:00
Olivier Dony 83a08c4791 [MERGE] Forward-port 9.0 up to rev. 7a483a85d4 2016-04-02 01:03:59 +02:00
Raphael Collet 7a483a85d4 [FIX] *: do not use computed fields for resizing images
Otherwise recomputation may fail with "record does not exist or has been
deleted" when creating records with a value directly set for e.g.
'image_mediun' on a new product.

The issue comes from the storage of the images.  When creating a product, the
creation of an attachment for storing the field `image_medium` triggers the
recomputation of that field before its dependency `image` is set.  As `image`
is initially null, `image_medium` is recomputed as null, and this deletes the
attachment just created before the latter has completed its creation!  As a
consequence, some code at the end of `create` for the attachment crashes
because the record has been deleted.

The following models have been fixed: `fleet.vehicle.model.brand`,
`hr.employee`, `im_livechat.channel`, `mail.channel`, `payment.acquirer`,
`pos.category`, `product.template`, `product.public.category`, `res.partner`.

opw 666330
Closes #11516
2016-04-02 00:47:57 +02:00
Christophe Simonis 6c8141a1df [MERGE] forward port of branch saas-10 up to 2483327 2016-04-01 16:15:35 +02:00
Christophe Simonis ddb0fb2739 [MERGE] forward port of branch saas-9 up to 59d3f63 2016-03-24 16:53:45 +01:00
Raphael Collet 4ddc323139 [FIX] base: fix and complete migration of base/ir
- add or fix decorators on methods
- fix most compute methods (wrong dependencies)
- revert changes in `eval_context` of `ir.actions`
- various code simplifications and improvements
- migrate methods that were not
- ir_qweb: modify `QWebContext` to take an environment instead of `cr`, `uid`, `context`
- ir_qweb: convert `AssetsBundle` to use new API `env`
- ir_ui_view: use decorator `multi` on method `read_combined`
- ir_ui_view: ensure that method `render` is never called with an xml_id
- ir_ui_view: factor out part of the `ormcache` key of method `_read_template`
2016-03-21 13:46:44 +01:00
Martin Geubelle bf10251474 [IMP] payment: environment should be required 2016-03-10 13:41:10 +01:00
Martin Geubelle 1d777d6d95 [IMP] payment, payment_*: acquirers installation
The installation of a new acquirer was a bit complicated : from settings,
check the acquirer, then apply (install the module) then list view of
acquirer and finally edit it in form view.

This needed to be simplified. The payment acquirers are pre-filled
in payment. From the kanban view an `Install` button installs and
redirects to the form field.
2016-03-10 13:41:07 +01:00
rmu-odoo c76201cbdd [IMP] payment : environment as toggle button
Environment field on payment.acquirer model now has a shiny stat button on its
form view. It allows to toggle between production and testing mode.

All payment acquirers are by default in testing environment now, to avoid issues.
2016-03-04 14:55:20 +01:00
Christophe Simonis 1c7f5a45e5 [MERGE] forward port of branch saas-7 up to d016457 2016-02-29 12:30:27 +01:00
Christophe Simonis 3b6c243440 [MERGE] forward port of branch 9.0 up to c169c59 2016-02-24 18:50:09 +01:00
Denis Ledoux e7770ed9c7 [FIX] payment: Translatable thanks message
If the help message is translatable,
there is no reason why the thanks message
coudln't be as well.

This is a following of the revision
f37a40c4c0

opw-670228
2016-02-23 12:24:34 +01:00
Christophe Simonis 1231585df1 [MERGE] forward port of branch saas-9 up to 78d20b5 2016-01-27 12:27:01 +01:00
Christophe Simonis 78d20b552b [MERGE] forward port of branch saas-8 up to 7e44ddc 2016-01-27 12:24:04 +01:00
Julien Legros e5e7c4c121 [MERGE] forward port of branch 9.0 up to 6872aae 2016-01-25 11:26:27 +01:00
Nicolas Martinelli 2d4257da1a [FIX] payment_authorize: send billing and shipping data
Authorize.net requires both billing and shipping data.

opw-660771
2016-01-20 15:48:31 +01:00
Srushti Patel b91b3217a6 [IMP] account,payment: Need to improve typo in helptip message, change 'that' into 'This' 2016-01-07 14:00:12 +01:00
Mitali Patel fe4f8405f6 [IMP] payment: added missing payment methods from settings 2016-01-07 09:10:51 +01:00
Martin Trigaux c298cf3250 [MERGE] Forward port of 9.0 up to 7892d99f 2015-12-18 16:15:08 +01:00
Denis Ledoux cb9d7982c1 [FIX] payment, website_sale: condition to recreate a payment transaction
Before this revision, in the ecommerce,
a new payment transaction was created only
when the transaction reference was different than
the order number, meaning that the transaction id
in the user session no longer refers to the current order,
that the user created a new order which has nothing
to do with the transaction he has in his session
variable `sale_transaction_id`

This made sense when the transaction reference
strictly matched the order number, but,
since f89e8f9df2,
this is possible that a payment transaction reference
number no longer strictly matches its order number,
as the transaction reference can contain `-1`, `-2`
at the end of its reference, meaning there was
already another transaction existing with the sale
order number as reference. But the transaction
is still about this order.

Therefore, from this revision, the condition on
which a new transaction has to be created
should no longer be based on the transaction
reference, but to which `sale_order_id` the transaction belongs.

In addition, we add two more conditions for which a new transaction
should be created:
 - The transaction has been cancelled or in error
 - The acquirer has changed.

For the second case, this is to handle a corner case:
 - The user selects one payment acquirer (Ogone), then click
   on "Pay now", and is therefore redirected to the payment provider website (Ogone)
 - Then, the user opens a new browser tab on the ecommerce, on his cart,
   choose another payment provider (Paypal), then click "Pay now" and is
   redirected to this second payment provider website  (Paypal),
 - Then, the user comes back on the first tab, on which he is on the first
   provider website (ogone), and pays/validate the payment
 - Then, we receive the payment feedback (either from the user/DPN, either from
   the server to server call/IPN)

Before this revision, this use case would have lead to the feedback from the first
provider (`/payment/ogone/accept`) while the transaction is set with the second
payment provider (`Paypal`), therefore breaking the payment validation.

Creating a new transaction when the user changes of payment provider solves this issue.
He will nevertheless be able to pay twice, on each provider, but it was
already the case before.

opw-659294
2015-12-15 18:31:12 +01:00
Olivier Dony ff2069eb69 [MERGE] Forward-port 9.0 up to 9a3e9291ffa1509f4afa0f35f9d8d71b6e0932d1 2015-10-30 10:47:13 +01:00
Denis Ledoux dcd8d65fd1 [MERGE] forward port of branch saas-6 up to 6a306a03be 2015-10-28 14:01:10 +01:00
Raphael Collet f25e859a22 [IMP] base: remove hard-coded list of languages, read them from database or csv
Also add helper methods on `res.lang` to retrieve the list of installed
languages and the list of available languages.
2015-10-26 17:34:34 +01:00
Denis Ledoux 101bb927a0 [FIX] payment: fees computation depending on country
The computed fees can depend on the country.
There was a typo about it:
there is no `country_id` field on the `payment.transaction` model,
it's `partner_country_id`.

Therefore, the computed fees according to the country
were not always correctly computed.

e.g. for Paypal, where the domestic fees
are lower than the international fees, it always
computed the fees as international.

opw-651778
2015-10-14 13:29:36 +02:00
Olivier Dony af4a60b941 [MERGE] Forward-port 8.0 up to rev. 26d0fe6d9f 2015-09-30 02:53:59 +02:00
Denis Ledoux 25d8955e98 [FIX] payment: make the payment.acquirer name translatable
To allow to translate "Wire transfer" in the ecommerce.

opw-650450
2015-09-29 15:09:23 +02:00
Raphael Collet 5a6e136172 [IMP] addons: adapt binary fields to store images in attachments 2015-09-28 15:19:47 +02:00
Christophe Simonis 57168a9e90 [MERGE] forward port of branch saas-6 up to a669433 2015-09-23 14:34:26 +02:00
Denis Ledoux a3648fd23a [MERGE] forward port of branch 8.0 up to aabbdc7 2015-09-21 16:01:58 +02:00
Damien Bouvy f89e8f9df2 [IMP] payment, website_sale, website_payment: unique reference on payment no longer prevent paying
Payment transactions referenceis have a unique constraint which was problematic when a payment was cancelled from the acquirer's page.
To stick the to DRY principle, I factorized a method that checks for existing references and happens a numerical suffix if necessary.
This was already implemented in website_payment but was moved to payment and used in website_sale.
2015-09-21 13:15:58 +02:00
Denis Ledoux 2c81ab75c8 [FIX] payment: fees recomputation on transaction amount/acquirer change
Fees were not recomputed when the amount or the acquirer of the
payment transaction was changed.

This can happen if the user clicks on
"Pay now", which creates the transaction and computes
the fees for the first time and then redirects
to the payment provider, and then the user
came back from the payment provider, hitting the previous
button in his browser, for instance, and then
changes the content of his cart (the quantity, or even
the products) or change of payment provider
(from Ogone to Paypal, for instance).

opw-649509
2015-09-16 16:41:30 +02:00
Shivam Dudhat 9d36fe5c52 [IMP] payment: error message and style 2015-09-16 11:30:55 +02:00
Damien Bouvy e178b42a91 [FIX] payment: triggering the on_change to get partner details sometime put the partner_country_id to False; the default was there explicitly to avoid this kind of problem 2015-09-08 16:30:12 +02:00
Damien Bouvy 526f27ddac [IMP] payment,payment_*,website_quote,website_sale: new rendering mechanism compatibility for payment providers
merge *ALL* the dicts

The form rendering used to receive a dict for partner information and a dict for tx information and to transmit another dict to the qweb template; now everything is done in a single dict
2015-09-04 16:08:22 +02:00