Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
9505eb4
mis_builder_operating_unit migrated to v9
SerpentCS Oct 4, 2016
9031406
mis_builder_operating_unit 10.0
sbidoul May 4, 2017
a16485b
mis_builder_operating_unit record rule
sbidoul May 4, 2017
b7f8d16
mis_builder_operating_unit: OU filter in columns
sbidoul Mar 11, 2018
26e6d71
mis_builder_operating_unit: cosmetics
sbidoul Mar 11, 2018
94beca4
mis_builder_operating_unit: restore accidentally deleted view
sbidoul Mar 19, 2018
3f55c85
mis_builder_operating_unit: add a sudo in filter
sbidoul Mar 20, 2018
7cb6be7
add readme to mis_builder_operating_unit
AaronHForgeFlow Jun 11, 2018
aa56b9e
mis_builder_operating_unit: Migration to v11
bjeficent Feb 6, 2019
f1a2d52
mis_builder_account_operating_unit: Migration to 12.0
MiquelRForgeFlow Nov 22, 2019
f86879f
Update mis_builder_operating_unit.pot
oca-travis Apr 1, 2020
0854fae
README.rst
OCA-git-bot Apr 1, 2020
67a9802
Added translation using Weblate (Danish)
hhgabelgaard Apr 16, 2020
d6ccbda
Translated using Weblate (Danish)
hhgabelgaard Apr 16, 2020
d7e922c
mis_builder_operating_unit: black, isort, prettier
hbrunn Sep 22, 2020
d1e7401
mis_builder_operating_unit: Migration to 13.0
hbrunn Sep 22, 2020
0187414
mis_builder_operating_unit: tests
hbrunn Sep 22, 2020
c5e5ed8
mis_builder_operating_unit: black, isort, prettier
kittiu May 11, 2021
f86ac34
mis_builder_operating_unit
kittiu May 11, 2021
6ab5582
Update mis_builder_operating_unit.pot
oca-travis Dec 2, 2021
231f6af
README.rst
OCA-git-bot Dec 2, 2021
b473670
Added translation using Weblate (Italian)
francesco-ooops Dec 16, 2021
261c139
Translated using Weblate (Italian)
francesco-ooops Dec 16, 2021
d75db80
Translated using Weblate (Italian)
francesco-ooops Dec 20, 2021
e39d784
[MIG] Migrated mis_builder_operating_unit in v15
Rajan-SCS Jan 31, 2022
1d9372a
[UPD] Update mis_builder_operating_unit.pot
May 26, 2023
2e4be22
[UPD] README.rst
OCA-git-bot May 26, 2023
60c35a3
Translated using Weblate (Italian)
mymage Jun 7, 2023
0a03c82
[UPD] README.rst
OCA-git-bot Sep 3, 2023
6623a28
Update translation files
weblate Oct 9, 2023
53d1328
Translated using Weblate (Italian)
mymage Jan 19, 2024
84695f4
Translated using Weblate (Italian)
mymage Mar 22, 2024
17592d8
[13.0][IMP][mis_builder_operating_unit] Add the possibility to filter…
robyf70 Feb 28, 2024
8c57ed0
[UPD] Update mis_builder_operating_unit.pot
Aug 26, 2024
8e9a05b
[BOT] post-merge updates
OCA-git-bot Aug 26, 2024
babd438
Update translation files
weblate Aug 26, 2024
d017461
[IMP] : pre-commit auto fixes
solomonprabu May 12, 2026
6423045
[UPDATE] Migration changes to xml in invisible and readonly attributes
solomonprabu May 12, 2026
2b48849
[ADD] added file count check, to avoid singleton error and small impr…
solomonprabu May 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions mis_builder_operating_unit/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
===============================
MIS Builder with Operating Unit
===============================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:c8ada1ac3e9fb55193d31022fda527d98e679fe9f3fce114e4092722bb6a91e4
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/18.0/mis_builder_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-18-0/operating-unit-18-0-mis_builder_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=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

Introduces the operating unit to MIS Builder report instances.

**Table of contents**

.. contents::
:local:

Usage
=====

Set the operating unit in a MIS Builder instance.

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:%20mis_builder_operating_unit%0Aversion:%2018.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
-------

* ForgeFlow
* Serpent Consulting Services Pvt. Ltd.
* ACSONE SA/NV
* CIT Services

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

- Stéphane Bidoul <stephane.bidoul@acsone.eu>
- Kitti U. <kittiu@ecosoft.co.th> (migration to v14)

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/18.0/mis_builder_operating_unit>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions mis_builder_operating_unit/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).

