From 0487eaf37503d0303a859926770ce79b3ca9c3d3 Mon Sep 17 00:00:00 2001 From: David Vidal Date: Tue, 5 Sep 2017 09:39:44 +0200 Subject: [PATCH] [MIG] portal_payment_mode: Migration to 9.0 --- portal_payment_mode/README.rst | 24 +++++++-------- portal_payment_mode/__init__.py | 3 -- portal_payment_mode/__openerp__.py | 13 ++++---- .../security/ir.model.access.csv | 2 +- portal_payment_mode/tests/__init__.py | 3 -- .../tests/test_portal_payment_mode.py | 30 +++++++++++++------ 6 files changed, 39 insertions(+), 36 deletions(-) diff --git a/portal_payment_mode/README.rst b/portal_payment_mode/README.rst index ffe2b69c0..950ef40f8 100644 --- a/portal_payment_mode/README.rst +++ b/portal_payment_mode/README.rst @@ -15,19 +15,16 @@ Usage .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/173/8.0 - -For further information, please visit: - -* https://www.odoo.com/forum/help-1 + :target: https://runbot.odoo-community.org/runbot/173/9.0 Bug Tracker =========== -Bugs are tracked on `GitHub Issues `_. -In case of trouble, please check there if your issue has already been reported. -If you spotted it first, help us smashing it by providing a detailed and welcomed feedback -`here `_. + +Bugs are tracked on `GitHub Issues +`_. In case of trouble, please +check there if your issue has already been reported. If you spotted it first, +help us smash it by providing detailed and welcomed feedback. Credits ======= @@ -35,9 +32,10 @@ Credits Contributors ------------ -* Rafael Blasco -* Carlos Dauden -* Sergio Teruel +* Rafael Blasco +* Carlos Dauden +* Sergio Teruel +* David Vidal Maintainer ---------- @@ -52,4 +50,4 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -To contribute to this module, please visit http://odoo-community.org. +To contribute to this module, please visit https://odoo-community.org. diff --git a/portal_payment_mode/__init__.py b/portal_payment_mode/__init__.py index 396df42f4..40a96afc6 100644 --- a/portal_payment_mode/__init__.py +++ b/portal_payment_mode/__init__.py @@ -1,4 +1 @@ # -*- coding: utf-8 -*- -# (c) 2015 Antiun Ingeniería S.L. - Sergio Teruel -# (c) 2015 Antiun Ingeniería S.L. - Carlos Dauden -# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html diff --git a/portal_payment_mode/__openerp__.py b/portal_payment_mode/__openerp__.py index 035f01079..86a2f8136 100644 --- a/portal_payment_mode/__openerp__.py +++ b/portal_payment_mode/__openerp__.py @@ -1,13 +1,13 @@ # -*- coding: utf-8 -*- -# (c) 2015 Antiun Ingeniería S.L. - Sergio Teruel -# (c) 2015 Antiun Ingeniería S.L. - Carlos Dauden +# Copyright 2017 Tecnativa - Sergio Teruel +# Copyright 2017 Tecnativa - Carlos Dauden # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html { 'name': "Portal Payment Mode", 'summary': "Adds payment mode ACL's for portal users ", 'category': 'Portal', - 'version': '8.0.1.0.0', + 'version': '9.0.1.0.0', 'depends': [ 'portal_sale', 'account_payment_partner', @@ -15,12 +15,11 @@ 'data': [ 'security/ir.model.access.csv', ], - 'author': 'Antiun Ingeniería S.L., ' - 'Incaser Informatica S.L., ' + 'author': 'Tecnativa, ' 'Odoo Community Association (OCA)', - 'website': 'http://www.antiun.com', + 'website': 'https://www.tecnativa.com', 'license': 'AGPL-3', - 'installable': False, + 'installable': True, 'auto_install': True, 'application': False, } diff --git a/portal_payment_mode/security/ir.model.access.csv b/portal_payment_mode/security/ir.model.access.csv index d8953bceb..038b0cf53 100644 --- a/portal_payment_mode/security/ir.model.access.csv +++ b/portal_payment_mode/security/ir.model.access.csv @@ -1,2 +1,2 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_payment_portal,Read access on payment.mode to Portal Users,account_payment.model_payment_mode,base.group_portal,1,0,0,0 +access_account_payment_mode_read_portal,Read access on account.payment.mode to Portal Users,account_payment_mode.model_account_payment_mode,base.group_portal,1,0,0,0 diff --git a/portal_payment_mode/tests/__init__.py b/portal_payment_mode/tests/__init__.py index 80320b927..1cc7a8f02 100644 --- a/portal_payment_mode/tests/__init__.py +++ b/portal_payment_mode/tests/__init__.py @@ -1,6 +1,3 @@ # -*- coding: utf-8 -*- -# (c) 2015 Antiun Ingeniería S.L. - Sergio Teruel -# (c) 2015 Antiun Ingeniería S.L. - Carlos Dauden -# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from . import test_portal_payment_mode diff --git a/portal_payment_mode/tests/test_portal_payment_mode.py b/portal_payment_mode/tests/test_portal_payment_mode.py index 918392473..dfe5d6e99 100644 --- a/portal_payment_mode/tests/test_portal_payment_mode.py +++ b/portal_payment_mode/tests/test_portal_payment_mode.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# (c) 2015 Antiun Ingeniería S.L. - Sergio Teruel -# (c) 2015 Antiun Ingeniería S.L. - Carlos Dauden +# Copyright 2015 Tecnativa - Sergio Teruel +# Copyright 2015 Tecnativa - Carlos Dauden # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from openerp.tests.common import TransactionCase @@ -19,26 +19,38 @@ class TestPortalPaymentMode(TransactionCase): 'name': 'Test journal', 'code': 'TEST', 'type': 'general'}) - self.payment_mode = self.env['payment.mode'].create({ + self.payment_mode = self.env['account.payment.mode'].create({ 'name': 'Test Payment Mode', 'journal': self.journal.id, 'bank_id': self.bank.id, - 'type': self.env.ref( - 'account_banking_payment_export.manual_bank_tranfer').id, + 'bank_account_link': 'variable', + 'payment_method_id': self.env.ref( + 'account.account_payment_method_manual_in').id, 'sale_ok': True, }) + self.account = self.env['account.account'].create({ + 'name': 'Test account', + 'code': 'TESTACC', + 'user_type_id': self.env.ref( + 'account.data_account_type_receivable').id, + 'reconcile': True, + }) + self.journal = self.env['account.journal'].create({ + 'name': 'TEST JOURNAL', + 'code': 'TSTJRNL', + 'type': 'sale', + }) vals_invoice = { 'partner_id': self.partner.id, - 'account_id': self.env.ref('account.a_sale').id, - 'journal_id': self.env.ref('account.sales_journal').id, + 'account_id': self.account.id, + 'journal_id': self.journal.id, 'payment_mode_id': self.payment_mode.id, 'invoice_line': [(0, 0, { 'name': 'test', - 'account_id': self.env.ref('account.a_sale').id, + 'account_id': self.account.id, 'price_unit': 100.00, 'quantity': 1 })], - } self.invoice = self.env['account.invoice'].create(vals_invoice) self.invoice.invoice_validate()