Skip to content

Commit

Permalink
Merge PR #686 into 17.0
Browse files Browse the repository at this point in the history
Signed-off-by AaronHForgeFlow
  • Loading branch information
OCA-git-bot committed Aug 6, 2024
2 parents adb5384 + 0eab7e1 commit 0e50c70
Show file tree
Hide file tree
Showing 29 changed files with 1,160 additions and 0 deletions.
79 changes: 79 additions & 0 deletions account_financial_report_operating_unit/README.rst
Original file line number Diff line number Diff line change
@@ -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 <https://github.com/OCA/operating-unit/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/operating-unit/issues/new?body=module:%20account_financial_report_operating_unit%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
-------

* Ecosoft

Contributors
------------

- Kitti U. <[email protected]>
- Aaron Henriquez <[email protected]>
- Pimolnat Suntian <[email protected]>
- Tran Thanh Trai <[email protected]>

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 <https://github.com/OCA/operating-unit/tree/17.0/account_financial_report_operating_unit>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
5 changes: 5 additions & 0 deletions account_financial_report_operating_unit/__init__.py
Original file line number Diff line number Diff line change
@@ -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
20 changes: 20 additions & 0 deletions account_financial_report_operating_unit/__manifest__.py
Original file line number Diff line number Diff line change
@@ -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",
],
}
Original file line number Diff line number Diff line change
@@ -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 ""
3 changes: 3 additions & 0 deletions account_financial_report_operating_unit/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- Kitti U. \<<[email protected]>\>
- Aaron Henriquez \<<[email protected]>\>
- Pimolnat Suntian \<<[email protected]>\>
- Tran Thanh Trai \<<[email protected]>\>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module add filter by operating units for all reports.
9 changes: 9 additions & 0 deletions account_financial_report_operating_unit/report/__init__.py
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
70 changes: 70 additions & 0 deletions account_financial_report_operating_unit/report/general_ledger.py
Original file line number Diff line number Diff line change
@@ -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
19 changes: 19 additions & 0 deletions account_financial_report_operating_unit/report/journal_ledger.py
Original file line number Diff line number Diff line change
@@ -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
36 changes: 36 additions & 0 deletions account_financial_report_operating_unit/report/open_items.py
Original file line number Diff line number Diff line change
@@ -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
Loading

0 comments on commit 0e50c70

Please sign in to comment.