From 4aa2fad313112a7a45a86b67e806f5a3af22d73b Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Wed, 24 May 2017 11:40:19 +0200 Subject: [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` --- addons/payment_authorize/tests/test_authorize.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'addons/payment_authorize/tests/test_authorize.py') diff --git a/addons/payment_authorize/tests/test_authorize.py b/addons/payment_authorize/tests/test_authorize.py index d19690284a8..b02d3d81209 100644 --- a/addons/payment_authorize/tests/test_authorize.py +++ b/addons/payment_authorize/tests/test_authorize.py @@ -25,7 +25,7 @@ class AuthorizeCommon(PaymentAcquirerCommon): # get the authorize account self.authorize = self.env.ref('payment.payment_acquirer_authorize') # Be sure to be in 'capture' mode - self.authorize.auto_confirm = 'confirm_so' + # self.authorize.auto_confirm = 'confirm_so' @odoo.tests.common.at_install(True) @@ -219,7 +219,7 @@ class AuthorizeForm(AuthorizeCommon): # switch to 'authorize only' # create authorize only s2s transaction & capture it - self.authorize.auto_confirm = 'authorize' + self.authorize.capture_manually = True transaction = self.env['payment.transaction'].create({ 'amount': 500, 'acquirer_id': authorize.id, @@ -236,7 +236,7 @@ class AuthorizeForm(AuthorizeCommon): self.assertEqual(transaction.state, 'done') # create authorize only s2s transaction & void it - self.authorize.auto_confirm = 'authorize' + self.authorize.capture_manually = True transaction = self.env['payment.transaction'].create({ 'amount': 500, 'acquirer_id': authorize.id, -- cgit v1.2.3