From 3d1db686c336d1ba75793294298a9298438f0865 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 8 Nov 2013 11:10:05 +0100 Subject: [PATCH] [CLEAN] payment_acquirer_* modules: some code cleaning Cleaned init files, removing some licences (keeping only in init and openerp in base directory of modules). Cleaned some class name, added forgotten test file for payment_acquirer_transfer. bzr revid: tde@openerp.com-20131108101005-a149bvatw5w6sdql --- addons/payment_acquirer/models/__init__.py | 19 --- addons/payment_acquirer/tests/__init__.py | 19 --- .../controllers/__init__.py | 4 +- .../payment_acquirer_ogone/data/__init__.py | 19 --- .../payment_acquirer_ogone/tests/__init__.py | 21 --- .../controllers/__init__.py | 4 +- .../models/__init__.py | 19 --- .../payment_acquirer_paypal/tests/__init__.py | 21 --- .../data/transfer.xml | 2 +- .../models/__init__.py | 19 --- .../models/payment_acquirer.py | 5 +- .../tests/__init__.py | 25 +--- .../tests/test_transfer.py | 31 +++++ .../views/transfer.xml | 131 ------------------ 14 files changed, 45 insertions(+), 294 deletions(-) create mode 100644 addons/payment_acquirer_transfer/tests/test_transfer.py diff --git a/addons/payment_acquirer/models/__init__.py b/addons/payment_acquirer/models/__init__.py index 0ce2de595b2..da51c9c1854 100644 --- a/addons/payment_acquirer/models/__init__.py +++ b/addons/payment_acquirer/models/__init__.py @@ -1,22 +1,3 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2013-Today OpenERP SA (). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## import payment_acquirer diff --git a/addons/payment_acquirer/tests/__init__.py b/addons/payment_acquirer/tests/__init__.py index 8d0bb0195bf..5c193a07c8d 100644 --- a/addons/payment_acquirer/tests/__init__.py +++ b/addons/payment_acquirer/tests/__init__.py @@ -1,22 +1,3 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Business Applications -# Copyright (c) 2012-TODAY OpenERP S.A. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## import common diff --git a/addons/payment_acquirer_ogone/controllers/__init__.py b/addons/payment_acquirer_ogone/controllers/__init__.py index 039d9715fab..bbd183e955b 100644 --- a/addons/payment_acquirer_ogone/controllers/__init__.py +++ b/addons/payment_acquirer_ogone/controllers/__init__.py @@ -1 +1,3 @@ -import main \ No newline at end of file +# -*- coding: utf-8 -*- + +import main diff --git a/addons/payment_acquirer_ogone/data/__init__.py b/addons/payment_acquirer_ogone/data/__init__.py index 61f4cbeacf3..349d8f668e8 100644 --- a/addons/payment_acquirer_ogone/data/__init__.py +++ b/addons/payment_acquirer_ogone/data/__init__.py @@ -1,22 +1,3 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2013-Today OpenERP SA (). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## import ogone diff --git a/addons/payment_acquirer_ogone/tests/__init__.py b/addons/payment_acquirer_ogone/tests/__init__.py index 2381425068e..6607b8cf6cd 100644 --- a/addons/payment_acquirer_ogone/tests/__init__.py +++ b/addons/payment_acquirer_ogone/tests/__init__.py @@ -1,28 +1,7 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Business Applications -# Copyright (c) 2012-TODAY OpenERP S.A. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## from . import test_ogone checks = [ test_ogone, ] - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/payment_acquirer_paypal/controllers/__init__.py b/addons/payment_acquirer_paypal/controllers/__init__.py index 039d9715fab..bbd183e955b 100644 --- a/addons/payment_acquirer_paypal/controllers/__init__.py +++ b/addons/payment_acquirer_paypal/controllers/__init__.py @@ -1 +1,3 @@ -import main \ No newline at end of file +# -*- coding: utf-8 -*- + +import main diff --git a/addons/payment_acquirer_paypal/models/__init__.py b/addons/payment_acquirer_paypal/models/__init__.py index d89c4a0fee3..a1fe670f56f 100644 --- a/addons/payment_acquirer_paypal/models/__init__.py +++ b/addons/payment_acquirer_paypal/models/__init__.py @@ -1,22 +1,3 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2013-Today OpenERP SA (). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## import paypal diff --git a/addons/payment_acquirer_paypal/tests/__init__.py b/addons/payment_acquirer_paypal/tests/__init__.py index 2868b3261e1..6a46df50be2 100644 --- a/addons/payment_acquirer_paypal/tests/__init__.py +++ b/addons/payment_acquirer_paypal/tests/__init__.py @@ -1,28 +1,7 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Business Applications -# Copyright (c) 2012-TODAY OpenERP S.A. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## from . import test_paypal checks = [ test_paypal, ] - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/payment_acquirer_transfer/data/transfer.xml b/addons/payment_acquirer_transfer/data/transfer.xml index 0ae3258a038..c620c0c550f 100644 --- a/addons/payment_acquirer_transfer/data/transfer.xml +++ b/addons/payment_acquirer_transfer/data/transfer.xml @@ -4,7 +4,7 @@ transfer - + test diff --git a/addons/payment_acquirer_transfer/models/__init__.py b/addons/payment_acquirer_transfer/models/__init__.py index 0ce2de595b2..da51c9c1854 100644 --- a/addons/payment_acquirer_transfer/models/__init__.py +++ b/addons/payment_acquirer_transfer/models/__init__.py @@ -1,22 +1,3 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2013-Today OpenERP SA (). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## import payment_acquirer diff --git a/addons/payment_acquirer_transfer/models/payment_acquirer.py b/addons/payment_acquirer_transfer/models/payment_acquirer.py index b9abefb1bcc..baac41a4a24 100644 --- a/addons/payment_acquirer_transfer/models/payment_acquirer.py +++ b/addons/payment_acquirer_transfer/models/payment_acquirer.py @@ -28,9 +28,8 @@ _logger = logging.getLogger(__name__) class TransferPaymentAcquirer(osv.Model): - _name = 'payment.acquirer' - _description = 'Online Payment Acquirer' + _inherit = 'payment.acquirer' class TransferPaymentTransaction(osv.Model): - _inherit = ['payment.transaction'] + _inherit = 'payment.transaction' diff --git a/addons/payment_acquirer_transfer/tests/__init__.py b/addons/payment_acquirer_transfer/tests/__init__.py index 8d0bb0195bf..5ba8270a936 100644 --- a/addons/payment_acquirer_transfer/tests/__init__.py +++ b/addons/payment_acquirer_transfer/tests/__init__.py @@ -1,22 +1,7 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Business Applications -# Copyright (c) 2012-TODAY OpenERP S.A. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## -import common +from . import test_transfer + +checks = [ + test_transfer, +] diff --git a/addons/payment_acquirer_transfer/tests/test_transfer.py b/addons/payment_acquirer_transfer/tests/test_transfer.py new file mode 100644 index 00000000000..08ea688dc75 --- /dev/null +++ b/addons/payment_acquirer_transfer/tests/test_transfer.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Business Applications +# Copyright (c) 2012-TODAY OpenERP S.A. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from openerp.addons.payment_acquirer.tests.common import PaymentAcquirerCommon +# from openerp.addons.payment_acquirer_ogone.controllers.main import OgoneController +# from openerp.osv.orm import except_orm + + +class TransferPayment(PaymentAcquirerCommon): + + def test_00_transfer_form(self): + cr, uid = self.cr, self.uid + context = {} diff --git a/addons/payment_acquirer_transfer/views/transfer.xml b/addons/payment_acquirer_transfer/views/transfer.xml index 77bb8adad4b..f154f2078d0 100644 --- a/addons/payment_acquirer_transfer/views/transfer.xml +++ b/addons/payment_acquirer_transfer/views/transfer.xml @@ -2,137 +2,6 @@ - - - - payment.acquirer - -
- -
-
- -
-

- This is an HTML form template to submit a payment through this acquirer. - The template will be rendered with qWeb, so it may use qWeb expressions. - The qWeb evaluation context provides: -

    -
  • reference: the reference number of the document to pay
  • -
  • currency: the currency record in which the document is issued (e.g. currency.name could be EUR)
  • -
  • amount: the total amount to pay, as a float
  • -
  • amount_str: the total amount to pay, as a string with the account precision
  • -
  • object: the browse record on which the payment form is rendered (usually an invoice or sales order record)
  • -
  • user_id: the current user browse record
  • -
  • context: the current context dictionary
  • -
- If the template renders to an empty result in a certain context it will be ignored, as if it was inactive. -

-
- -
-
-
-
-
- - - payment.acquirer - - - - - - - - - - - payment.acquirer - - - - - - - - - Payment Acquirers - payment.acquirer - form - tree,form - - - - - - payment.transaction - -
- - - - - - - - - - - - - - -
-
-
- - - payment.transaction - - - - - - - - - - - - payment.transaction - - - - - - - - - - - Payment Transactions - payment.transaction - form - tree,form - - - -