Skip to content

Commit ecaba2f

Browse files
committed
[MIG] mis_builder_operating_unit: Migration from 15.0 to 18.0
1 parent babd438 commit ecaba2f

14 files changed

Lines changed: 222 additions & 45 deletions

File tree

mis_builder_operating_unit/README.rst

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ MIS Builder with Operating Unit
1717
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1818
:alt: License: AGPL-3
1919
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Foperating--unit-lightgray.png?logo=github
20-
:target: https://github.com/OCA/operating-unit/tree/15.0/mis_builder_operating_unit
20+
:target: https://github.com/OCA/operating-unit/tree/18.0/mis_builder_operating_unit
2121
:alt: OCA/operating-unit
2222
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23-
:target: https://translation.odoo-community.org/projects/operating-unit-15-0/operating-unit-15-0-mis_builder_operating_unit
23+
:target: https://translation.odoo-community.org/projects/operating-unit-18-0/operating-unit-18-0-mis_builder_operating_unit
2424
:alt: Translate me on Weblate
2525
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26-
:target: https://runboat.odoo-community.org/builds?repo=OCA/operating-unit&target_branch=15.0
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/operating-unit&target_branch=18.0
2727
:alt: Try me on Runboat
2828

2929
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -46,28 +46,29 @@ Bug Tracker
4646
Bugs are tracked on `GitHub Issues <https://github.com/OCA/operating-unit/issues>`_.
4747
In case of trouble, please check there if your issue has already been reported.
4848
If you spotted it first, help us to smash it by providing a detailed and welcomed
49-
`feedback <https://github.com/OCA/operating-unit/issues/new?body=module:%20mis_builder_operating_unit%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
49+
`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**>`_.
5050

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

5353
Credits
5454
=======
5555

5656
Authors
57-
~~~~~~~
57+
-------
5858

5959
* ForgeFlow
6060
* Serpent Consulting Services Pvt. Ltd.
6161
* ACSONE SA/NV
62+
* CIT Services
6263

6364
Contributors
64-
~~~~~~~~~~~~
65+
------------
6566

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

6970
Maintainers
70-
~~~~~~~~~~~
71+
-----------
7172

7273
This module is maintained by the OCA.
7374

@@ -79,6 +80,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
7980
mission is to support the collaborative development of Odoo features and
8081
promote its widespread use.
8182

82-
This module is part of the `OCA/operating-unit <https://github.com/OCA/operating-unit/tree/15.0/mis_builder_operating_unit>`_ project on GitHub.
83+
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.
8384

8485
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
22

3-
from . import model
3+
from . import models

mis_builder_operating_unit/__manifest__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
# Copyright 2015-19 ForgeFlow S.L. -
22
# Jordi Ballester Alomar
33
# © 2015-19 Serpent Consulting Services Pvt. Ltd. - Sudhir Arya
4+
# © 2026 CIT Services
45
# License AGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
56

67
{
78
"name": "MIS Builder with Operating Unit",
8-
"version": "15.0.1.1.0",
9+
"version": "18.0.0.1.0",
910
"category": "Reporting",
1011
"author": "ForgeFlow, "
1112
"Serpent Consulting Services Pvt. Ltd.,"
1213
"ACSONE SA/NV,"
14+
"CIT Services,"
1315
"Odoo Community Association (OCA)",
1416
"license": "AGPL-3",
1517
"website": "https://github.com/OCA/operating-unit",
File renamed without changes.

mis_builder_operating_unit/model/mis_builder.py renamed to mis_builder_operating_unit/models/mis_builder.py

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,45 @@
22
# Jordi Ballester Alomar
33
# Copyright 2015-19 Serpent Consulting Services Pvt. Ltd. - Sudhir Arya
44
# Copyright 2018-19 ACSONE SA/NV
5+
# Copyright 2026 CIT Services - Solomon Prabu
56
# Copyright 2024 Level Prime Srl - Roberto Fichera
67
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
78

89
from odoo import api, fields, models
910

1011

1112
class MisReportInstance(models.Model):
12-
1313
_inherit = "mis.report.instance"
1414

1515
operating_unit_ids = fields.Many2many(
16-
"operating.unit",
16+
comodel_name="operating.unit",
1717
)
1818

1919
has_no_operating_unit = fields.Boolean()
2020

2121
@api.onchange("has_no_operating_unit")
22-
def onchange_has_no_operating_unit(self):
22+
def _onchange_has_no_operating_unit(self):
2323
if self.has_no_operating_unit:
2424
self.operating_unit_ids = False
2525

2626

2727
class MisReportInstancePeriod(models.Model):
28-
2928
_inherit = "mis.report.instance.period"
3029

3130
operating_unit_ids = fields.Many2many(
32-
"operating.unit",
31+
comodel_name="operating.unit",
3332
)
3433

3534
has_no_operating_unit = fields.Boolean()
3635

3736
@api.onchange("has_no_operating_unit")
38-
def onchange_has_no_operating_unit(self):
37+
def _onchange_has_no_operating_unit(self):
3938
if self.has_no_operating_unit:
4039
self.operating_unit_ids = False
4140

4241
def _get_additional_move_line_filter(self):
43-
aml_domain = super(
44-
MisReportInstancePeriod, self
45-
)._get_additional_move_line_filter()
42+
self.ensure_one()
43+
aml_domain = super()._get_additional_move_line_filter()
4644
# we need sudo because, imagine a user having access
4745
# to operating unit A, viewing a report with 3 columns
4846
# for OU A, B, C: in columns B and C, self.operating_unit_ids
@@ -53,21 +51,9 @@ def _get_additional_move_line_filter(self):
5351
sudoself = self.sudo()
5452

5553
if sudoself.has_no_operating_unit:
56-
aml_domain.append(
57-
(
58-
"operating_unit_id",
59-
"=",
60-
False,
61-
)
62-
)
54+
aml_domain.append(("operating_unit_id", "=", False))
6355
elif sudoself.report_instance_id.has_no_operating_unit:
64-
aml_domain.append(
65-
(
66-
"operating_unit_id",
67-
"=",
68-
False,
69-
)
70-
)
56+
aml_domain.append(("operating_unit_id", "=", False))
7157
else:
7258
if sudoself.report_instance_id.operating_unit_ids:
7359
aml_domain.append(
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["whool"]
3+
build-backend = "whool.buildapi"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- Stéphane Bidoul \<stephane.bidoul@acsone.eu\>
2+
- Kitti U. \<kittiu@ecosoft.co.th\> (migration to v14)

mis_builder_operating_unit/readme/CONTRIBUTORS.rst

Lines changed: 0 additions & 2 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)