From 24f2d94f03c2a92513c8f722c1e36360611b9414 Mon Sep 17 00:00:00 2001 From: Vincent Van Rossem Date: Tue, 13 Jan 2026 15:28:57 +0100 Subject: [PATCH 1/2] [IMP] account_operating_unit: account.move::_default_operating_unit_id `account.move` should default on the journal's operating unit (if set) instead of the user's operating unit --- account_operating_unit/models/account_move.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/account_operating_unit/models/account_move.py b/account_operating_unit/models/account_move.py index 076eb30a6e..95c857cee2 100644 --- a/account_operating_unit/models/account_move.py +++ b/account_operating_unit/models/account_move.py @@ -116,10 +116,13 @@ class AccountMove(models.Model): @api.model def _default_operating_unit_id(self): + if journal_id := self._context.get("default_journal_id"): + journal = self.env["account.journal"].browse(journal_id) + if journal_ou := journal.operating_unit_id: + return journal_ou if ( - self._context.get("default_move_type", False) - and self._context.get("default_move_type") != "entry" - ): + move_type := self._context.get("default_move_type") + ) and move_type != "entry": return self.env["res.users"]._get_default_operating_unit() return False From e5c4088075d76fcc4453cac7e12f37ad63949672 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Wed, 14 Jan 2026 14:31:17 +0000 Subject: [PATCH 2/2] [BOT] post-merge updates --- README.md | 2 +- account_operating_unit/README.rst | 2 +- account_operating_unit/__manifest__.py | 2 +- account_operating_unit/static/description/index.html | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3a0aeffce9..8523e47062 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Available addons ---------------- addon | version | maintainers | summary --- | --- | --- | --- -[account_operating_unit](account_operating_unit/) | 18.0.1.0.1 | | Introduces Operating Unit (OU) in invoices and Accounting Entries with clearing account +[account_operating_unit](account_operating_unit/) | 18.0.1.0.2 | | Introduces Operating Unit (OU) in invoices and Accounting Entries with clearing account [analytic_operating_unit](analytic_operating_unit/) | 18.0.1.0.0 | | Analytic Operating Unit [crm_operating_unit](crm_operating_unit/) | 18.0.1.0.0 | | Operating Unit in CRM [mrp_operating_unit](mrp_operating_unit/) | 18.0.1.0.0 | | Operating Unit in MRP diff --git a/account_operating_unit/README.rst b/account_operating_unit/README.rst index 0ec7095ae7..3d40fdf4a7 100644 --- a/account_operating_unit/README.rst +++ b/account_operating_unit/README.rst @@ -11,7 +11,7 @@ Accounting with Operating Units !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:0eb4a10dd13a9c7cd234be254acda3395c49bbf3b03de94f05155aa85ce1c1e6 + !! source digest: sha256:f67af3ef777984d732f2f86a3427eff701e20aae8a4a46e6e678901964338596 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/account_operating_unit/__manifest__.py b/account_operating_unit/__manifest__.py index 8b97c328e8..7247e48924 100644 --- a/account_operating_unit/__manifest__.py +++ b/account_operating_unit/__manifest__.py @@ -5,7 +5,7 @@ "name": "Accounting with Operating Units", "summary": "Introduces Operating Unit (OU) in invoices and " "Accounting Entries with clearing account", - "version": "18.0.1.0.1", + "version": "18.0.1.0.2", "author": "ForgeFlow, " "Serpent Consulting Services Pvt. Ltd.," "WilldooIT Pty Ltd," diff --git a/account_operating_unit/static/description/index.html b/account_operating_unit/static/description/index.html index 7ca7043e5b..910c95f078 100644 --- a/account_operating_unit/static/description/index.html +++ b/account_operating_unit/static/description/index.html @@ -372,7 +372,7 @@

Accounting with Operating Units

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:0eb4a10dd13a9c7cd234be254acda3395c49bbf3b03de94f05155aa85ce1c1e6 +!! source digest: sha256:f67af3ef777984d732f2f86a3427eff701e20aae8a4a46e6e678901964338596 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

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

This module allows a company to manage the accounting based on Operating