diff --git a/operating_unit/README.rst b/operating_unit/README.rst index 5a6f01d368..5152aa9bd6 100644 --- a/operating_unit/README.rst +++ b/operating_unit/README.rst @@ -1,7 +1,3 @@ -.. image:: https://odoo-community.org/readme-banner-image - :target: https://odoo-community.org/get-involved?utm_source=readme - :alt: Odoo Community Association - ============== Operating Unit ============== @@ -17,7 +13,7 @@ Operating Unit .. |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/license-LGPL--3-blue.png +.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html :alt: License: LGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Foperating--unit-lightgray.png?logo=github @@ -92,6 +88,9 @@ Contributors * Jarsa Sistemas * Andrea Stirpe * Ooops, Ashish Hirpara +* `PyTech `_: + + * Simone Rubino Maintainers ~~~~~~~~~~~ diff --git a/operating_unit/__manifest__.py b/operating_unit/__manifest__.py index ce4a60a876..90703dd4a6 100644 --- a/operating_unit/__manifest__.py +++ b/operating_unit/__manifest__.py @@ -6,7 +6,7 @@ "name": "Operating Unit", "summary": "An operating unit (OU) is an organizational entity part of a " "company", - "version": "14.0.1.2.1", + "version": "14.0.1.3.0", "author": "ForgeFlow, " "Serpent Consulting Services Pvt. Ltd.," "Odoo Community Association (OCA)", diff --git a/operating_unit/migrations/14.0.1.3.0/post-migration.py b/operating_unit/migrations/14.0.1.3.0/post-migration.py new file mode 100644 index 0000000000..21bb9e6788 --- /dev/null +++ b/operating_unit/migrations/14.0.1.3.0/post-migration.py @@ -0,0 +1,14 @@ +# Copyright 2025 Simone Rubino - PyTech +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). + +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.convert_to_company_dependent( + env, + "res.users", + openupgrade.get_legacy_name("default_operating_unit_id"), + "default_operating_unit_id", + ) diff --git a/operating_unit/migrations/14.0.1.3.0/pre-migration.py b/operating_unit/migrations/14.0.1.3.0/pre-migration.py new file mode 100644 index 0000000000..c392453dd1 --- /dev/null +++ b/operating_unit/migrations/14.0.1.3.0/pre-migration.py @@ -0,0 +1,17 @@ +# Copyright 2025 Simone Rubino - PyTech +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). + +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + # Save the value that will be restored as company-dependent + openupgrade.rename_columns( + env.cr, + { + "res_users": [ + ("default_operating_unit_id", None), + ], + }, + ) diff --git a/operating_unit/models/res_users.py b/operating_unit/models/res_users.py index 0d6256658c..aae7a24383 100644 --- a/operating_unit/models/res_users.py +++ b/operating_unit/models/res_users.py @@ -60,6 +60,7 @@ def _default_operating_units(self): string="Default Operating Unit", default=lambda self: self._default_operating_unit(), domain="[('company_id', '=', current_company_id)]", + company_dependent=True, ) operating_unit_readonly = fields.Boolean(compute="_compute_operating_unit_readonly") diff --git a/operating_unit/readme/CONTRIBUTORS.rst b/operating_unit/readme/CONTRIBUTORS.rst index 2111fa508d..b439849634 100644 --- a/operating_unit/readme/CONTRIBUTORS.rst +++ b/operating_unit/readme/CONTRIBUTORS.rst @@ -4,3 +4,6 @@ * Jarsa Sistemas * Andrea Stirpe * Ooops, Ashish Hirpara +* `PyTech `_: + + * Simone Rubino diff --git a/operating_unit/static/description/index.html b/operating_unit/static/description/index.html index 782ecad4d3..387b9f3e25 100644 --- a/operating_unit/static/description/index.html +++ b/operating_unit/static/description/index.html @@ -3,7 +3,7 @@ -README.rst +Operating Unit -
+
+

Operating Unit

- - -Odoo Community Association - -
-

Operating Unit

-

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

+

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

An operating unit (OU) is an organizational entity part of a company, with separate management ownership. Management by OU is aimed to introduce the following features:

@@ -400,7 +395,7 @@

Operating Unit

-

Configuration

+

Configuration

To configure this module, you need to:

  • Assign Multi Operating Unit group to user.
  • @@ -408,12 +403,12 @@

    Configuration

-

Usage

+

Usage

This module defines the operating unit entity and the user’s security rules. Other modules extend the standard Odoo apps with the OU.

-

Bug Tracker

+

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 @@ -421,26 +416,30 @@

Bug Tracker

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

-

Credits

+

Credits

-

Authors

+

Authors

  • ForgeFlow
  • Serpent Consulting Services Pvt. Ltd.
-

Contributors

+

Contributors

-

Maintainers

+

Maintainers

This module is maintained by the OCA.

Odoo Community Association @@ -453,6 +452,5 @@

Maintainers

-