Merge PR #1834 into 17.0

Signed-off-by AaronHForgeFlow
This commit is contained in:
OCA-git-bot
2024-07-17 09:33:21 +00:00
23 changed files with 1747 additions and 0 deletions

View File

@@ -0,0 +1,101 @@
===================
Account Fiscal Year
===================
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:a008e71bacea04c2f422f6bfb3574299660e71524f5548016462d9e7e3180df6
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
:target: https://odoo-community.org/page/development-status
:alt: Production/Stable
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--financial--tools-lightgray.png?logo=github
:target: https://github.com/OCA/account-financial-tools/tree/17.0/account_fiscal_year
:alt: OCA/account-financial-tools
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/account-financial-tools-17-0/account-financial-tools-17-0-account_fiscal_year
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/account-financial-tools&target_branch=17.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
This module allows to create and edit fiscal years from the menu:
Invoicing > Configuration > Accounting > Fiscal Years
**Table of contents**
.. contents::
:local:
Known issues / Roadmap
======================
The account.fiscal.year model definition and views come from the core of
Odoo v13 community because in v14, account.fiscal.year has been moved to
Odoo enterprise.
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-financial-tools/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/account-financial-tools/issues/new?body=module:%20account_fiscal_year%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
Credits
=======
Authors
-------
* Agile Business Group
* Camptocamp SA
Contributors
------------
- Damien Crier <damien.crier@camptocamp.com>
- Laurent Mignon <laurent.mignon@acsone.eu>
- Lorenzo Battistini <https://github.com/eLBati>
- Andrea Stirpe <a.stirpe@onestein.nl>
- Simone Rubino <simone.rubino@agilebg.com>
- `Pesol <https://www.pesol.es>`__:
- Pedro Evaristo Gonzalez Sanchez <pedro.gonzalez@pesol.es>
Maintainers
-----------
This module is maintained by the OCA.
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
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.
.. |maintainer-eLBati| image:: https://github.com/eLBati.png?size=40px
:target: https://github.com/eLBati
:alt: eLBati
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
|maintainer-eLBati|
This module is part of the `OCA/account-financial-tools <https://github.com/OCA/account-financial-tools/tree/17.0/account_fiscal_year>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@@ -0,0 +1,3 @@
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
from . import models

View File

@@ -0,0 +1,24 @@
# Copyright 2016 Camptocamp SA
# Copyright 2018 Lorenzo Battistini <https://github.com/eLBati>
# Copyright 2020 Simone Rubino - Agile Business Group
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Account Fiscal Year",
"summary": "Create Account Fiscal Year",
"version": "17.0.1.0.0",
"development_status": "Production/Stable",
"category": "Accounting",
"website": "https://github.com/OCA/account-financial-tools",
"author": "Agile Business Group, Camptocamp SA, "
"Odoo Community Association (OCA)",
"maintainers": ["eLBati"],
"license": "AGPL-3",
"depends": [
"account",
],
"data": [
"security/ir.model.access.csv",
"security/account_fiscal_year_rule.xml",
"views/account_fiscal_year_views.xml",
],
}

View File

@@ -0,0 +1,121 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_fiscal_year
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.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_fiscal_year
#: model_terms:ir.actions.act_window,help:account_fiscal_year.actions_account_fiscal_year
msgid "Click here to create a new fiscal year."
msgstr ""
#. module: account_fiscal_year
#: model:ir.model,name:account_fiscal_year.model_res_company
msgid "Companies"
msgstr ""
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__company_id
msgid "Company"
msgstr ""
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__create_uid
msgid "Created by"
msgstr ""
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__create_date
msgid "Created on"
msgstr ""
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__display_name
msgid "Display Name"
msgstr ""
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__date_to
msgid "End Date"
msgstr ""
#. module: account_fiscal_year
#: model:ir.model.fields,help:account_fiscal_year.field_account_fiscal_year__date_to
msgid "Ending Date, included in the fiscal year."
msgstr ""
#. module: account_fiscal_year
#: model:ir.model,name:account_fiscal_year.model_account_fiscal_year
msgid "Fiscal Year"
msgstr ""
#. module: account_fiscal_year
#: model_terms:ir.ui.view,arch_db:account_fiscal_year.account_fiscal_year_form_view
msgid "Fiscal Year 2020"
msgstr ""
#. module: account_fiscal_year
#: model:ir.actions.act_window,name:account_fiscal_year.actions_account_fiscal_year
#: model:ir.ui.menu,name:account_fiscal_year.menu_actions_account_fiscal_year
msgid "Fiscal Years"
msgstr ""
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__id
msgid "ID"
msgstr ""
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year____last_update
msgid "Last Modified on"
msgstr ""
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__write_uid
msgid "Last Updated by"
msgstr ""
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__write_date
msgid "Last Updated on"
msgstr ""
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__name
msgid "Name"
msgstr ""
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__date_from
msgid "Start Date"
msgstr ""
#. module: account_fiscal_year
#: model:ir.model.fields,help:account_fiscal_year.field_account_fiscal_year__date_from
msgid "Start Date, included in the fiscal year."
msgstr ""
#. module: account_fiscal_year
#. odoo-python
#: code:addons/account_fiscal_year/models/account_fiscal_year.py:0
#, python-format
msgid "The ending date must not be prior to the starting date."
msgstr ""
#. module: account_fiscal_year
#. odoo-python
#: code:addons/account_fiscal_year/models/account_fiscal_year.py:0
#, python-format
msgid ""
"This fiscal year '{fy}' overlaps with '{overlapping_fy}'.\n"
"Please correct the start and/or end dates of your fiscal years."
msgstr ""

View File

@@ -0,0 +1,124 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_fiscal_year
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2022-05-20 19:05+0000\n"
"Last-Translator: Dept. Técnico <tecnico@extrememicro.es>\n"
"Language-Team: none\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.3.2\n"
#. module: account_fiscal_year
#: model_terms:ir.actions.act_window,help:account_fiscal_year.actions_account_fiscal_year
msgid "Click here to create a new fiscal year."
msgstr "Clicar aquí para crear un nuevo ejercicio fiscal."
#. module: account_fiscal_year
#: model:ir.model,name:account_fiscal_year.model_res_company
msgid "Companies"
msgstr ""
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__company_id
msgid "Company"
msgstr "Compañía"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__create_uid
msgid "Created by"
msgstr "Creado por"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__create_date
msgid "Created on"
msgstr "Creado en"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__display_name
msgid "Display Name"
msgstr "Nombre mostrado"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__date_to
msgid "End Date"
msgstr "Fecha final"
#. module: account_fiscal_year
#: model:ir.model.fields,help:account_fiscal_year.field_account_fiscal_year__date_to
msgid "Ending Date, included in the fiscal year."
msgstr "Fecha de finalización, incluida en el año fiscal."
#. module: account_fiscal_year
#: model:ir.model,name:account_fiscal_year.model_account_fiscal_year
msgid "Fiscal Year"
msgstr "Año fiscal"
#. module: account_fiscal_year
#: model_terms:ir.ui.view,arch_db:account_fiscal_year.account_fiscal_year_form_view
msgid "Fiscal Year 2020"
msgstr "Año fiscal 2020"
#. module: account_fiscal_year
#: model:ir.actions.act_window,name:account_fiscal_year.actions_account_fiscal_year
#: model:ir.ui.menu,name:account_fiscal_year.menu_actions_account_fiscal_year
msgid "Fiscal Years"
msgstr "Años fiscales"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__id
msgid "ID"
msgstr "ID"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year____last_update
msgid "Last Modified on"
msgstr "Última modificación el"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__write_uid
msgid "Last Updated by"
msgstr "Última actualización por"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__write_date
msgid "Last Updated on"
msgstr "Última actualización en"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__name
msgid "Name"
msgstr "Nombre"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__date_from
msgid "Start Date"
msgstr "Fecha inicial"
#. module: account_fiscal_year
#: model:ir.model.fields,help:account_fiscal_year.field_account_fiscal_year__date_from
msgid "Start Date, included in the fiscal year."
msgstr ""
#. module: account_fiscal_year
#. odoo-python
#: code:addons/account_fiscal_year/models/account_fiscal_year.py:0
#, python-format
msgid "The ending date must not be prior to the starting date."
msgstr ""
#. module: account_fiscal_year
#. odoo-python
#: code:addons/account_fiscal_year/models/account_fiscal_year.py:0
#, python-format
msgid ""
"This fiscal year '{fy}' overlaps with '{overlapping_fy}'.\n"
"Please correct the start and/or end dates of your fiscal years."
msgstr ""

View File

@@ -0,0 +1,124 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_fiscal_year
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2021-03-28 18:46+0000\n"
"Last-Translator: Yves Le Doeuff <yld@alliasys.fr>\n"
"Language-Team: none\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
"X-Generator: Weblate 4.3.2\n"
#. module: account_fiscal_year
#: model_terms:ir.actions.act_window,help:account_fiscal_year.actions_account_fiscal_year
msgid "Click here to create a new fiscal year."
msgstr "Cliquez ici pour créer un nouvel exercice."
#. module: account_fiscal_year
#: model:ir.model,name:account_fiscal_year.model_res_company
msgid "Companies"
msgstr "Sociétés"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__company_id
msgid "Company"
msgstr "Société"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__create_uid
msgid "Created by"
msgstr "Créé par"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__create_date
msgid "Created on"
msgstr "Créé le"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__display_name
msgid "Display Name"
msgstr "Nom affiché"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__date_to
msgid "End Date"
msgstr "Date de fin"
#. module: account_fiscal_year
#: model:ir.model.fields,help:account_fiscal_year.field_account_fiscal_year__date_to
msgid "Ending Date, included in the fiscal year."
msgstr "Date de fin, incluse dans l'exercice."
#. module: account_fiscal_year
#: model:ir.model,name:account_fiscal_year.model_account_fiscal_year
msgid "Fiscal Year"
msgstr "Exercice"
#. module: account_fiscal_year
#: model_terms:ir.ui.view,arch_db:account_fiscal_year.account_fiscal_year_form_view
msgid "Fiscal Year 2020"
msgstr "Exercice 2020"
#. module: account_fiscal_year
#: model:ir.actions.act_window,name:account_fiscal_year.actions_account_fiscal_year
#: model:ir.ui.menu,name:account_fiscal_year.menu_actions_account_fiscal_year
msgid "Fiscal Years"
msgstr "Exercices"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__id
msgid "ID"
msgstr ""
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year____last_update
msgid "Last Modified on"
msgstr "Dernière modification le"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__write_uid
msgid "Last Updated by"
msgstr "Dernière mise à jour par"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__write_date
msgid "Last Updated on"
msgstr "Dernière mise à jour le"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__name
msgid "Name"
msgstr "Nom"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__date_from
msgid "Start Date"
msgstr "Date de début"
#. module: account_fiscal_year
#: model:ir.model.fields,help:account_fiscal_year.field_account_fiscal_year__date_from
msgid "Start Date, included in the fiscal year."
msgstr "Date de début, incluse dans l'exercice."
#. module: account_fiscal_year
#. odoo-python
#: code:addons/account_fiscal_year/models/account_fiscal_year.py:0
#, python-format
msgid "The ending date must not be prior to the starting date."
msgstr "La date de début doit précéder la date de fin."
#. module: account_fiscal_year
#. odoo-python
#: code:addons/account_fiscal_year/models/account_fiscal_year.py:0
#, python-format
msgid ""
"This fiscal year '{fy}' overlaps with '{overlapping_fy}'.\n"
"Please correct the start and/or end dates of your fiscal years."
msgstr ""

View File

@@ -0,0 +1,126 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_fiscal_year
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2021-04-15 18:46+0000\n"
"Last-Translator: Yves Le Doeuff <yld@alliasys.fr>\n"
"Language-Team: none\n"
"Language: fr_FR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
"X-Generator: Weblate 4.3.2\n"
#. module: account_fiscal_year
#: model_terms:ir.actions.act_window,help:account_fiscal_year.actions_account_fiscal_year
msgid "Click here to create a new fiscal year."
msgstr "Cliquez ici pour créer un nouvel exercice."
#. module: account_fiscal_year
#: model:ir.model,name:account_fiscal_year.model_res_company
msgid "Companies"
msgstr "Sociétés"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__company_id
msgid "Company"
msgstr "Société"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__create_uid
msgid "Created by"
msgstr "Créé par"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__create_date
msgid "Created on"
msgstr "Créé le"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__display_name
msgid "Display Name"
msgstr "Nom affiché"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__date_to
msgid "End Date"
msgstr "Date de fin"
#. module: account_fiscal_year
#: model:ir.model.fields,help:account_fiscal_year.field_account_fiscal_year__date_to
msgid "Ending Date, included in the fiscal year."
msgstr "Date de fin, incluse dans l'exercice."
#. module: account_fiscal_year
#: model:ir.model,name:account_fiscal_year.model_account_fiscal_year
msgid "Fiscal Year"
msgstr "Exercice"
#. module: account_fiscal_year
#: model_terms:ir.ui.view,arch_db:account_fiscal_year.account_fiscal_year_form_view
msgid "Fiscal Year 2020"
msgstr "Exercice 2020"
#. module: account_fiscal_year
#: model:ir.actions.act_window,name:account_fiscal_year.actions_account_fiscal_year
#: model:ir.ui.menu,name:account_fiscal_year.menu_actions_account_fiscal_year
msgid "Fiscal Years"
msgstr "Exercices"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__id
msgid "ID"
msgstr ""
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year____last_update
msgid "Last Modified on"
msgstr "Dernière modification le"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__write_uid
msgid "Last Updated by"
msgstr "Dernière mise à jour par"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__write_date
msgid "Last Updated on"
msgstr "Dernière mise à jour le"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__name
msgid "Name"
msgstr "Nom"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__date_from
msgid "Start Date"
msgstr "Date de début"
#. module: account_fiscal_year
#: model:ir.model.fields,help:account_fiscal_year.field_account_fiscal_year__date_from
msgid "Start Date, included in the fiscal year."
msgstr "Date de début, incluse dans l'exercice."
#. module: account_fiscal_year
#. odoo-python
#: code:addons/account_fiscal_year/models/account_fiscal_year.py:0
#, python-format
msgid "The ending date must not be prior to the starting date."
msgstr "La date de début doit précéder la date de fin."
#. module: account_fiscal_year
#. odoo-python
#: code:addons/account_fiscal_year/models/account_fiscal_year.py:0
#, python-format
msgid ""
"This fiscal year '{fy}' overlaps with '{overlapping_fy}'.\n"
"Please correct the start and/or end dates of your fiscal years."
msgstr ""
"L'exercice '{fy}' chevauche avec '{overlapping_fy}'.\n"
"Veuillez modifier les dates de début et de fin."

View File

@@ -0,0 +1,127 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_fiscal_year
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-11-09 08:15+0000\n"
"PO-Revision-Date: 2021-12-03 12:36+0000\n"
"Last-Translator: Francesco Foresti <francesco.foresti@ooops404.com>\n"
"Language-Team: \n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.3.2\n"
#. module: account_fiscal_year
#: model_terms:ir.actions.act_window,help:account_fiscal_year.actions_account_fiscal_year
msgid "Click here to create a new fiscal year."
msgstr "Clicca qui per creare un nuovo anno fiscale."
#. module: account_fiscal_year
#: model:ir.model,name:account_fiscal_year.model_res_company
msgid "Companies"
msgstr "Aziende"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__company_id
msgid "Company"
msgstr "Azienda"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__create_uid
msgid "Created by"
msgstr "Creato da"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__create_date
msgid "Created on"
msgstr "Creato il"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__display_name
msgid "Display Name"
msgstr "Nome visualizzato"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__date_to
msgid "End Date"
msgstr "Data fine"
#. module: account_fiscal_year
#: model:ir.model.fields,help:account_fiscal_year.field_account_fiscal_year__date_to
msgid "Ending Date, included in the fiscal year."
msgstr "Data di chiusura, inclusa nell'anno fiscale."
#. module: account_fiscal_year
#: model:ir.model,name:account_fiscal_year.model_account_fiscal_year
msgid "Fiscal Year"
msgstr "Anni fiscali"
#. module: account_fiscal_year
#: model_terms:ir.ui.view,arch_db:account_fiscal_year.account_fiscal_year_form_view
msgid "Fiscal Year 2020"
msgstr "Anno fiscale 2020"
#. module: account_fiscal_year
#: model:ir.actions.act_window,name:account_fiscal_year.actions_account_fiscal_year
#: model:ir.ui.menu,name:account_fiscal_year.menu_actions_account_fiscal_year
msgid "Fiscal Years"
msgstr "Anni fiscali"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__id
msgid "ID"
msgstr "ID"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year____last_update
msgid "Last Modified on"
msgstr "Ultima modifica il"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__write_uid
msgid "Last Updated by"
msgstr "Ultimo aggiornamento di"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__write_date
msgid "Last Updated on"
msgstr "Ultimo aggiornamento il"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__name
msgid "Name"
msgstr "Nome"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__date_from
msgid "Start Date"
msgstr "Data inizio"
#. module: account_fiscal_year
#: model:ir.model.fields,help:account_fiscal_year.field_account_fiscal_year__date_from
msgid "Start Date, included in the fiscal year."
msgstr "Data inizio, inclusa nell'anno fiscale."
#. module: account_fiscal_year
#. odoo-python
#: code:addons/account_fiscal_year/models/account_fiscal_year.py:0
#, python-format
msgid "The ending date must not be prior to the starting date."
msgstr "La data di fine non deve essere antecedente a quella di inizio."
#. module: account_fiscal_year
#. odoo-python
#: code:addons/account_fiscal_year/models/account_fiscal_year.py:0
#, python-format
msgid ""
"This fiscal year '{fy}' overlaps with '{overlapping_fy}'.\n"
"Please correct the start and/or end dates of your fiscal years."
msgstr ""
"Questo anno fiscale '{fy}' si sovrappone a '{overlapping_fy}'.\n"
"Correggere le relative date di inizio e/o di fine."

View File

@@ -0,0 +1,126 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_fiscal_year
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2021-04-14 21:46+0000\n"
"Last-Translator: Bosd <c5e2fd43-d292-4c90-9d1f-74ff3436329a@anonaddy.me>\n"
"Language-Team: none\n"
"Language: nl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.3.2\n"
#. module: account_fiscal_year
#: model_terms:ir.actions.act_window,help:account_fiscal_year.actions_account_fiscal_year
msgid "Click here to create a new fiscal year."
msgstr "Klik hier om een nieuw fiscaal jaar aan te maken."
#. module: account_fiscal_year
#: model:ir.model,name:account_fiscal_year.model_res_company
msgid "Companies"
msgstr "Bedrijven"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__company_id
msgid "Company"
msgstr "Bedrijf"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__create_uid
msgid "Created by"
msgstr "Aangemaakt door"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__create_date
msgid "Created on"
msgstr "aangemaakt op"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__display_name
msgid "Display Name"
msgstr "Weergavenaam"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__date_to
msgid "End Date"
msgstr "Einddatum"
#. module: account_fiscal_year
#: model:ir.model.fields,help:account_fiscal_year.field_account_fiscal_year__date_to
msgid "Ending Date, included in the fiscal year."
msgstr "Einddatum, opnemen in het fiscale jaar."
#. module: account_fiscal_year
#: model:ir.model,name:account_fiscal_year.model_account_fiscal_year
msgid "Fiscal Year"
msgstr "Fiscaal jaar"
#. module: account_fiscal_year
#: model_terms:ir.ui.view,arch_db:account_fiscal_year.account_fiscal_year_form_view
msgid "Fiscal Year 2020"
msgstr "Fiscaal jaar 2020"
#. module: account_fiscal_year
#: model:ir.actions.act_window,name:account_fiscal_year.actions_account_fiscal_year
#: model:ir.ui.menu,name:account_fiscal_year.menu_actions_account_fiscal_year
msgid "Fiscal Years"
msgstr "Fiscale jaren"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__id
msgid "ID"
msgstr "ID"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year____last_update
msgid "Last Modified on"
msgstr "Laatst bijgewerkt op"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__write_uid
msgid "Last Updated by"
msgstr "Laatst bijgewerkt door"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__write_date
msgid "Last Updated on"
msgstr "Laatst bijgewerkt op"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__name
msgid "Name"
msgstr "Naam"
#. module: account_fiscal_year
#: model:ir.model.fields,field_description:account_fiscal_year.field_account_fiscal_year__date_from
msgid "Start Date"
msgstr "Start Datum"
#. module: account_fiscal_year
#: model:ir.model.fields,help:account_fiscal_year.field_account_fiscal_year__date_from
msgid "Start Date, included in the fiscal year."
msgstr "Begindatum, opgenomen in het fiscale jaar."
#. module: account_fiscal_year
#. odoo-python
#: code:addons/account_fiscal_year/models/account_fiscal_year.py:0
#, python-format
msgid "The ending date must not be prior to the starting date."
msgstr "De einddatum kan niet eerder zijn dan de start datum."
#. module: account_fiscal_year
#. odoo-python
#: code:addons/account_fiscal_year/models/account_fiscal_year.py:0
#, python-format
msgid ""
"This fiscal year '{fy}' overlaps with '{overlapping_fy}'.\n"
"Please correct the start and/or end dates of your fiscal years."
msgstr ""
"Dit fiscale jaar '{fy}' overlap met '{overlapping_fy}'.\n"
"Corrigeer de begin en/of eind data van de fiscale jaren."

View File

@@ -0,0 +1,4 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import account_fiscal_year
from . import res_company

View File

@@ -0,0 +1,109 @@
# Copyright 2020 Simone Rubino - Agile Business Group
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import _, api, fields, models
from odoo.exceptions import ValidationError
from odoo.osv import expression
class AccountFiscalYear(models.Model):
_name = "account.fiscal.year"
_description = "Fiscal Year"
name = fields.Char(
required=True,
)
date_from = fields.Date(
string="Start Date",
required=True,
help="Start Date, included in the fiscal year.",
)
date_to = fields.Date(
string="End Date",
required=True,
help="Ending Date, included in the fiscal year.",
)
company_id = fields.Many2one(
comodel_name="res.company",
string="Company",
required=True,
default=lambda self: self.env.company,
)
@api.constrains("date_from", "date_to", "company_id")
def _check_dates(self):
"""Check intersection with existing fiscal years."""
for fy in self:
# Starting date must be prior to the ending date
date_from = fy.date_from
date_to = fy.date_to
if date_to < date_from:
raise ValidationError(
_("The ending date must not be prior to the starting date.")
)
domain = fy._get_overlapping_domain()
overlapping_fy = self.search(domain, limit=1)
if overlapping_fy:
raise ValidationError(
_(
"This fiscal year '{fy}' "
"overlaps with '{overlapping_fy}'.\n"
"Please correct the start and/or end dates "
"of your fiscal years."
).format(
fy=fy.display_name,
overlapping_fy=overlapping_fy.display_name,
)
)
def _get_overlapping_domain(self):
"""Get domain for finding fiscal years overlapping with self.
The domain will search only among fiscal years of this company.
"""
self.ensure_one()
# Compare with other fiscal years defined for this company
company_domain = [
("id", "!=", self.id),
("company_id", "=", self.company_id.id),
]
date_from = self.date_from
date_to = self.date_to
# Search fiscal years intersecting with current fiscal year.
# This fiscal year's `from` is contained in another fiscal year
# other.from <= fy.from <= other.to
intersection_domain_from = [
"&",
("date_from", "<=", date_from),
("date_to", ">=", date_from),
]
# This fiscal year's `to` is contained in another fiscal year
# other.from <= fy.to <= other.to
intersection_domain_to = [
"&",
("date_from", "<=", date_to),
("date_to", ">=", date_to),
]
# This fiscal year completely contains another fiscal year
# fy.from <= other.from (or other.to) <= fy.to
intersection_domain_contain = [
"&",
("date_from", ">=", date_from),
("date_from", "<=", date_to),
]
intersection_domain = expression.OR(
[
intersection_domain_from,
intersection_domain_to,
intersection_domain_contain,
]
)
return expression.AND(
[
company_domain,
intersection_domain,
]
)

View File

@@ -0,0 +1,79 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from datetime import timedelta
from odoo import models
from odoo.tools import date_utils
class ResCompany(models.Model):
_inherit = "res.company"
def compute_fiscalyear_dates(self, current_date):
"""Computes the start and end dates of the fiscal year
where the given 'date' belongs to.
:param current_date: A datetime.date/datetime.datetime object.
:return: A dictionary containing:
* date_from
* date_to
* [Optionally] record: The fiscal year record.
"""
self.ensure_one()
# Search a fiscal year record containing the date.
fiscalyear = self.env["account.fiscal.year"].search(
[
("company_id", "=", self.id),
("date_from", "<=", current_date),
("date_to", ">=", current_date),
],
limit=1,
)
if fiscalyear:
return {
"date_from": fiscalyear.date_from,
"date_to": fiscalyear.date_to,
"record": fiscalyear,
}
date_from, date_to = date_utils.get_fiscal_year(
current_date,
day=self.fiscalyear_last_day,
month=int(self.fiscalyear_last_month),
)
# Search for fiscal year records reducing
# the delta between the date_from/date_to.
# This case could happen if there is a gap
# between two fiscal year records.
# E.g. two fiscal year records:
# 2017-01-01 -> 2017-02-01 and 2017-03-01 -> 2017-12-31.
# =>
# The period 2017-02-02 - 2017-02-30 is not covered by a fiscal year record.
fiscalyear_from = self.env["account.fiscal.year"].search(
[
("company_id", "=", self.id),
("date_from", "<=", date_from),
("date_to", ">=", date_from),
],
limit=1,
)
if fiscalyear_from:
date_from = fiscalyear_from.date_to + timedelta(days=1)
fiscalyear_to = self.env["account.fiscal.year"].search(
[
("company_id", "=", self.id),
("date_from", "<=", date_to),
("date_to", ">=", date_to),
],
limit=1,
)
if fiscalyear_to:
date_to = fiscalyear_to.date_from - timedelta(days=1)
return {
"date_from": date_from,
"date_to": date_to,
}

View File

@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"

View File

@@ -0,0 +1,7 @@
- Damien Crier \<<damien.crier@camptocamp.com>\>
- Laurent Mignon \<<laurent.mignon@acsone.eu>\>
- Lorenzo Battistini \<<https://github.com/eLBati>\>
- Andrea Stirpe \<<a.stirpe@onestein.nl>\>
- Simone Rubino \<<simone.rubino@agilebg.com>\>
- [Pesol](https://www.pesol.es):
- Pedro Evaristo Gonzalez Sanchez \<<pedro.gonzalez@pesol.es>\>

View File

@@ -0,0 +1,3 @@
This module allows to create and edit fiscal years from the menu:
Invoicing \> Configuration \> Accounting \> Fiscal Years

View File

@@ -0,0 +1,3 @@
The account.fiscal.year model definition and views come from the core of
Odoo v13 community because in v14, account.fiscal.year has been moved to
Odoo enterprise.

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2021 Akretion France (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo noupdate="1">
<record id="account_fiscal_year_rule" model="ir.rule">
<field name="name">Fiscal Year multi-company</field>
<field name="model_id" ref="model_account_fiscal_year" />
<field
name="domain_force"
>['|', ('company_id', '=', False), ('company_id', 'in', company_ids)]</field>
</record>
</odoo>

View File

@@ -0,0 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_account_fiscal_year_user,account.fiscal.year.user,model_account_fiscal_year,account.group_account_user,1,0,0,0
access_account_fiscal_year_manager,account.fiscal.year.manager,model_account_fiscal_year,account.group_account_manager,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_account_fiscal_year_user account.fiscal.year.user model_account_fiscal_year account.group_account_user 1 0 0 0
3 access_account_fiscal_year_manager account.fiscal.year.manager model_account_fiscal_year account.group_account_manager 1 1 1 1

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@@ -0,0 +1,443 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>Account Fiscal Year</title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
border: 0 }
table.borderless td, table.borderless th {
/* Override padding for "table.docutils td" with "! important".
The right padding separates the table cells. */
padding: 0 0.5em 0 0 ! important }
.first {
/* Override more specific margin styles with "! important". */
margin-top: 0 ! important }
.last, .with-subtitle {
margin-bottom: 0 ! important }
.hidden {
display: none }
.subscript {
vertical-align: sub;
font-size: smaller }
.superscript {
vertical-align: super;
font-size: smaller }
a.toc-backref {
text-decoration: none ;
color: black }
blockquote.epigraph {
margin: 2em 5em ; }
dl.docutils dd {
margin-bottom: 0.5em }
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
overflow: hidden;
}
/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
font-weight: bold }
*/
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error {
color: red ;
font-weight: bold ;
font-family: sans-serif }
/* Uncomment (and remove this text!) to get reduced vertical space in
compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
margin-bottom: 0.5em }
div.compound .compound-last, div.compound .compound-middle {
margin-top: 0.5em }
*/
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em ;
margin-right: 2em }
div.footer, div.header {
clear: both;
font-size: smaller }
div.line-block {
display: block ;
margin-top: 1em ;
margin-bottom: 1em }
div.line-block div.line-block {
margin-top: 0 ;
margin-bottom: 0 ;
margin-left: 1.5em }
div.sidebar {
margin: 0 0 0.5em 1em ;
border: medium outset ;
padding: 1em ;
background-color: #ffffee ;
width: 40% ;
float: right ;
clear: right }
div.sidebar p.rubric {
font-family: sans-serif ;
font-size: medium }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
margin-top: 0.4em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr.docutils {
width: 75% }
img.align-left, .figure.align-left, object.align-left, table.align-left {
clear: left ;
float: left ;
margin-right: 1em }
img.align-right, .figure.align-right, object.align-right, table.align-right {
clear: right ;
float: right ;
margin-left: 1em }
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
table.align-center {
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left }
.align-center {
clear: both ;
text-align: center }
.align-right {
text-align: right }
/* reset inner alignment in figures */
div.align-right {
text-align: inherit }
/* div.align-center * { */
/* text-align: left } */
.align-top {
vertical-align: top }
.align-middle {
vertical-align: middle }
.align-bottom {
vertical-align: bottom }
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.attribution {
text-align: right ;
margin-left: 50% }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.rubric {
font-weight: bold ;
font-size: larger ;
color: maroon ;
text-align: center }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font: inherit }
pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.pre {
white-space: pre }
span.problematic, pre.problematic {
color: red }
span.section-subtitle {
/* font-size relative to parent (h1..h6 element) */
font-size: 80% }
table.citation {
border-left: solid 1px gray;
margin-left: 1px }
table.docinfo {
margin: 2em 4em }
table.docutils {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.footnote {
border-left: solid 1px black;
margin-left: 1px }
table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
table.docutils th.field-name, table.docinfo th.docinfo-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap ;
padding-left: 0 }
/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
border: 0px;
border-top: 2px solid;
border-bottom: 2px solid;
border-collapse: collapse;
}
table.docutils.booktabs * {
border: 0px;
}
table.docutils.booktabs th {
border-bottom: thin solid;
text-align: left;
}
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% }
ul.auto-toc {
list-style-type: none }
</style>
</head>
<body>
<div class="document" id="account-fiscal-year">
<h1 class="title">Account Fiscal Year</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:a008e71bacea04c2f422f6bfb3574299660e71524f5548016462d9e7e3180df6
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/account-financial-tools/tree/17.0/account_fiscal_year"><img alt="OCA/account-financial-tools" src="https://img.shields.io/badge/github-OCA%2Faccount--financial--tools-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/account-financial-tools-17-0/account-financial-tools-17-0-account_fiscal_year"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/account-financial-tools&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module allows to create and edit fiscal years from the menu:</p>
<p>Invoicing &gt; Configuration &gt; Accounting &gt; Fiscal Years</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#known-issues-roadmap" id="toc-entry-1">Known issues / Roadmap</a></li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-2">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-3">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-4">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-5">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-6">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="known-issues-roadmap">
<h1><a class="toc-backref" href="#toc-entry-1">Known issues / Roadmap</a></h1>
<p>The account.fiscal.year model definition and views come from the core of
Odoo v13 community because in v14, account.fiscal.year has been moved to
Odoo enterprise.</p>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/account-financial-tools/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/account-financial-tools/issues/new?body=module:%20account_fiscal_year%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#toc-entry-3">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
<ul class="simple">
<li>Agile Business Group</li>
<li>Camptocamp SA</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<ul class="simple">
<li>Damien Crier &lt;<a class="reference external" href="mailto:damien.crier&#64;camptocamp.com">damien.crier&#64;camptocamp.com</a>&gt;</li>
<li>Laurent Mignon &lt;<a class="reference external" href="mailto:laurent.mignon&#64;acsone.eu">laurent.mignon&#64;acsone.eu</a>&gt;</li>
<li>Lorenzo Battistini &lt;<a class="reference external" href="https://github.com/eLBati">https://github.com/eLBati</a>&gt;</li>
<li>Andrea Stirpe &lt;<a class="reference external" href="mailto:a.stirpe&#64;onestein.nl">a.stirpe&#64;onestein.nl</a>&gt;</li>
<li>Simone Rubino &lt;<a class="reference external" href="mailto:simone.rubino&#64;agilebg.com">simone.rubino&#64;agilebg.com</a>&gt;</li>
<li><a class="reference external" href="https://www.pesol.es">Pesol</a>:<ul>
<li>Pedro Evaristo Gonzalez Sanchez &lt;<a class="reference external" href="mailto:pedro.gonzalez&#64;pesol.es">pedro.gonzalez&#64;pesol.es</a>&gt;</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<p>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.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
<p><a class="reference external image-reference" href="https://github.com/eLBati"><img alt="eLBati" src="https://github.com/eLBati.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/account-financial-tools/tree/17.0/account_fiscal_year">OCA/account-financial-tools</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import test_account_fiscal_year

View File

@@ -0,0 +1,132 @@
from odoo import fields
from odoo.tests import common
class TestFiscalPosition(common.TransactionCase):
def check_compute_fiscal_year(
self, company, date, expected_date_from, expected_date_to
):
"""Compute the fiscal year at a certain date for the company
passed as parameter.
Then, check if the result matches the
'expected_date_from'/'expected_date_to' dates.
:param company: The company.
:param date: The date belonging to the fiscal year.
:param expected_date_from: The expected date_from after computation.
:param expected_date_to: The expected date_to after computation.
"""
current_date = fields.Date.from_string(date)
res = company.compute_fiscalyear_dates(current_date)
self.assertEqual(res["date_from"], fields.Date.from_string(expected_date_from))
self.assertEqual(res["date_to"], fields.Date.from_string(expected_date_to))
def test_default_fiscal_year(self):
"""Basic case with a fiscal year xxxx-01-01 - xxxx-12-31."""
company = self.env.ref("base.main_company")
company.fiscalyear_last_day = 31
company.fiscalyear_last_month = "12"
self.check_compute_fiscal_year(
company,
"2017-12-31",
"2017-01-01",
"2017-12-31",
)
self.check_compute_fiscal_year(
company,
"2017-01-01",
"2017-01-01",
"2017-12-31",
)
def test_leap_fiscal_year_1(self):
"""Case with a leap year ending the 29 February."""
company = self.env.ref("base.main_company")
company.fiscalyear_last_day = 29
company.fiscalyear_last_month = "2"
self.check_compute_fiscal_year(
company,
"2016-02-29",
"2015-03-01",
"2016-02-29",
)
self.check_compute_fiscal_year(
company,
"2015-03-01",
"2015-03-01",
"2016-02-29",
)
def test_leap_fiscal_year_2(self):
"""Case with a leap year ending the 28 February."""
company = self.env.ref("base.main_company")
company.fiscalyear_last_day = 28
company.fiscalyear_last_month = "2"
self.check_compute_fiscal_year(
company,
"2016-02-29",
"2015-03-01",
"2016-02-29",
)
self.check_compute_fiscal_year(
company,
"2016-03-01",
"2016-03-01",
"2017-02-28",
)
def test_custom_fiscal_year(self):
"""Case with custom fiscal years."""
company = self.env.ref("base.main_company")
company.fiscalyear_last_day = 31
company.fiscalyear_last_month = "12"
# Create custom fiscal year covering the 6 first months of 2017.
self.env["account.fiscal.year"].create(
{
"name": "6 month 2017",
"date_from": "2017-01-01",
"date_to": "2017-05-31",
"company_id": company.id,
}
)
# Check before the custom fiscal year).
self.check_compute_fiscal_year(
company,
"2017-02-01",
"2017-01-01",
"2017-05-31",
)
# Check after the custom fiscal year.
self.check_compute_fiscal_year(
company,
"2017-11-01",
"2017-06-01",
"2017-12-31",
)
# Create custom fiscal year covering the 3 last months of 2017.
self.env["account.fiscal.year"].create(
{
"name": "last 3 month 2017",
"date_from": "2017-10-01",
"date_to": "2017-12-31",
"company_id": company.id,
}
)
# Check inside the custom fiscal years.
self.check_compute_fiscal_year(
company,
"2017-07-01",
"2017-06-01",
"2017-09-30",
)

View File

@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
~ Copyright 2020 Simone Rubino - Agile Business Group
~ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<odoo>
<record id="account_fiscal_year_form_view" model="ir.ui.view">
<field name="name">Form view for account.fiscal.year</field>
<field name="model">account.fiscal.year</field>
<field name="arch" type="xml">
<form>
<sheet>
<group>
<field name="name" placeholder="Fiscal Year 2020" />
<field name="date_from" />
<field name="date_to" />
<field name="company_id" groups="base.group_multi_company" />
</group>
</sheet>
</form>
</field>
</record>
<record id="account_fiscal_year_search_view" model="ir.ui.view">
<field name="name">Search view for account.fiscal.year</field>
<field name="model">account.fiscal.year</field>
<field name="arch" type="xml">
<search>
<field name="name" />
</search>
</field>
</record>
<record id="account_fiscal_year_tree_view" model="ir.ui.view">
<field name="name">Tree view for account.fiscal.year</field>
<field name="model">account.fiscal.year</field>
<field name="arch" type="xml">
<tree>
<field name="name" />
<field name="date_from" />
<field name="date_to" />
<field name="company_id" groups="base.group_multi_company" />
</tree>
</field>
</record>
<record id="actions_account_fiscal_year" model="ir.actions.act_window">
<field name="name">Fiscal Years</field>
<field name="res_model">account.fiscal.year</field>
<field name="view_mode">tree,form</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click here to create a new fiscal year.
</p>
</field>
</record>
<menuitem
id="menu_actions_account_fiscal_year"
parent="account.account_account_menu"
action="actions_account_fiscal_year"
/>
</odoo>