diff --git a/account_cutoff_start_end_dates/README.rst b/account_cutoff_start_end_dates/README.rst index fe6f27aa98a..2e646253ce4 100644 --- a/account_cutoff_start_end_dates/README.rst +++ b/account_cutoff_start_end_dates/README.rst @@ -14,14 +14,14 @@ Account Cut-off Start End Dates :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--closing-lightgray.png?logo=github - :target: https://github.com/OCA/account-closing/tree/15.0/account_cutoff_start_end_dates + :target: https://github.com/OCA/account-closing/tree/16.0/account_cutoff_start_end_dates :alt: OCA/account-closing .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/account-closing-15-0/account-closing-15-0-account_cutoff_start_end_dates + :target: https://translation.odoo-community.org/projects/account-closing-16-0/account-closing-16-0-account_cutoff_start_end_dates :alt: Translate me on Weblate -.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/89/15.0 - :alt: Try me on Runbot +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/webui/builds.html?repo=OCA/account-closing&target_branch=16.0 + :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -76,7 +76,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. @@ -94,6 +94,13 @@ Contributors * Alexis de Lattre * Stéphane Bidoul * Jim Hoefnagels +* `Trobz `_: + * Dzung Tran + +Other credits +~~~~~~~~~~~~~ + +The migration of this module from 15.0 to 16.0 was financially supported by Camptocamp Maintainers ~~~~~~~~~~~ @@ -116,6 +123,6 @@ Current `maintainer `__: |maintainer-alexis-via| -This module is part of the `OCA/account-closing `_ project on GitHub. +This module is part of the `OCA/account-closing `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_cutoff_start_end_dates/__manifest__.py b/account_cutoff_start_end_dates/__manifest__.py index 9478a2834f9..652bc779f8d 100644 --- a/account_cutoff_start_end_dates/__manifest__.py +++ b/account_cutoff_start_end_dates/__manifest__.py @@ -5,7 +5,7 @@ { "name": "Account Cut-off Start End Dates", - "version": "15.0.1.0.0", + "version": "16.0.1.0.0", "category": "Accounting & Finance", "license": "AGPL-3", "summary": "Cutoffs based on start/end dates", diff --git a/account_cutoff_start_end_dates/models/__init__.py b/account_cutoff_start_end_dates/models/__init__.py index 083d1663928..2ee14ae58ef 100644 --- a/account_cutoff_start_end_dates/models/__init__.py +++ b/account_cutoff_start_end_dates/models/__init__.py @@ -1 +1,2 @@ from . import account_cutoff +from . import account_cutoff_line diff --git a/account_cutoff_start_end_dates/models/account_cutoff.py b/account_cutoff_start_end_dates/models/account_cutoff.py index 95198979785..62659a66d65 100644 --- a/account_cutoff_start_end_dates/models/account_cutoff.py +++ b/account_cutoff_start_end_dates/models/account_cutoff.py @@ -38,6 +38,7 @@ def _get_default_source_journals(self): default=lambda self: self._get_default_source_journals(), readonly=True, states={"draft": [("readonly", False)]}, + check_company=True, ) forecast = fields.Boolean( readonly=True, @@ -96,7 +97,7 @@ def _prepare_date_cutoff_line(self, aml, mapping): "end_date": aml.end_date, "account_id": aml.account_id.id, "cutoff_account_id": cutoff_account_id, - "analytic_account_id": aml.analytic_account_id.id or False, + "analytic_distribution": aml.analytic_distribution, "total_days": total_days, "amount": -aml.balance, "currency_id": self.company_currency_id.id, @@ -180,7 +181,7 @@ def get_lines(self): mapping = self._get_mapping_dict() domain = [ ("journal_id", "in", self.source_journal_ids.ids), - ("display_type", "=", False), + ("display_type", "not in", ("line_note", "line_section")), ("company_id", "=", self.company_id.id), ("balance", "!=", 0), ] @@ -208,17 +209,3 @@ def get_lines(self): for aml in amls: line_obj.create(self._prepare_date_cutoff_line(aml, mapping)) return res - - -class AccountCutoffLine(models.Model): - _inherit = "account.cutoff.line" - - start_date = fields.Date(readonly=True) - end_date = fields.Date(readonly=True) - total_days = fields.Integer(readonly=True) - cutoff_days = fields.Integer( - readonly=True, - help="In regular mode, this is the number of days after the " - "cut-off date. In forecast mode, this is the number of days " - "between the start date and the end date.", - ) diff --git a/account_cutoff_start_end_dates/models/account_cutoff_line.py b/account_cutoff_start_end_dates/models/account_cutoff_line.py new file mode 100644 index 00000000000..73ebba375c7 --- /dev/null +++ b/account_cutoff_start_end_dates/models/account_cutoff_line.py @@ -0,0 +1,19 @@ +# Copyright 2016-2022 Akretion France +# @author: Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class AccountCutoffLine(models.Model): + _inherit = "account.cutoff.line" + + start_date = fields.Date(readonly=True) + end_date = fields.Date(readonly=True) + total_days = fields.Integer(readonly=True) + cutoff_days = fields.Integer( + readonly=True, + help="In regular mode, this is the number of days after the " + "cut-off date. In forecast mode, this is the number of days " + "between the start date and the end date.", + ) diff --git a/account_cutoff_start_end_dates/readme/CONTRIBUTORS.rst b/account_cutoff_start_end_dates/readme/CONTRIBUTORS.rst index 91f99c0b864..6f95cf77696 100644 --- a/account_cutoff_start_end_dates/readme/CONTRIBUTORS.rst +++ b/account_cutoff_start_end_dates/readme/CONTRIBUTORS.rst @@ -1,3 +1,5 @@ * Alexis de Lattre * Stéphane Bidoul * Jim Hoefnagels +* `Trobz `_: + * Dzung Tran diff --git a/account_cutoff_start_end_dates/readme/CREDITS.rst b/account_cutoff_start_end_dates/readme/CREDITS.rst new file mode 100644 index 00000000000..70bc307ad0b --- /dev/null +++ b/account_cutoff_start_end_dates/readme/CREDITS.rst @@ -0,0 +1 @@ +The migration of this module from 15.0 to 16.0 was financially supported by Camptocamp diff --git a/account_cutoff_start_end_dates/static/description/index.html b/account_cutoff_start_end_dates/static/description/index.html index 4761e9f8bf9..1b5ff709614 100644 --- a/account_cutoff_start_end_dates/static/description/index.html +++ b/account_cutoff_start_end_dates/static/description/index.html @@ -3,7 +3,7 @@ - + Account Cut-off Start End Dates