Browse Source

Merge pull request #479 from Eficent/11.0-mig-account_financial_report_date_range

[11.0][MIG] account_financial_report_date_range
pull/481/head
Pedro M. Baeza 6 years ago
committed by GitHub
parent
commit
57bc643365
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 55
      account_financial_report_date_range/README.rst
  2. 1
      account_financial_report_date_range/__init__.py
  3. 25
      account_financial_report_date_range/__manifest__.py
  4. 34
      account_financial_report_date_range/i18n/account_financial_report_date_range.pot
  5. 1
      account_financial_report_date_range/readme/CONTRIBUTORS.rst
  6. 2
      account_financial_report_date_range/readme/DESCRIPTION.rst
  7. 1
      account_financial_report_date_range/readme/INSTALL.rst
  8. BIN
      account_financial_report_date_range/static/description/icon.png
  9. 1
      account_financial_report_date_range/tests/__init__.py
  10. 30
      account_financial_report_date_range/tests/test_accounting_report.py
  11. 1
      account_financial_report_date_range/wizards/__init__.py
  12. 18
      account_financial_report_date_range/wizards/account_common_report.py
  13. 16
      account_financial_report_date_range/wizards/accounting_report.xml

55
account_financial_report_date_range/README.rst

@ -0,0 +1,55 @@
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png
:target: https://www.gnu.org/licenses/agpl
:alt: License: AGPL-3
===================================
Account Financial Report Date Range
===================================
This module adds the 'Date Range' field to the Odoo CE standard addons
financial reports wizard.
Installation
============
There is no specific installation procedure for this module.
Configuration and 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/11.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 smash it by providing detailed and welcomed feedback.
Credits
=======
Contributors
------------
* Luc De Meyer <luc.demeyer@noviat.com>
Do not contact contributors directly about support or help with technical issues.
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 http://odoo-community.org.

1
account_financial_report_date_range/__init__.py

@ -0,0 +1 @@
from . import wizards

25
account_financial_report_date_range/__manifest__.py

@ -0,0 +1,25 @@
# Copyright 2009-2018 Noviat.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Account Financial Report Date Range',
'summary': """
Add Date Range field to the Odoo OE standard addons
financial reports wizard.
""",
'version': '11.0.1.0.0',
'category': 'Accounting & Finance',
'website': 'https://github.com/OCA/account-financial-reporting',
'author': 'Noviat,'
'Odoo Community Association (OCA)',
'license': 'AGPL-3',
'installable': True,
'auto_install': True,
'depends': [
'account',
'date_range',
],
'data': [
'wizards/accounting_report.xml',
],
}

34
account_financial_report_date_range/i18n/account_financial_report_date_range.pot

@ -0,0 +1,34 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_financial_report_date_range
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: account_financial_report_date_range
#: model:ir.model,name:account_financial_report_date_range.model_account_common_report
msgid "Account Common Report"
msgstr ""
#. module: account_financial_report_date_range
#: model:ir.model.fields,field_description:account_financial_report_date_range.field_account_aged_trial_balance_date_range_id
#: model:ir.model.fields,field_description:account_financial_report_date_range.field_account_balance_report_date_range_id
#: model:ir.model.fields,field_description:account_financial_report_date_range.field_account_common_account_report_date_range_id
#: model:ir.model.fields,field_description:account_financial_report_date_range.field_account_common_journal_report_date_range_id
#: model:ir.model.fields,field_description:account_financial_report_date_range.field_account_common_partner_report_date_range_id
#: model:ir.model.fields,field_description:account_financial_report_date_range.field_account_common_report_date_range_id
#: model:ir.model.fields,field_description:account_financial_report_date_range.field_account_print_journal_date_range_id
#: model:ir.model.fields,field_description:account_financial_report_date_range.field_account_report_general_ledger_date_range_id
#: model:ir.model.fields,field_description:account_financial_report_date_range.field_account_report_partner_ledger_date_range_id
#: model:ir.model.fields,field_description:account_financial_report_date_range.field_accounting_report_date_range_id
msgid "Date range"
msgstr ""

1
account_financial_report_date_range/readme/CONTRIBUTORS.rst

@ -0,0 +1 @@
* Luc De Meyer <luc.demeyer@noviat.com>

2
account_financial_report_date_range/readme/DESCRIPTION.rst

@ -0,0 +1,2 @@
This module adds the 'Date Range' field to the Odoo CE standard addons
financial reports wizard.

1
account_financial_report_date_range/readme/INSTALL.rst

@ -0,0 +1 @@
There is no specific installation procedure for this module.

BIN
account_financial_report_date_range/static/description/icon.png

After

Width: 128  |  Height: 128  |  Size: 9.2 KiB

1
account_financial_report_date_range/tests/__init__.py

@ -0,0 +1 @@
from . import test_accounting_report

30
account_financial_report_date_range/tests/test_accounting_report.py

@ -0,0 +1,30 @@
# Copyright 2009-2017 Noviat.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import time
from odoo.tests.common import TransactionCase
class TestAccountingReport(TransactionCase):
def setUp(self):
super(TestAccountingReport, self).setUp()
p_type = self.env['date.range.type'].create({
'name': 'Fiscal Period',
'allow_overlap': False})
self.p1 = self.env['date.range'].create({
'name': 'P01',
'type_id': p_type.id,
'date_start': time.strftime('%Y-01-01'),
'date_end': time.strftime('%Y-01-31')})
def test_accounting_report(self):
bs = self.env.ref(
'account.account_financial_report_balancesheet0')
wiz = self.env['accounting.report'].create({
'account_report_id': bs.id})
# Check date_range onchange
wiz.date_range_id = self.p1
wiz._onchange_date_range_id()
self.assertEquals(wiz.date_from, time.strftime('%Y-01-01'))

1
account_financial_report_date_range/wizards/__init__.py

@ -0,0 +1 @@
from . import account_common_report

18
account_financial_report_date_range/wizards/account_common_report.py

@ -0,0 +1,18 @@
# Copyright 2009-2017 Noviat.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
class AccountCommonReport(models.TransientModel):
_inherit = 'account.common.report'
date_range_id = fields.Many2one(
comodel_name='date.range',
string='Date range',
)
@api.onchange('date_range_id')
def _onchange_date_range_id(self):
self.date_from = self.date_range_id.date_start
self.date_to = self.date_range_id.date_end

16
account_financial_report_date_range/wizards/accounting_report.xml

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<record id="accounting_report_view" model="ir.ui.view">
<field name="name">accounting.report.form.date_range</field>
<field name="model">accounting.report</field>
<field name="inherit_id" ref="account.accounting_report_view"/>
<field name="arch" type="xml">
<field name="date_from" position="before">
<field name="date_range_id" options="{'no_create_edit': True, 'no_create': True}"/>
<newline/>
</field>
</field>
</record>
</odoo>
Loading…
Cancel
Save