from . import model
21 changes: 21 additions & 0 deletions mis_builder_operating_unit/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2015-19 ForgeFlow S.L. -
# Jordi Ballester Alomar
# © 2015-19 Serpent Consulting Services Pvt. Ltd. - Sudhir Arya
# © 2026 CIT Services
# License AGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).

{
"name": "MIS Builder with Operating Unit",
"version": "18.0.0.1.0",
"category": "Reporting",
"author": "ForgeFlow, "
"Serpent Consulting Services Pvt. Ltd.,"
"ACSONE SA/NV,"
"CIT Services,"
"Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "https://github.com/OCA/operating-unit",
"depends": ["mis_builder", "account_operating_unit"],
"data": ["security/mis_builder_security.xml", "view/mis_builder.xml"],
"installable": True,
}
39 changes: 39 additions & 0 deletions mis_builder_operating_unit/i18n/da.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mis_builder_operating_unit
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2020-04-16 13:23+0000\n"
"Last-Translator: Hans Henrik Gabelgaard <hhg@gabelgaard.org>\n"
"Language-Team: none\n"
"Language: da\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 3.10\n"

#. module: mis_builder_operating_unit
#: model:ir.model.fields,field_description:mis_builder_operating_unit.field_mis_report_instance__has_no_operating_unit
#: model:ir.model.fields,field_description:mis_builder_operating_unit.field_mis_report_instance_period__has_no_operating_unit
msgid "Has No Operating Unit"
msgstr ""

#. module: mis_builder_operating_unit
#: model:ir.model,name:mis_builder_operating_unit.model_mis_report_instance
msgid "MIS Report Instance"
msgstr "MIS Rapport Instans"

#. module: mis_builder_operating_unit
#: model:ir.model,name:mis_builder_operating_unit.model_mis_report_instance_period
msgid "MIS Report Instance Period"
msgstr "MIS Rapport instans periode"

#. module: mis_builder_operating_unit
#: model:ir.model.fields,field_description:mis_builder_operating_unit.field_mis_report_instance__operating_unit_ids
#: model:ir.model.fields,field_description:mis_builder_operating_unit.field_mis_report_instance_period__operating_unit_ids
msgid "Operating Unit"
msgstr "Driftsenhed"
48 changes: 48 additions & 0 deletions mis_builder_operating_unit/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mis_builder_operating_unit
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-03-22 10:34+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
"Language-Team: none\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.17\n"

#. module: mis_builder_operating_unit
#: model:ir.model.fields,field_description:mis_builder_operating_unit.field_mis_report_instance__has_no_operating_unit
#: model:ir.model.fields,field_description:mis_builder_operating_unit.field_mis_report_instance_period__has_no_operating_unit
msgid "Has No Operating Unit"
msgstr ""

#. module: mis_builder_operating_unit
#: model:ir.model,name:mis_builder_operating_unit.model_mis_report_instance
msgid "MIS Report Instance"
msgstr "Istanza MIS Report"

#. module: mis_builder_operating_unit
#: model:ir.model,name:mis_builder_operating_unit.model_mis_report_instance_period
msgid "MIS Report Instance Period"
msgstr "Periodo istanza MIS Report"

#. module: mis_builder_operating_unit
#: model:ir.model.fields,field_description:mis_builder_operating_unit.field_mis_report_instance__operating_unit_ids
#: model:ir.model.fields,field_description:mis_builder_operating_unit.field_mis_report_instance_period__operating_unit_ids
msgid "Operating Unit"
msgstr "Unità operativa"

#~ msgid "Display Name"
#~ msgstr "Nome visualizzato"

#~ msgid "ID"
#~ msgstr "ID"

#~ msgid "Last Modified on"
#~ msgstr "Ultima modifica il"
36 changes: 36 additions & 0 deletions mis_builder_operating_unit/i18n/mis_builder_operating_unit.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mis_builder_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: mis_builder_operating_unit
#: model:ir.model.fields,field_description:mis_builder_operating_unit.field_mis_report_instance__has_no_operating_unit
#: model:ir.model.fields,field_description:mis_builder_operating_unit.field_mis_report_instance_period__has_no_operating_unit
msgid "Has No Operating Unit"
msgstr ""

#. module: mis_builder_operating_unit
#: model:ir.model,name:mis_builder_operating_unit.model_mis_report_instance
msgid "MIS Report Instance"
msgstr ""

