diff --git a/README.md b/README.md index f43fe32713..a4bcf561b5 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Available addons ---------------- addon | version | maintainers | summary --- | --- | --- | --- -[account_operating_unit](account_operating_unit/) | 19.0.1.0.0 | | Introduces Operating Unit (OU) in invoices and Accounting Entries with clearing account +[account_operating_unit](account_operating_unit/) | 19.0.1.0.1 | | Introduces Operating Unit (OU) in invoices and Accounting Entries with clearing account [analytic_operating_unit](analytic_operating_unit/) | 19.0.1.0.0 | | Analytic Operating Unit [crm_operating_unit](crm_operating_unit/) | 19.0.1.0.0 | | Operating Unit in CRM [operating_unit](operating_unit/) | 19.0.1.0.0 | | An operating unit (OU) is an organizational entity part of a company diff --git a/account_operating_unit/README.rst b/account_operating_unit/README.rst index ee22dbdf96..c0707b1780 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:dc98b2ffc709e9af252a3738e8343719015d978580eb0a3b594ef976c9f3772b + !! source digest: sha256:c0ac83c731919c405df260caa28076036054b6f9145e9819b7700f6038b97fdc !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |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 e53f3a9ab9..fca251d0bd 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": "19.0.1.0.0", + "version": "19.0.1.0.1", "author": "ForgeFlow, " "Serpent Consulting Services Pvt. Ltd.," "WilldooIT Pty Ltd," diff --git a/account_operating_unit/models/account_move.py b/account_operating_unit/models/account_move.py index a6fdeb6e9b..309c4b1e63 100644 --- a/account_operating_unit/models/account_move.py +++ b/account_operating_unit/models/account_move.py @@ -117,6 +117,10 @@ class AccountMove(models.Model): @api.model def _default_operating_unit_id(self): + if journal_id := self.env.context.get("default_journal_id"): + journal = self.env["account.journal"].browse(journal_id) + if journal_ou := journal.operating_unit_id: + return journal_ou if ( default_type := self.env.context.get("default_move_type") ) and default_type != "entry": diff --git a/account_operating_unit/static/description/index.html b/account_operating_unit/static/description/index.html index 4ffa9eef3f..f5f839c188 100644 --- a/account_operating_unit/static/description/index.html +++ b/account_operating_unit/static/description/index.html @@ -372,7 +372,7 @@
This module allows a company to manage the accounting based on Operating