Browse Source

Merge pull request #1 from tafaRU/9.0-account_financial_test_data-fix

Fix errors concerning test_flake8 and test_pylint
pull/188/head
KevinBro 9 years ago
parent
commit
3fe67821ff
  1. 54
      account_financial_test_data/README.rst
  2. 2
      account_financial_test_data/__init__.py
  3. 24
      account_financial_test_data/__openerp__.py
  4. 5
      account_financial_test_data/data/partners_data.xml
  5. 5
      account_financial_test_data/models/__init__.py
  6. 7
      account_financial_test_data/models/account_installer.py
  7. 33
      account_financial_test_data/pos_install.py

54
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
<https://github.com/OCA/account-financial-reporting/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 <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
Contributors
------------
* Taktik
* Alex Comba <alex.comba@agilebg.com>
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.

2
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

24
account_financial_test_data/__openerp__.py

@ -1,22 +1,6 @@
# -*- encoding: 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# © 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",
],

5
account_financial_test_data/data/partners_data.xml

@ -23,6 +23,7 @@
<field name="currency_id" ref="base.EUR"/>
</record>
<!--Partner c-->
<record id="data_partner_c" model="res.partner"
context="{'default_company_type': 'person'}">
<field name="name">PARTNER C</field>
@ -33,6 +34,7 @@
<field name="currency_id" ref="base.EUR"/>
</record>
<!--Partner d-->
<record id="data_partner_d" model="res.partner"
context="{'default_company_type': 'person'}">
<field name="name">PARTNER D</field>
@ -43,6 +45,7 @@
<field name="currency_id" ref="base.EUR"/>
</record>
<!--Partner e-->
<record id="data_partner_e" model="res.partner"
context="{'default_company_type': 'person'}">
<field name="name">PARTNER E</field>
@ -53,6 +56,7 @@
<field name="currency_id" ref="base.EUR"/>
</record>
<!--Partner f-->
<record id="data_partner_f" model="res.partner"
context="{'default_company_type': 'person'}">
<field name="name">PARTNER F</field>
@ -63,6 +67,7 @@
<field name="currency_id" ref="base.EUR"/>
</record>
<!--Partner g-->
<record id="data_partner_g" model="res.partner"
context="{'default_company_type': 'person'}">
<field name="name">PARTNER G</field>

5
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).
import account_installer
from . import model_name
from . import account_installer

7
account_financial_test_data/models/account_installer.py

@ -1,7 +1,10 @@
# -*- 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, fields, api, _, exceptions
from openerp import models, api
_logger = logging.getLogger(__name__)

33
account_financial_test_data/pos_install.py

@ -1,8 +1,12 @@
# -*- coding: utf-8 -*-
from datetime import date, datetime
from openerp import SUPERUSER_ID, api, tools, _
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():
@ -56,7 +60,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 +115,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 +127,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 +139,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 +151,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 +163,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 +175,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 +187,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 +199,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',

Loading…
Cancel
Save