From 70580fbbcb0f69a325e4ebfff18387d13e308454 Mon Sep 17 00:00:00 2001 From: Alex Comba Date: Fri, 29 Apr 2016 10:32:15 +0200 Subject: [PATCH 1/3] Fix errors concerning test_flake8 and test_pylint --- account_financial_test_data/__openerp__.py | 2 +- .../models/__init__.py | 2 +- .../models/account_installer.py | 2 +- account_financial_test_data/pos_install.py | 29 ++++++++++++------- 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/account_financial_test_data/__openerp__.py b/account_financial_test_data/__openerp__.py index 8f7c95e4..eb4044f0 100644 --- a/account_financial_test_data/__openerp__.py +++ b/account_financial_test_data/__openerp__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/account_financial_test_data/models/__init__.py b/account_financial_test_data/models/__init__.py index 955bc4c3..71f1420d 100644 --- a/account_financial_test_data/models/__init__.py +++ b/account_financial_test_data/models/__init__.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- -import account_installer +from . import account_installer diff --git a/account_financial_test_data/models/account_installer.py b/account_financial_test_data/models/account_installer.py index cd49d41a..feb90341 100644 --- a/account_financial_test_data/models/account_installer.py +++ b/account_financial_test_data/models/account_installer.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- import logging from openerp.osv import orm -from openerp import models, fields, api, _, exceptions +from openerp import models, api _logger = logging.getLogger(__name__) diff --git a/account_financial_test_data/pos_install.py b/account_financial_test_data/pos_install.py index b84eb843..b554cbcf 100644 --- a/account_financial_test_data/pos_install.py +++ b/account_financial_test_data/pos_install.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- from datetime import date, datetime -from openerp import SUPERUSER_ID, api, tools, _ +from openerp import SUPERUSER_ID, api def post_init_hook(cr, registry): @@ -56,7 +56,8 @@ def post_init_hook(cr, registry): account_setting = account_setting_obj.create({}) account_setting.group_multi_currency = True account_setting.default_sale_tax_id = env.ref('l10n_fr.tva_normale').id - account_setting.default_purchase_tax_id = env.ref('l10n_fr.tva_normale').id + account_setting.default_purchase_tax_id = env.ref( + 'l10n_fr.tva_normale').id account_setting.execute() return True @@ -110,7 +111,8 @@ def post_init_hook(cr, registry): invoice_obj = env['account.invoice'] - invoice_a = invoice_obj.create({ + # invoice_a + invoice_obj.create({ 'partner_id': env.ref( 'account_financial_test_data.data_partner_c').id, 'account_id': env.ref( @@ -121,7 +123,8 @@ def post_init_hook(cr, registry): 'date_due': date(last_year, 1, 31), }) - invoice_b = invoice_obj.create({ + # invoice_b + invoice_obj.create({ 'partner_id': env.ref( 'account_financial_test_data.data_partner_a').id, 'type': 'out_invoice', @@ -132,7 +135,8 @@ def post_init_hook(cr, registry): 'date_due': date(last_year, 2, 4), }) - invoice_c = invoice_obj.create({ + # invoice_c + invoice_obj.create({ 'partner_id': env.ref( 'account_financial_test_data.data_partner_d').id, 'type': 'out_invoice', @@ -143,7 +147,8 @@ def post_init_hook(cr, registry): 'date_due': date(this_year, 3, 10), }) - invoice_d = invoice_obj.create({ + # invoice_d + invoice_obj.create({ 'partner_id': env.ref( 'account_financial_test_data.data_partner_g').id, 'type': 'out_refund', @@ -154,7 +159,8 @@ def post_init_hook(cr, registry): 'date_due': date(this_year, 4, 15), }) - invoice_e = invoice_obj.create({ + # invoice_e + invoice_obj.create({ 'partner_id': env.ref( 'account_financial_test_data.data_partner_b').id, 'type': 'out_invoice', @@ -165,7 +171,8 @@ def post_init_hook(cr, registry): 'date_due': date(this_year, 2, 15), }) - invoice_f = invoice_obj.create({ + # invoice_f + invoice_obj.create({ 'partner_id': env.ref( 'account_financial_test_data.data_partner_a').id, 'type': 'out_invoice', @@ -176,7 +183,8 @@ def post_init_hook(cr, registry): 'date_due': date(this_year, 3, 24), }) - invoice_g = invoice_obj.create({ + # invoice_g + invoice_obj.create({ 'partner_id': env.ref( 'account_financial_test_data.data_partner_g').id, 'type': 'out_invoice', @@ -187,7 +195,8 @@ def post_init_hook(cr, registry): 'date_due': date(this_year, 4, 15), }) - invoice_h = invoice_obj.create({ + # invoice_h + invoice_obj.create({ 'partner_id': env.ref( 'account_financial_test_data.data_partner_f').id, 'type': 'out_invoice', From 1651d2adca60d3052e85ce7da2b2e3f75ea7d9ab Mon Sep 17 00:00:00 2001 From: Alex Comba Date: Fri, 29 Apr 2016 10:47:52 +0200 Subject: [PATCH 2/3] Fix minor issues and use short header --- account_financial_test_data/__init__.py | 2 ++ account_financial_test_data/__openerp__.py | 22 ++----------------- .../data/partners_data.xml | 5 +++++ .../models/__init__.py | 3 +++ .../models/account_installer.py | 5 ++++- account_financial_test_data/pos_install.py | 4 ++++ 6 files changed, 20 insertions(+), 21 deletions(-) diff --git a/account_financial_test_data/__init__.py b/account_financial_test_data/__init__.py index fddd5ef9..997f4f71 100644 --- a/account_financial_test_data/__init__.py +++ b/account_financial_test_data/__init__.py @@ -1,4 +1,6 @@ # -*- coding: utf-8 -*- +# © 2016 Taktik +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import models from . pos_install import post_init_hook diff --git a/account_financial_test_data/__openerp__.py b/account_financial_test_data/__openerp__.py index eb4044f0..f1af1f4b 100644 --- a/account_financial_test_data/__openerp__.py +++ b/account_financial_test_data/__openerp__.py @@ -1,22 +1,6 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# -# 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 . -# -############################################################################## +# © 2016 Taktik +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': 'Account financial test data', @@ -25,8 +9,6 @@ 'author': "Taktik, Odoo Community Association (OCA)", 'category': 'Other', 'depends': [ - "base", - "account", "account_accountant", "l10n_fr", ], diff --git a/account_financial_test_data/data/partners_data.xml b/account_financial_test_data/data/partners_data.xml index a529e047..9ffefb7e 100644 --- a/account_financial_test_data/data/partners_data.xml +++ b/account_financial_test_data/data/partners_data.xml @@ -23,6 +23,7 @@ + PARTNER C @@ -33,6 +34,7 @@ + PARTNER D @@ -43,6 +45,7 @@ + PARTNER E @@ -53,6 +56,7 @@ + PARTNER F @@ -63,6 +67,7 @@ + PARTNER G diff --git a/account_financial_test_data/models/__init__.py b/account_financial_test_data/models/__init__.py index 71f1420d..19e10397 100644 --- a/account_financial_test_data/models/__init__.py +++ b/account_financial_test_data/models/__init__.py @@ -1,3 +1,6 @@ # -*- coding: utf-8 -*- +# © 2016 Taktik +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from . import model_name from . import account_installer diff --git a/account_financial_test_data/models/account_installer.py b/account_financial_test_data/models/account_installer.py index feb90341..ce26de83 100644 --- a/account_financial_test_data/models/account_installer.py +++ b/account_financial_test_data/models/account_installer.py @@ -1,5 +1,8 @@ # -*- coding: utf-8 -*- -import logging +# © 2016 Taktik +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import model_nameimport logging from openerp.osv import orm from openerp import models, api diff --git a/account_financial_test_data/pos_install.py b/account_financial_test_data/pos_install.py index b554cbcf..7fbd15c7 100644 --- a/account_financial_test_data/pos_install.py +++ b/account_financial_test_data/pos_install.py @@ -3,6 +3,10 @@ from datetime import date, datetime from openerp import SUPERUSER_ID, api +# -*- coding: utf-8 -*- +# © 2016 Taktik +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + def post_init_hook(cr, registry): def update_partners(): From fce09ae78c15de30d1a73a4c04f49c1fc4db5130 Mon Sep 17 00:00:00 2001 From: Alex Comba Date: Fri, 29 Apr 2016 10:49:16 +0200 Subject: [PATCH 3/3] Add README --- account_financial_test_data/README.rst | 54 ++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 account_financial_test_data/README.rst diff --git a/account_financial_test_data/README.rst b/account_financial_test_data/README.rst new file mode 100644 index 00000000..8c82d9bb --- /dev/null +++ b/account_financial_test_data/README.rst @@ -0,0 +1,54 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +=========================== +Account financial test data +=========================== + +This module provides demo data for the repo 'account-financial-reporting' +and will allow people to test all reports properly and make tests as well. + +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/91/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. + +Credits +======= + +Images +------ + +* Odoo Community Association: `Icon `_. + +Contributors +------------ + +* Taktik +* Alex Comba + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +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 https://odoo-community.org.