diff --git a/account_financial_report_operating_unit/README.rst b/account_financial_report_operating_unit/README.rst new file mode 100644 index 0000000000..4cea492c99 --- /dev/null +++ b/account_financial_report_operating_unit/README.rst @@ -0,0 +1,79 @@ +========================================== +Accounting Fincnaial Report Operating Unit +========================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:80d5bfbe7975e098ed98cb9e4bd4eb363df2a871187f8e38cb097fba5104815d + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |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%2Foperating--unit-lightgray.png?logo=github + :target: https://github.com/OCA/operating-unit/tree/17.0/account_financial_report_operating_unit + :alt: OCA/operating-unit +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/operating-unit-17-0/operating-unit-17-0-account_financial_report_operating_unit + :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/operating-unit&target_branch=17.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module add filter by operating units for all reports. + +**Table of contents** + +.. contents:: + :local: + +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 to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Ecosoft + +Contributors +------------ + +- Kitti U. +- Aaron Henriquez +- Pimolnat Suntian +- Tran Thanh Trai + +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. + +This module is part of the `OCA/operating-unit `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_financial_report_operating_unit/__init__.py b/account_financial_report_operating_unit/__init__.py new file mode 100644 index 0000000000..055043b50e --- /dev/null +++ b/account_financial_report_operating_unit/__init__.py @@ -0,0 +1,5 @@ +# Copyright 2021 Ecosoft Co., Ltd. (http://ecosoft.co.th) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import report +from . import wizards diff --git a/account_financial_report_operating_unit/__manifest__.py b/account_financial_report_operating_unit/__manifest__.py new file mode 100644 index 0000000000..0c99e90bc9 --- /dev/null +++ b/account_financial_report_operating_unit/__manifest__.py @@ -0,0 +1,20 @@ +# Copyright 2021 Ecosoft Co., Ltd. (http://ecosoft.co.th) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +{ + "name": "Accounting Fincnaial Report Operating Unit", + "summary": "Introduces Operating Unit (OU) in financial reports", + "version": "17.0.1.0.0", + "author": "Ecosoft, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/operating-unit", + "category": "Accounting & Finance", + "depends": ["account_financial_report", "account_operating_unit"], + "license": "AGPL-3", + "data": [ + "wizards/aged_partner_balance_wizard_view.xml", + "wizards/general_ledger_wizard_view.xml", + "wizards/journal_ledger_wizard_view.xml", + "wizards/open_items_wizard_view.xml", + "wizards/trial_balance_wizard_view.xml", + "wizards/vat_report_wizard_view.xml", + ], +} diff --git a/account_financial_report_operating_unit/i18n/account_financial_report_operating_unit.pot b/account_financial_report_operating_unit/i18n/account_financial_report_operating_unit.pot new file mode 100644 index 0000000000..fba70e29ad --- /dev/null +++ b/account_financial_report_operating_unit/i18n/account_financial_report_operating_unit.pot @@ -0,0 +1,94 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_financial_report_operating_unit +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.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_operating_unit +#: model:ir.model,name:account_financial_report_operating_unit.model_report_account_financial_report_aged_partner_balance +msgid "Aged Partner Balance Report" +msgstr "" + +#. module: account_financial_report_operating_unit +#: model:ir.model,name:account_financial_report_operating_unit.model_aged_partner_balance_report_wizard +msgid "Aged Partner Balance Wizard" +msgstr "" + +#. module: account_financial_report_operating_unit +#: model:ir.model,name:account_financial_report_operating_unit.model_report_account_financial_report_general_ledger +msgid "General Ledger Report" +msgstr "" + +#. module: account_financial_report_operating_unit +#: model:ir.model,name:account_financial_report_operating_unit.model_general_ledger_report_wizard +msgid "General Ledger Report Wizard" +msgstr "" + +#. module: account_financial_report_operating_unit +#: model:ir.model,name:account_financial_report_operating_unit.model_report_account_financial_report_journal_ledger +msgid "Journal Ledger Report" +msgstr "" + +#. module: account_financial_report_operating_unit +#: model:ir.model,name:account_financial_report_operating_unit.model_journal_ledger_report_wizard +msgid "Journal Ledger Report Wizard" +msgstr "" + +#. module: account_financial_report_operating_unit +#: model:ir.model,name:account_financial_report_operating_unit.model_report_account_financial_report_open_items +msgid "Open Items Report" +msgstr "" + +#. module: account_financial_report_operating_unit +#: model:ir.model,name:account_financial_report_operating_unit.model_open_items_report_wizard +msgid "Open Items Report Wizard" +msgstr "" + +#. module: account_financial_report_operating_unit +#: model:ir.model.fields,field_description:account_financial_report_operating_unit.field_aged_partner_balance_report_wizard__operating_unit_ids +#: model:ir.model.fields,field_description:account_financial_report_operating_unit.field_general_ledger_report_wizard__operating_unit_ids +#: model:ir.model.fields,field_description:account_financial_report_operating_unit.field_journal_ledger_report_wizard__operating_unit_ids +#: model:ir.model.fields,field_description:account_financial_report_operating_unit.field_open_items_report_wizard__operating_unit_ids +#: model:ir.model.fields,field_description:account_financial_report_operating_unit.field_trial_balance_report_wizard__operating_unit_ids +#: model:ir.model.fields,field_description:account_financial_report_operating_unit.field_vat_report_wizard__operating_unit_ids +msgid "Operating Unit" +msgstr "" + +#. module: account_financial_report_operating_unit +#: model_terms:ir.ui.view,arch_db:account_financial_report_operating_unit.general_ledger_wizard +msgid "Operating Units" +msgstr "" + +#. module: account_financial_report_operating_unit +#: model_terms:ir.ui.view,arch_db:account_financial_report_operating_unit.journal_ledger_wizard +msgid "Operating units" +msgstr "" + +#. module: account_financial_report_operating_unit +#: model:ir.model,name:account_financial_report_operating_unit.model_report_account_financial_report_trial_balance +msgid "Trial Balance Report" +msgstr "" + +#. module: account_financial_report_operating_unit +#: model:ir.model,name:account_financial_report_operating_unit.model_trial_balance_report_wizard +msgid "Trial Balance Report Wizard" +msgstr "" + +#. module: account_financial_report_operating_unit +#: model:ir.model,name:account_financial_report_operating_unit.model_vat_report_wizard +msgid "VAT Report Wizard" +msgstr "" + +#. module: account_financial_report_operating_unit +#: model:ir.model,name:account_financial_report_operating_unit.model_report_account_financial_report_vat_report +msgid "Vat Report Report" +msgstr "" diff --git a/account_financial_report_operating_unit/pyproject.toml b/account_financial_report_operating_unit/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/account_financial_report_operating_unit/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/account_financial_report_operating_unit/readme/CONTRIBUTORS.md b/account_financial_report_operating_unit/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..8041d781da --- /dev/null +++ b/account_financial_report_operating_unit/readme/CONTRIBUTORS.md @@ -0,0 +1,4 @@ +- Kitti U. \<\> +- Aaron Henriquez \<\> +- Pimolnat Suntian \<\> +- Tran Thanh Trai \<\> \ No newline at end of file diff --git a/account_financial_report_operating_unit/readme/DESCRIPTION.md b/account_financial_report_operating_unit/readme/DESCRIPTION.md new file mode 100644 index 0000000000..8fba47d0c3 --- /dev/null +++ b/account_financial_report_operating_unit/readme/DESCRIPTION.md @@ -0,0 +1 @@ +This module add filter by operating units for all reports. diff --git a/account_financial_report_operating_unit/report/__init__.py b/account_financial_report_operating_unit/report/__init__.py new file mode 100644 index 0000000000..329a1ecbf3 --- /dev/null +++ b/account_financial_report_operating_unit/report/__init__.py @@ -0,0 +1,9 @@ +# Copyright 2021 Ecosoft Co., Ltd. (http://ecosoft.co.th) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import aged_partner_balance +from . import general_ledger +from . import journal_ledger +from . import open_items +from . import trial_balance +from . import vat_report diff --git a/account_financial_report_operating_unit/report/aged_partner_balance.py b/account_financial_report_operating_unit/report/aged_partner_balance.py new file mode 100644 index 0000000000..4577a2c7a1 --- /dev/null +++ b/account_financial_report_operating_unit/report/aged_partner_balance.py @@ -0,0 +1,24 @@ +# Copyright 2021 Ecosoft Co., Ltd. (http://ecosoft.co.th) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, models + + +class AgedPartnerBalanceReport(models.AbstractModel): + _inherit = "report.account_financial_report.aged_partner_balance" + + def _get_report_values(self, docids, data): + self = self.with_context(operating_unit_ids=data["operating_unit_ids"]) + return super()._get_report_values(docids, data) + + @api.model + def _get_move_lines_domain_not_reconciled( + self, company_id, account_ids, partner_ids, only_posted_moves, date_from + ): + domain = super()._get_move_lines_domain_not_reconciled( + company_id, account_ids, partner_ids, only_posted_moves, date_from + ) + operating_unit_ids = self.env.context.get("operating_unit_ids", []) + if operating_unit_ids: + domain.append(("operating_unit_id", "in", operating_unit_ids)) + return domain diff --git a/account_financial_report_operating_unit/report/general_ledger.py b/account_financial_report_operating_unit/report/general_ledger.py new file mode 100644 index 0000000000..d95bba9034 --- /dev/null +++ b/account_financial_report_operating_unit/report/general_ledger.py @@ -0,0 +1,70 @@ +# Copyright 2021 Ecosoft Co., Ltd. (http://ecosoft.co.th) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, models + + +class GeneralLedgerReport(models.AbstractModel): + _inherit = "report.account_financial_report.general_ledger" + + def _get_report_values(self, docids, data): + self = self.with_context(operating_unit_ids=data["operating_unit_ids"]) + return super()._get_report_values(docids, data) + + def _get_initial_balances_bs_ml_domain( + self, account_ids, company_id, date_from, base_domain, grouped_by, acc_prt=False + ): + domain = super()._get_initial_balances_bs_ml_domain( + account_ids, company_id, date_from, base_domain, grouped_by, acc_prt=acc_prt + ) + operating_unit_ids = self.env.context.get("operating_unit_ids", []) + if operating_unit_ids: + domain.append(("operating_unit_id", "in", operating_unit_ids)) + return domain + + def _get_initial_balances_pl_ml_domain( + self, account_ids, company_id, date_from, fy_start_date, base_domain + ): + domain = super()._get_initial_balances_pl_ml_domain( + account_ids, company_id, date_from, fy_start_date, base_domain + ) + operating_unit_ids = self.env.context.get("operating_unit_ids", []) + if operating_unit_ids: + domain.append(("operating_unit_id", "in", operating_unit_ids)) + return domain + + def _get_initial_balance_fy_pl_ml_domain( + self, account_ids, company_id, fy_start_date, base_domain + ): + domain = super()._get_initial_balance_fy_pl_ml_domain( + account_ids, company_id, fy_start_date, base_domain + ) + operating_unit_ids = self.env.context.get("operating_unit_ids", []) + if operating_unit_ids: + domain.append(("operating_unit_id", "in", operating_unit_ids)) + return domain + + @api.model + def _get_period_domain( + self, + account_ids, + partner_ids, + company_id, + only_posted_moves, + date_to, + date_from, + cost_center_ids, + ): + domain = super()._get_period_domain( + account_ids, + partner_ids, + company_id, + only_posted_moves, + date_to, + date_from, + cost_center_ids, + ) + operating_unit_ids = self.env.context.get("operating_unit_ids", []) + if operating_unit_ids: + domain.append(("operating_unit_id", "in", operating_unit_ids)) + return domain diff --git a/account_financial_report_operating_unit/report/journal_ledger.py b/account_financial_report_operating_unit/report/journal_ledger.py new file mode 100644 index 0000000000..2aeafd6659 --- /dev/null +++ b/account_financial_report_operating_unit/report/journal_ledger.py @@ -0,0 +1,19 @@ +# Copyright 2021 Ecosoft Co., Ltd. (http://ecosoft.co.th) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models + + +class JournalLedgerReport(models.AbstractModel): + _inherit = "report.account_financial_report.journal_ledger" + + def _get_report_values(self, docids, data): + self = self.with_context(operating_unit_ids=data["operating_unit_ids"]) + return super()._get_report_values(docids, data) + + def _get_move_lines_domain(self, move_ids, wizard, journal_ids): + domain = super()._get_move_lines_domain(move_ids, wizard, journal_ids) + operating_unit_ids = self.env.context.get("operating_unit_ids", []) + if operating_unit_ids: + domain.append(("operating_unit_id", "in", operating_unit_ids)) + return domain diff --git a/account_financial_report_operating_unit/report/open_items.py b/account_financial_report_operating_unit/report/open_items.py new file mode 100644 index 0000000000..7e0bb343b7 --- /dev/null +++ b/account_financial_report_operating_unit/report/open_items.py @@ -0,0 +1,36 @@ +# Copyright 2021 Ecosoft Co., Ltd. (http://ecosoft.co.th) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, models + + +class OpenItemsReport(models.AbstractModel): + _inherit = "report.account_financial_report.open_items" + + def _get_report_values(self, docids, data): + self = self.with_context(operating_unit_ids=data["operating_unit_ids"]) + return super()._get_report_values(docids, data) + + @api.model + def _get_move_lines_domain_not_reconciled( + self, company_id, account_ids, partner_ids, only_posted_moves, date_from + ): + domain = super()._get_move_lines_domain_not_reconciled( + company_id, account_ids, partner_ids, only_posted_moves, date_from + ) + operating_unit_ids = self.env.context.get("operating_unit_ids", []) + if operating_unit_ids: + domain.append(("operating_unit_id", "in", operating_unit_ids)) + return domain + + @api.model + def _get_new_move_lines_domain( + self, new_ml_ids, account_ids, company_id, partner_ids, only_posted_moves + ): + domain = super()._get_new_move_lines_domain( + new_ml_ids, account_ids, company_id, partner_ids, only_posted_moves + ) + operating_unit_ids = self.env.context.get("operating_unit_ids", []) + if operating_unit_ids: + domain.append(("operating_unit_id", "in", operating_unit_ids)) + return domain diff --git a/account_financial_report_operating_unit/report/trial_balance.py b/account_financial_report_operating_unit/report/trial_balance.py new file mode 100644 index 0000000000..480d97c871 --- /dev/null +++ b/account_financial_report_operating_unit/report/trial_balance.py @@ -0,0 +1,88 @@ +# Copyright 2021 Ecosoft Co., Ltd. (http://ecosoft.co.th) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models + + +class TrialBalanceReport(models.AbstractModel): + _inherit = "report.account_financial_report.trial_balance" + + def _get_report_values(self, docids, data): + self = self.with_context(operating_unit_ids=data["operating_unit_ids"]) + return super()._get_report_values(docids, data) + + def _get_initial_balances_bs_ml_domain( + self, + account_ids, + journal_ids, + partner_ids, + company_id, + date_from, + only_posted_moves, + show_partner_details, + ): + domain = super()._get_initial_balances_bs_ml_domain( + account_ids, + journal_ids, + partner_ids, + company_id, + date_from, + only_posted_moves, + show_partner_details, + ) + operating_unit_ids = self.env.context.get("operating_unit_ids", []) + if operating_unit_ids: + domain.append(("operating_unit_id", "in", operating_unit_ids)) + return domain + + def _get_initial_balances_pl_ml_domain( + self, + account_ids, + journal_ids, + partner_ids, + company_id, + date_from, + only_posted_moves, + show_partner_details, + fy_start_date, + ): + domain = super()._get_initial_balances_pl_ml_domain( + account_ids, + journal_ids, + partner_ids, + company_id, + date_from, + only_posted_moves, + show_partner_details, + fy_start_date, + ) + operating_unit_ids = self.env.context.get("operating_unit_ids", []) + if operating_unit_ids: + domain.append(("operating_unit_id", "in", operating_unit_ids)) + return domain + + def _get_period_ml_domain( + self, + account_ids, + journal_ids, + partner_ids, + company_id, + date_to, + date_from, + only_posted_moves, + show_partner_details, + ): + domain = super()._get_period_ml_domain( + account_ids, + journal_ids, + partner_ids, + company_id, + date_to, + date_from, + only_posted_moves, + show_partner_details, + ) + operating_unit_ids = self.env.context.get("operating_unit_ids", []) + if operating_unit_ids: + domain.append(("operating_unit_id", "in", operating_unit_ids)) + return domain diff --git a/account_financial_report_operating_unit/report/vat_report.py b/account_financial_report_operating_unit/report/vat_report.py new file mode 100644 index 0000000000..d200570031 --- /dev/null +++ b/account_financial_report_operating_unit/report/vat_report.py @@ -0,0 +1,32 @@ +# Copyright 2021 Ecosoft Co., Ltd. (http://ecosoft.co.th) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, models + + +class VATReport(models.AbstractModel): + _inherit = "report.account_financial_report.vat_report" + + def _get_report_values(self, docids, data): + self = self.with_context(operating_unit_ids=data["operating_unit_ids"]) + return super()._get_report_values(docids, data) + + @api.model + def _get_tax_report_domain(self, company_id, date_from, date_to, only_posted_moves): + domain = super()._get_tax_report_domain( + company_id, date_from, date_to, only_posted_moves + ) + operating_unit_ids = self.env.context.get("operating_unit_ids", []) + if operating_unit_ids: + domain.append(("operating_unit_id", "in", operating_unit_ids)) + return domain + + @api.model + def _get_net_report_domain(self, company_id, date_from, date_to, only_posted_moves): + domain = super()._get_net_report_domain( + company_id, date_from, date_to, only_posted_moves + ) + operating_unit_ids = self.env.context.get("operating_unit_ids", []) + if operating_unit_ids: + domain.append(("operating_unit_id", "in", operating_unit_ids)) + return domain diff --git a/account_financial_report_operating_unit/static/description/icon.png b/account_financial_report_operating_unit/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/account_financial_report_operating_unit/static/description/icon.png differ diff --git a/account_financial_report_operating_unit/static/description/index.html b/account_financial_report_operating_unit/static/description/index.html new file mode 100644 index 0000000000..0d112379ec --- /dev/null +++ b/account_financial_report_operating_unit/static/description/index.html @@ -0,0 +1,426 @@ + + + + + +Accounting Fincnaial Report Operating Unit + + + +
+