#. module: mis_builder_operating_unit
#: model:ir.model,name:mis_builder_operating_unit.model_mis_report_instance_period
msgid "MIS Report Instance Period"
msgstr ""

#. module: mis_builder_operating_unit
#: model:ir.model.fields,field_description:mis_builder_operating_unit.field_mis_report_instance__operating_unit_ids
#: model:ir.model.fields,field_description:mis_builder_operating_unit.field_mis_report_instance_period__operating_unit_ids
msgid "Operating Unit"
msgstr ""
3 changes: 3 additions & 0 deletions mis_builder_operating_unit/model/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).

from . import mis_builder
70 changes: 70 additions & 0 deletions mis_builder_operating_unit/model/mis_builder.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Copyright 2015-19 ForgeFlow S.L. -
# Jordi Ballester Alomar
# Copyright 2015-19 Serpent Consulting Services Pvt. Ltd. - Sudhir Arya
# Copyright 2018-19 ACSONE SA/NV
# Copyright 2026-27 CIT Services - Solomon Prabu
# Copyright 2024 Level Prime Srl - Roberto Fichera
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from odoo import api, fields, models


class MisReportInstance(models.Model):
_inherit = "mis.report.instance"

operating_unit_ids = fields.Many2many(
comodel_name="operating.unit",
)

has_no_operating_unit = fields.Boolean()

@api.onchange("has_no_operating_unit")
def _onchange_has_no_operating_unit(self):
if self.has_no_operating_unit:
self.operating_unit_ids = False


class MisReportInstancePeriod(models.Model):
_inherit = "mis.report.instance.period"

operating_unit_ids = fields.Many2many(
comodel_name="operating.unit",
)

has_no_operating_unit = fields.Boolean()

@api.onchange("has_no_operating_unit")
def _onchange_has_no_operating_unit(self):
if self.has_no_operating_unit:
self.operating_unit_ids = False

def _get_additional_move_line_filter(self):
self.ensure_one()
aml_domain = super()._get_additional_move_line_filter()
# we need sudo because, imagine a user having access
# to operating unit A, viewing a report with 3 columns
# for OU A, B, C: in columns B and C, self.operating_unit_ids
# would be empty for him, and the query on a.m.l would be only
# restricted by the record rules (ie showing move lines
# for OU A only). So the report would display values
# for OU A in all 3 columns.
sudoself = self.sudo()

if sudoself.has_no_operating_unit:
aml_domain.append(("operating_unit_id", "=", False))
elif sudoself.report_instance_id.has_no_operating_unit:
aml_domain.append(("operating_unit_id", "=", False))
else:
if sudoself.report_instance_id.operating_unit_ids:
aml_domain.append(
(
"operating_unit_id",
"in",
sudoself.report_instance_id.operating_unit_ids.ids,
)
)
if sudoself.operating_unit_ids:
aml_domain.append(
("operating_unit_id", "in", sudoself.operating_unit_ids.ids)
)
return aml_domain
3 changes: 3 additions & 0 deletions mis_builder_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"
2 changes: 2 additions & 0 deletions mis_builder_operating_unit/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Stéphane Bidoul \<stephane.bidoul@acsone.eu\>
- Kitti U. \<kittiu@ecosoft.co.th\> (migration to v14)
1 change: 1 addition & 0 deletions mis_builder_operating_unit/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Introduces the operating unit to MIS Builder report instances.
1 change: 1 addition & 0 deletions mis_builder_operating_unit/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Set the operating unit in a MIS Builder instance.
19 changes: 19 additions & 0 deletions mis_builder_operating_unit/security/mis_builder_security.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!--Copyright 2015-19 ForgeFlow S.L. - -->
<!--Jordi Ballester Alomar-->
<!--Copyright 2015-19 Serpent Consulting Services Pvt. Ltd. - Sudhir Arya-->
<!--Copyright 2018-19 ACSONE SA/NV-->
<record id="ir_rule_mis_builder_allowed_operating_units" model="ir.rule">
<field name="model_id" ref="mis_builder.model_mis_report_instance" />
<field
name="domain_force"
>['|',('operating_unit_ids','=',False),('operating_unit_ids','in',[g.id for g in user.operating_unit_ids])]</field>
<field name="name">MIS Reports from allowed operating units</field>
<field name="global" eval="True" />
<field eval="1" name="perm_unlink" />
<field eval="1" name="perm_write" />
<field eval="1" name="perm_read" />
<field eval="1" name="perm_create" />
</record>
</odoo>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading