[10.0] add new module account_financial_report_date_range
parent
ce377fdf7e
commit
c3bdf212ed
|
@ -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
|
||||||
|
|
||||||
|
====================================
|
||||||
|
Date Range Year on Financial Reports
|
||||||
|
====================================
|
||||||
|
|
||||||
|
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/10.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.
|
|
@ -0,0 +1,2 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
from . import wizards
|
|
@ -0,0 +1,26 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright 2009-2018 Noviat.
|
||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
|
{
|
||||||
|
'name': 'Date Range Year on Financial Reports',
|
||||||
|
'summary': """
|
||||||
|
Add Date Range field to the Odoo OE standard addons
|
||||||
|
financial reports wizard.
|
||||||
|
""",
|
||||||
|
'version': '10.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',
|
||||||
|
],
|
||||||
|
}
|
Binary file not shown.
After Width: | Height: | Size: 9.2 KiB |
|
@ -0,0 +1,2 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
from . import test_accounting_report
|
|
@ -0,0 +1,32 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# 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'))
|
|
@ -0,0 +1,2 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
from . import account_common_report
|
|
@ -0,0 +1,19 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# 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
|
|
@ -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…
Reference in New Issue