Accounting Fincnaial Report Operating Unit

+ + +

Beta License: AGPL-3 OCA/operating-unit Translate me on Weblate Try me on Runboat

+

This module add filter by operating units for all reports.

+

Table of contents

+ +
+

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 to smash it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Ecosoft
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

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.

+

This module is part of the OCA/operating-unit project on GitHub.

+

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

+
+
+
+ + diff --git a/account_financial_report_operating_unit/wizards/__init__.py b/account_financial_report_operating_unit/wizards/__init__.py new file mode 100644 index 0000000000..f356c6015e --- /dev/null +++ b/account_financial_report_operating_unit/wizards/__init__.py @@ -0,0 +1,9 @@ +# Copyright 2021 Ecosoft Co., Ltd. (http://ecosoft.co.th) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import aged_partner_balance_wizard +from . import general_ledger_wizard +from . import journal_ledger_wizard +from . import open_items_wizard +from . import trial_balance_wizard +from . import vat_report_wizard diff --git a/account_financial_report_operating_unit/wizards/aged_partner_balance_wizard.py b/account_financial_report_operating_unit/wizards/aged_partner_balance_wizard.py new file mode 100644 index 0000000000..23bf811afc --- /dev/null +++ b/account_financial_report_operating_unit/wizards/aged_partner_balance_wizard.py @@ -0,0 +1,17 @@ +# Copyright 2021 Ecosoft Co., Ltd. (http://ecosoft.co.th) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class AgedPartnerBalanceWizard(models.TransientModel): + _inherit = "aged.partner.balance.report.wizard" + + operating_unit_ids = fields.Many2many( + comodel_name="operating.unit", + ) + + def _prepare_report_aged_partner_balance(self): + res = super()._prepare_report_aged_partner_balance() + res.update({"operating_unit_ids": self.operating_unit_ids.ids or []}) + return res diff --git a/account_financial_report_operating_unit/wizards/aged_partner_balance_wizard_view.xml b/account_financial_report_operating_unit/wizards/aged_partner_balance_wizard_view.xml new file mode 100644 index 0000000000..59de2684f0 --- /dev/null +++ b/account_financial_report_operating_unit/wizards/aged_partner_balance_wizard_view.xml @@ -0,0 +1,25 @@ + + + + + Aged Partner Balance + aged.partner.balance.report.wizard + + + + + + + + + + + diff --git a/account_financial_report_operating_unit/wizards/general_ledger_wizard.py b/account_financial_report_operating_unit/wizards/general_ledger_wizard.py new file mode 100644 index 0000000000..80c53bc68c --- /dev/null +++ b/account_financial_report_operating_unit/wizards/general_ledger_wizard.py @@ -0,0 +1,17 @@ +# Copyright 2021 Ecosoft Co., Ltd. (http://ecosoft.co.th) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class GeneralLedgerReportWizard(models.TransientModel): + _inherit = "general.ledger.report.wizard" + + operating_unit_ids = fields.Many2many( + comodel_name="operating.unit", + ) + + def _prepare_report_general_ledger(self): + res = super()._prepare_report_general_ledger() + res.update({"operating_unit_ids": self.operating_unit_ids.ids or []}) + return res diff --git a/account_financial_report_operating_unit/wizards/general_ledger_wizard_view.xml b/account_financial_report_operating_unit/wizards/general_ledger_wizard_view.xml new file mode 100644 index 0000000000..7ecacfa52b --- /dev/null +++ b/account_financial_report_operating_unit/wizards/general_ledger_wizard_view.xml @@ -0,0 +1,25 @@ + + + + + General Ledger + general.ledger.report.wizard + + + + + + + + + + + + + diff --git a/account_financial_report_operating_unit/wizards/journal_ledger_wizard.py b/account_financial_report_operating_unit/wizards/journal_ledger_wizard.py new file mode 100644 index 0000000000..dac557e534 --- /dev/null +++ b/account_financial_report_operating_unit/wizards/journal_ledger_wizard.py @@ -0,0 +1,17 @@ +# Copyright 2021 Ecosoft Co., Ltd. (http://ecosoft.co.th) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class JournalLedgerReportWizard(models.TransientModel): + _inherit = "journal.ledger.report.wizard" + + operating_unit_ids = fields.Many2many( + comodel_name="operating.unit", + ) + + def _prepare_report_journal_ledger(self): + res = super()._prepare_report_journal_ledger() + res.update({"operating_unit_ids": self.operating_unit_ids.ids or []}) + return res diff --git a/account_financial_report_operating_unit/wizards/journal_ledger_wizard_view.xml b/account_financial_report_operating_unit/wizards/journal_ledger_wizard_view.xml new file mode 100644 index 0000000000..11cb4a7a51 --- /dev/null +++ b/account_financial_report_operating_unit/wizards/journal_ledger_wizard_view.xml @@ -0,0 +1,23 @@ + + + + + Journal Ledger + journal.ledger.report.wizard + + +
+ + + + +
+
+
+ +
diff --git a/account_financial_report_operating_unit/wizards/open_items_wizard.py b/account_financial_report_operating_unit/wizards/open_items_wizard.py new file mode 100644 index 0000000000..60f6bdbfb0 --- /dev/null +++ b/account_financial_report_operating_unit/wizards/open_items_wizard.py @@ -0,0 +1,17 @@ +# Copyright 2021 Ecosoft Co., Ltd. (http://ecosoft.co.th) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class OpenItemsReportWizard(models.TransientModel): + _inherit = "open.items.report.wizard" + + operating_unit_ids = fields.Many2many( + comodel_name="operating.unit", + ) + + def _prepare_report_open_items(self): + res = super()._prepare_report_open_items() + res.update({"operating_unit_ids": self.operating_unit_ids.ids or []}) + return res diff --git a/account_financial_report_operating_unit/wizards/open_items_wizard_view.xml b/account_financial_report_operating_unit/wizards/open_items_wizard_view.xml new file mode 100644 index 0000000000..e62d638757 --- /dev/null +++ b/account_financial_report_operating_unit/wizards/open_items_wizard_view.xml @@ -0,0 +1,22 @@ + + + + + Open Items + open.items.report.wizard + + + + + + + + + + + diff --git a/account_financial_report_operating_unit/wizards/trial_balance_wizard.py b/account_financial_report_operating_unit/wizards/trial_balance_wizard.py new file mode 100644 index 0000000000..3333cc56fb --- /dev/null +++ b/account_financial_report_operating_unit/wizards/trial_balance_wizard.py @@ -0,0 +1,17 @@ +# Copyright 2021 Ecosoft Co., Ltd. (http://ecosoft.co.th) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class TrialBalanceReportWizard(models.TransientModel): + _inherit = "trial.balance.report.wizard" + + operating_unit_ids = fields.Many2many( + comodel_name="operating.unit", + ) + + def _prepare_report_trial_balance(self): + res = super()._prepare_report_trial_balance() + res.update({"operating_unit_ids": self.operating_unit_ids.ids or []}) + return res diff --git a/account_financial_report_operating_unit/wizards/trial_balance_wizard_view.xml b/account_financial_report_operating_unit/wizards/trial_balance_wizard_view.xml new file mode 100644 index 0000000000..8f18db6659 --- /dev/null +++ b/account_financial_report_operating_unit/wizards/trial_balance_wizard_view.xml @@ -0,0 +1,22 @@ + + + + + Trial Balance + trial.balance.report.wizard + + + + + + + + + + + diff --git a/account_financial_report_operating_unit/wizards/vat_report_wizard.py b/account_financial_report_operating_unit/wizards/vat_report_wizard.py new file mode 100644 index 0000000000..19c4c08766 --- /dev/null +++ b/account_financial_report_operating_unit/wizards/vat_report_wizard.py @@ -0,0 +1,17 @@ +# Copyright 2021 Ecosoft Co., Ltd. (http://ecosoft.co.th) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class VATReportWizard(models.TransientModel): + _inherit = "vat.report.wizard" + + operating_unit_ids = fields.Many2many( + comodel_name="operating.unit", + ) + + def _prepare_vat_report(self): + res = super()._prepare_vat_report() + res.update({"operating_unit_ids": self.operating_unit_ids.ids or []}) + return res diff --git a/account_financial_report_operating_unit/wizards/vat_report_wizard_view.xml b/account_financial_report_operating_unit/wizards/vat_report_wizard_view.xml new file mode 100644 index 0000000000..9870a9916e --- /dev/null +++ b/account_financial_report_operating_unit/wizards/vat_report_wizard_view.xml @@ -0,0 +1,22 @@ + + + + + vat_report_wizard_view + vat.report.wizard + + + + + + + + + + +