From 005211da7868d054708f94049ec6ef290d71ff59 Mon Sep 17 00:00:00 2001 From: Benoit Aimont Date: Fri, 2 Sep 2022 11:48:06 +0200 Subject: [PATCH] [MIG] account_fiscal_year: Migration to 16.0 --- account_fiscal_year/README.rst | 14 +++++++------- account_fiscal_year/__manifest__.py | 2 +- .../i18n/account_fiscal_year.pot | 2 +- account_fiscal_year/i18n/es.po | 2 +- .../models/account_fiscal_year.py | 1 - account_fiscal_year/models/res_company.py | 17 +++++++---------- .../static/description/index.html | 6 +++--- .../odoo/addons/account_fiscal_year | 1 + setup/account_fiscal_year/setup.py | 6 ++++++ 9 files changed, 27 insertions(+), 24 deletions(-) create mode 120000 setup/account_fiscal_year/odoo/addons/account_fiscal_year create mode 100644 setup/account_fiscal_year/setup.py diff --git a/account_fiscal_year/README.rst b/account_fiscal_year/README.rst index 040a6e7d..6d1e98bf 100644 --- a/account_fiscal_year/README.rst +++ b/account_fiscal_year/README.rst @@ -14,16 +14,16 @@ Account Fiscal Year :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/15.0/account_fiscal_year + :target: https://github.com/OCA/account-financial-tools/tree/16.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-15-0/account-financial-tools-15-0-account_fiscal_year + :target: https://translation.odoo-community.org/projects/account-financial-tools-16-0/account-financial-tools-16-0-account_fiscal_year :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/92/15.0 + :target: https://runbot.odoo-community.org/runbot/92/16.0 :alt: Try me on Runbot -|badge1| |badge2| |badge3| |badge4| |badge5| +|badge1| |badge2| |badge3| |badge4| |badge5| This module allows to create and edit fiscal years from the menu: @@ -45,7 +45,7 @@ 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 `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -90,8 +90,8 @@ promote its widespread use. Current `maintainer `__: -|maintainer-eLBati| +|maintainer-eLBati| -This module is part of the `OCA/account-financial-tools `_ project on GitHub. +This module is part of the `OCA/account-financial-tools `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_fiscal_year/__manifest__.py b/account_fiscal_year/__manifest__.py index 0dfbc810..0fe78383 100644 --- a/account_fiscal_year/__manifest__.py +++ b/account_fiscal_year/__manifest__.py @@ -5,7 +5,7 @@ { "name": "Account Fiscal Year", "summary": "Create Account Fiscal Year", - "version": "15.0.1.0.0", + "version": "16.0.1.0.0", "development_status": "Production/Stable", "category": "Accounting", "website": "https://github.com/OCA/account-financial-tools" diff --git a/account_fiscal_year/i18n/account_fiscal_year.pot b/account_fiscal_year/i18n/account_fiscal_year.pot index bd73d422..11612996 100644 --- a/account_fiscal_year/i18n/account_fiscal_year.pot +++ b/account_fiscal_year/i18n/account_fiscal_year.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 15.0\n" +"Project-Id-Version: Odoo Server 16.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: \n" "Language-Team: \n" diff --git a/account_fiscal_year/i18n/es.po b/account_fiscal_year/i18n/es.po index 900cb974..bfb770a5 100644 --- a/account_fiscal_year/i18n/es.po +++ b/account_fiscal_year/i18n/es.po @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 15.0\n" +"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 \n" diff --git a/account_fiscal_year/models/account_fiscal_year.py b/account_fiscal_year/models/account_fiscal_year.py index 6b67fcac..9054f79e 100644 --- a/account_fiscal_year/models/account_fiscal_year.py +++ b/account_fiscal_year/models/account_fiscal_year.py @@ -9,7 +9,6 @@ from odoo.osv import expression class AccountFiscalYear(models.Model): _name = "account.fiscal.year" _description = "Fiscal Year" - _rec_name = "name" name = fields.Char( required=True, diff --git a/account_fiscal_year/models/res_company.py b/account_fiscal_year/models/res_company.py index fbe6b0e1..cc5e2ac6 100644 --- a/account_fiscal_year/models/res_company.py +++ b/account_fiscal_year/models/res_company.py @@ -2,7 +2,7 @@ from datetime import timedelta from odoo import models -from odoo.tools import DEFAULT_SERVER_DATE_FORMAT, date_utils +from odoo.tools import date_utils class ResCompany(models.Model): @@ -19,14 +19,13 @@ class ResCompany(models.Model): * [Optionally] record: The fiscal year record. """ self.ensure_one() - date_str = current_date.strftime(DEFAULT_SERVER_DATE_FORMAT) # Search a fiscal year record containing the date. fiscalyear = self.env["account.fiscal.year"].search( [ ("company_id", "=", self.id), - ("date_from", "<=", date_str), - ("date_to", ">=", date_str), + ("date_from", "<=", current_date), + ("date_to", ">=", current_date), ], limit=1, ) @@ -52,24 +51,22 @@ class ResCompany(models.Model): # => # The period 2017-02-02 - 2017-02-30 is not covered by a fiscal year record. - date_from_str = date_from.strftime(DEFAULT_SERVER_DATE_FORMAT) fiscalyear_from = self.env["account.fiscal.year"].search( [ ("company_id", "=", self.id), - ("date_from", "<=", date_from_str), - ("date_to", ">=", date_from_str), + ("date_from", "<=", date_from), + ("date_to", ">=", date_from), ], limit=1, ) if fiscalyear_from: date_from = fiscalyear_from.date_to + timedelta(days=1) - date_to_str = date_to.strftime(DEFAULT_SERVER_DATE_FORMAT) fiscalyear_to = self.env["account.fiscal.year"].search( [ ("company_id", "=", self.id), - ("date_from", "<=", date_to_str), - ("date_to", ">=", date_to_str), + ("date_from", "<=", date_to), + ("date_to", ">=", date_to), ], limit=1, ) diff --git a/account_fiscal_year/static/description/index.html b/account_fiscal_year/static/description/index.html index d9566ac9..76e8848a 100644 --- a/account_fiscal_year/static/description/index.html +++ b/account_fiscal_year/static/description/index.html @@ -367,7 +367,7 @@ ul.auto-toc { !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Production/Stable License: AGPL-3 OCA/account-financial-tools Translate me on Weblate Try me on Runbot

+

Production/Stable License: AGPL-3 OCA/account-financial-tools Translate me on Weblate Try me on Runbot

This module allows to create and edit fiscal years from the menu:

Invoicing > Configuration > Accounting > Fiscal Years

Table of contents

@@ -392,7 +392,7 @@ ul.auto-toc {

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.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -427,7 +427,7 @@ mission is to support the collaborative development of Odoo features and promote its widespread use.

Current maintainer:

eLBati

-

This module is part of the OCA/account-financial-tools project on GitHub.

+

This module is part of the OCA/account-financial-tools project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

diff --git a/setup/account_fiscal_year/odoo/addons/account_fiscal_year b/setup/account_fiscal_year/odoo/addons/account_fiscal_year new file mode 120000 index 00000000..3b277c5e --- /dev/null +++ b/setup/account_fiscal_year/odoo/addons/account_fiscal_year @@ -0,0 +1 @@ +../../../../account_fiscal_year \ No newline at end of file diff --git a/setup/account_fiscal_year/setup.py b/setup/account_fiscal_year/setup.py new file mode 100644 index 00000000..28c57bb6 --- /dev/null +++ b/setup/account_fiscal_year/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)