diff --git a/README.md b/README.md index ee05c5306b..50520400f9 100644 --- a/README.md +++ b/README.md @@ -23,10 +23,12 @@ addon | version | maintainers | summary --- | --- | --- | --- [account_operating_unit](account_operating_unit/) | 16.0.1.0.0 | | Introduces Operating Unit (OU) in invoices and Accounting Entries with clearing account [analytic_operating_unit](analytic_operating_unit/) | 16.0.1.0.0 | | Analytic Operating Unit +[contract_operating_unit](contract_operating_unit/) | 16.0.1.0.0 | | Contract Operating Unit [hr_operating_unit](hr_operating_unit/) | 16.0.1.0.0 | | HR Operating Unit [operating_unit](operating_unit/) | 16.0.1.0.2 | | An operating unit (OU) is an organizational entity part of a company [product_operating_unit](product_operating_unit/) | 16.0.1.0.1 | | Adds the concept of operating unit (OU) in products [project_operating_unit](project_operating_unit/) | 16.0.1.0.0 | [![max3903](https://github.com/max3903.png?size=30px)](https://github.com/max3903) | This module adds operating unit information to projects and tasks. +[report_qweb_operating_unit](report_qweb_operating_unit/) | 16.0.1.0.0 | | Qweb Report With Operating Unit [sales_team_operating_unit](sales_team_operating_unit/) | 16.0.1.0.0 | | Sales Team Operating Unit [stock_operating_unit](stock_operating_unit/) | 16.0.1.2.1 | | Adds the concept of operating unit (OU) in stock management diff --git a/account_operating_unit/i18n/de.po b/account_operating_unit/i18n/de.po new file mode 100644 index 0000000000..bc76b573cf --- /dev/null +++ b/account_operating_unit/i18n/de.po @@ -0,0 +1,180 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_operating_unit +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-09-20 17:06+0000\n" +"Last-Translator: Bastian Günther \n" +"Language-Team: none\n" +"Language: de\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 5.6.2\n" + +#. module: account_operating_unit +#: model:ir.model.fields,help:account_operating_unit.field_res_company__ou_is_self_balanced +msgid "" +"Activate if your company is required to generate a balanced balance sheet " +"for each operating unit." +msgstr "" + +#. module: account_operating_unit +#: model:ir.model,name:account_operating_unit.model_account_bank_statement_line +msgid "Bank Statement Line" +msgstr "Kontoauszugszeile" + +#. module: account_operating_unit +#: model:ir.model,name:account_operating_unit.model_res_company +msgid "Companies" +msgstr "Unternehmen" + +#. module: account_operating_unit +#. odoo-python +#: code:addons/account_operating_unit/models/account_journal.py:0 +#, python-format +msgid "" +"Configuration error. If defined as self-balanced at company level, the " +"operating unit is mandatory in bank journal." +msgstr "" + +#. module: account_operating_unit +#. odoo-python +#: code:addons/account_operating_unit/models/res_company.py:0 +#, python-format +msgid "" +"Configuration error. Please provide an Inter-operating unit clearing " +"account." +msgstr "" + +#. module: account_operating_unit +#. odoo-python +#: code:addons/account_operating_unit/models/account_move_line.py:0 +#, python-format +msgid "" +"Configuration error. The Company in the Move Line and in the Operating Unit " +"must be the same." +msgstr "" + +#. module: account_operating_unit +#. odoo-python +#: code:addons/account_operating_unit/models/account_move_line.py:0 +#, python-format +msgid "" +"Configuration error. The Operating Unit in the Move Line and in the Move " +"must be the same." +msgstr "" + +#. module: account_operating_unit +#. odoo-python +#: code:addons/account_operating_unit/models/account_move.py:0 +#, python-format +msgid "" +"Configuration error. The operating unit is mandatory for each line as the " +"operating unit has been defined as self-balanced at company level." +msgstr "" + +#. module: account_operating_unit +#. odoo-python +#: code:addons/account_operating_unit/models/account_move.py:0 +#, python-format +msgid "" +"Configuration error. You need to define aninter-operating unit clearing " +"account in the company settings" +msgstr "" + +#. module: account_operating_unit +#: model:ir.model.fields,field_description:account_operating_unit.field_res_company__inter_ou_clearing_account_id +msgid "Inter-operating unit clearing account" +msgstr "" + +#. module: account_operating_unit +#: model:ir.model,name:account_operating_unit.model_account_invoice_report +msgid "Invoices Statistics" +msgstr "Rechnungsstatistik" + +#. module: account_operating_unit +#: model:ir.model,name:account_operating_unit.model_account_journal +msgid "Journal" +msgstr "Journal" + +#. module: account_operating_unit +#: model:ir.model,name:account_operating_unit.model_account_move +msgid "Journal Entry" +msgstr "Journalbuchung" + +#. module: account_operating_unit +#: model:ir.model,name:account_operating_unit.model_account_move_line +msgid "Journal Item" +msgstr "Buchungszeile" + +#. module: account_operating_unit +#. odoo-python +#: code:addons/account_operating_unit/models/account_move.py:0 +#, python-format +msgid "OU-Balancing" +msgstr "Ausgleich Filiale" + +#. module: account_operating_unit +#: model:ir.model.fields,field_description:account_operating_unit.field_account_bank_statement_line__operating_unit_id +#: model:ir.model.fields,field_description:account_operating_unit.field_account_invoice_report__operating_unit_id +#: model:ir.model.fields,field_description:account_operating_unit.field_account_journal__operating_unit_id +#: model:ir.model.fields,field_description:account_operating_unit.field_account_move__operating_unit_id +#: model:ir.model.fields,field_description:account_operating_unit.field_account_move_line__operating_unit_id +#: model:ir.model.fields,field_description:account_operating_unit.field_account_payment__operating_unit_id +#: model_terms:ir.ui.view,arch_db:account_operating_unit.view_account_invoice_filter +#: model_terms:ir.ui.view,arch_db:account_operating_unit.view_account_invoice_report_search +#: model_terms:ir.ui.view,arch_db:account_operating_unit.view_account_move_line_filter +#: model_terms:ir.ui.view,arch_db:account_operating_unit.view_account_payment_search +msgid "Operating Unit" +msgstr "Filiale" + +#. module: account_operating_unit +#: model:ir.model.fields,help:account_operating_unit.field_account_journal__operating_unit_id +msgid "" +"Operating Unit that will be used in payments, when this journal is used." +msgstr "" + +#. module: account_operating_unit +#: model_terms:ir.ui.view,arch_db:account_operating_unit.view_company_form +msgid "Operating Units" +msgstr "Filialen" + +#. module: account_operating_unit +#: model:ir.model.fields,field_description:account_operating_unit.field_res_company__ou_is_self_balanced +msgid "Operating Units are self-balanced" +msgstr "Filialen sind selbstausgleichend" + +#. module: account_operating_unit +#: model:ir.model,name:account_operating_unit.model_account_partial_reconcile +msgid "Partial Reconcile" +msgstr "Teilweise abgestimmt" + +#. module: account_operating_unit +#: model:ir.model,name:account_operating_unit.model_account_payment +msgid "Payments" +msgstr "Zahlungen" + +#. module: account_operating_unit +#. odoo-python +#: code:addons/account_operating_unit/models/account_move.py:0 +#, python-format +msgid "The Company in the Move and in Operating Unit must be the same." +msgstr "" + +#. module: account_operating_unit +#. odoo-python +#: code:addons/account_operating_unit/models/account_move.py:0 +#, python-format +msgid "The OU in the Move and in Journal must be the same." +msgstr "" + +#. module: account_operating_unit +#: model:ir.model.fields,help:account_operating_unit.field_account_bank_statement_line__operating_unit_id +#: model:ir.model.fields,help:account_operating_unit.field_account_move__operating_unit_id +msgid "This operating unit will be defaulted in the move lines." +msgstr "" diff --git a/analytic_operating_unit/i18n/de.po b/analytic_operating_unit/i18n/de.po new file mode 100644 index 0000000000..dbf3a1fe54 --- /dev/null +++ b/analytic_operating_unit/i18n/de.po @@ -0,0 +1,27 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * analytic_operating_unit +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-09-18 12:06+0000\n" +"Last-Translator: Bastian Günther \n" +"Language-Team: none\n" +"Language: de\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 5.6.2\n" + +#. module: analytic_operating_unit +#: model:ir.model,name:analytic_operating_unit.model_account_analytic_account +msgid "Analytic Account" +msgstr "Kostenstelle" + +#. module: analytic_operating_unit +#: model:ir.model.fields,field_description:analytic_operating_unit.field_account_analytic_account__operating_unit_ids +msgid "Operating Units" +msgstr "Filialen" diff --git a/contract_operating_unit/README.rst b/contract_operating_unit/README.rst new file mode 100644 index 0000000000..062095fd34 --- /dev/null +++ b/contract_operating_unit/README.rst @@ -0,0 +1,87 @@ +======================= +Contract Operating Unit +======================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:1c11f793a7657cbdeb268f3485de5c22909c7df4bbd56759e423e293a8c2c7a3 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/16.0/contract_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-16-0/operating-unit-16-0-contract_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=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module introduces the following features: + +* Adds the Operating Unit (OU) to Contracts. + +* Security rules are defined to ensure that users can only see the Contracts of that Operating Units in which they are allowed access to. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +Assign contracts to specific operating units within the company + +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 +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* ForgeFlow S.L. + +Contributors +~~~~~~~~~~~~ + +* Aaron Henriquez +* Kitti U. +* Pimolnat Suntian + +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 `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/contract_operating_unit/__init__.py b/contract_operating_unit/__init__.py new file mode 100644 index 0000000000..4b76c7b2d5 --- /dev/null +++ b/contract_operating_unit/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from . import models diff --git a/contract_operating_unit/__manifest__.py b/contract_operating_unit/__manifest__.py new file mode 100644 index 0000000000..69a75d1808 --- /dev/null +++ b/contract_operating_unit/__manifest__.py @@ -0,0 +1,14 @@ +# Copyright 2020 ForgeFlow S.L. +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +{ + "name": "Contract Operating Unit", + "version": "16.0.1.0.0", + "license": "AGPL-3", + "author": "ForgeFlow S.L., Odoo Community Association (OCA)", + "website": "https://github.com/OCA/operating-unit", + "category": "Invoicing", + "depends": ["contract", "account_operating_unit"], + "data": ["views/contract_view.xml", "security/contract_security.xml"], + "installable": True, +} diff --git a/contract_operating_unit/i18n/contract_operating_unit.pot b/contract_operating_unit/i18n/contract_operating_unit.pot new file mode 100644 index 0000000000..960adf7e91 --- /dev/null +++ b/contract_operating_unit/i18n/contract_operating_unit.pot @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contract_operating_unit +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.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: contract_operating_unit +#: model:ir.model,name:contract_operating_unit.model_contract_contract +msgid "Contract" +msgstr "" + +#. module: contract_operating_unit +#: model:ir.model.fields,field_description:contract_operating_unit.field_contract_contract__operating_unit_id +#: model_terms:ir.ui.view,arch_db:contract_operating_unit.contract_contract_search_view +msgid "Operating Unit" +msgstr "" diff --git a/contract_operating_unit/i18n/de.po b/contract_operating_unit/i18n/de.po new file mode 100644 index 0000000000..c0c70c8a77 --- /dev/null +++ b/contract_operating_unit/i18n/de.po @@ -0,0 +1,28 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contract_operating_unit +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-09-18 12:06+0000\n" +"Last-Translator: Bastian Günther \n" +"Language-Team: none\n" +"Language: de\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 5.6.2\n" + +#. module: contract_operating_unit +#: model:ir.model,name:contract_operating_unit.model_contract_contract +msgid "Contract" +msgstr "Vertrag" + +#. module: contract_operating_unit +#: model:ir.model.fields,field_description:contract_operating_unit.field_contract_contract__operating_unit_id +#: model_terms:ir.ui.view,arch_db:contract_operating_unit.contract_contract_search_view +msgid "Operating Unit" +msgstr "Filiale" diff --git a/contract_operating_unit/i18n/it.po b/contract_operating_unit/i18n/it.po new file mode 100644 index 0000000000..2aefac1b43 --- /dev/null +++ b/contract_operating_unit/i18n/it.po @@ -0,0 +1,28 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contract_operating_unit +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-08-29 10:43+0000\n" +"Last-Translator: mymage \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 5.6.2\n" + +#. module: contract_operating_unit +#: model:ir.model,name:contract_operating_unit.model_contract_contract +msgid "Contract" +msgstr "Contatto" + +#. module: contract_operating_unit +#: model:ir.model.fields,field_description:contract_operating_unit.field_contract_contract__operating_unit_id +#: model_terms:ir.ui.view,arch_db:contract_operating_unit.contract_contract_search_view +msgid "Operating Unit" +msgstr "Unità operativa" diff --git a/contract_operating_unit/models/__init__.py b/contract_operating_unit/models/__init__.py new file mode 100644 index 0000000000..99a5468ac8 --- /dev/null +++ b/contract_operating_unit/models/__init__.py @@ -0,0 +1 @@ +from . import contract diff --git a/contract_operating_unit/models/contract.py b/contract_operating_unit/models/contract.py new file mode 100644 index 0000000000..4626a3d9ab --- /dev/null +++ b/contract_operating_unit/models/contract.py @@ -0,0 +1,21 @@ +# Copyright 2020 ForgeFlow S.L. +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class ContractContract(models.Model): + + _inherit = "contract.contract" + + operating_unit_id = fields.Many2one( + "operating.unit", + "Operating Unit", + default=lambda self: self.env["res.users"].operating_unit_default_get(), + ) + + def _prepare_invoice(self, date_invoice, journal=None): + invoice_vals = super()._prepare_invoice(date_invoice, journal=journal) + if self.operating_unit_id: + invoice_vals["operating_unit_id"] = self.operating_unit_id.id + return invoice_vals diff --git a/contract_operating_unit/readme/CONTRIBUTORS.rst b/contract_operating_unit/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..59af30aacf --- /dev/null +++ b/contract_operating_unit/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* Aaron Henriquez +* Kitti U. +* Pimolnat Suntian diff --git a/contract_operating_unit/readme/DESCRIPTION.rst b/contract_operating_unit/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..79e7fde55f --- /dev/null +++ b/contract_operating_unit/readme/DESCRIPTION.rst @@ -0,0 +1,5 @@ +This module introduces the following features: + +* Adds the Operating Unit (OU) to Contracts. + +* Security rules are defined to ensure that users can only see the Contracts of that Operating Units in which they are allowed access to. diff --git a/contract_operating_unit/readme/USAGE.rst b/contract_operating_unit/readme/USAGE.rst new file mode 100644 index 0000000000..f4c95c254e --- /dev/null +++ b/contract_operating_unit/readme/USAGE.rst @@ -0,0 +1 @@ +Assign contracts to specific operating units within the company diff --git a/contract_operating_unit/security/contract_security.xml b/contract_operating_unit/security/contract_security.xml new file mode 100644 index 0000000000..69858dcec6 --- /dev/null +++ b/contract_operating_unit/security/contract_security.xml @@ -0,0 +1,17 @@ + + + + + + ['|',('operating_unit_id','=',False),('operating_unit_id','in',[g.id for g in user.operating_unit_ids])] + Contracts from allowed operating units + + + + + + + + diff --git a/contract_operating_unit/static/description/icon.png b/contract_operating_unit/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/contract_operating_unit/static/description/icon.png differ diff --git a/contract_operating_unit/static/description/index.html b/contract_operating_unit/static/description/index.html new file mode 100644 index 0000000000..37af476e02 --- /dev/null +++ b/contract_operating_unit/static/description/index.html @@ -0,0 +1,434 @@ + + + + + +Contract Operating Unit + + + +
+

Contract Operating Unit

+ + +

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

+

This module introduces the following features:

+
    +
  • Adds the Operating Unit (OU) to Contracts.
  • +
  • Security rules are defined to ensure that users can only see the Contracts of that Operating Units in which they are allowed access to.
  • +
+

Table of contents

+ +
+

Usage

+

Assign contracts to specific operating units within the company

+
+
+

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 +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • ForgeFlow S.L.
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

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 project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/contract_operating_unit/tests/__init__.py b/contract_operating_unit/tests/__init__.py new file mode 100644 index 0000000000..fdd2b1a354 --- /dev/null +++ b/contract_operating_unit/tests/__init__.py @@ -0,0 +1 @@ +from . import test_contract_operating_unit diff --git a/contract_operating_unit/tests/test_contract_operating_unit.py b/contract_operating_unit/tests/test_contract_operating_unit.py new file mode 100644 index 0000000000..918455afa6 --- /dev/null +++ b/contract_operating_unit/tests/test_contract_operating_unit.py @@ -0,0 +1,92 @@ +# Copyright 2020 ForgeFlow S.L. +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo.addons.contract.tests.test_contract import TestContractBase + + +class TestContractOperatingUnit(TestContractBase): + @classmethod + def setUpClass(cls): + super().setUpClass() + + cls.res_users_model = cls.env["res.users"] + + cls.company = cls.env.ref("base.main_company") + cls.grp_contract_manager = cls.env.ref("account.group_account_manager") + cls.contract_model = cls.env["contract.contract"] + cls.group_user = cls.env.ref("base.group_user") + + # Main Operating Unit + cls.ou1 = cls.env.ref("operating_unit.main_operating_unit") + # B2C Operating Unit + cls.b2c = cls.env.ref("operating_unit.b2c_operating_unit") + + # Create Users + cls.user1 = cls._create_user( + "User_1", + [cls.grp_contract_manager, cls.group_user], + cls.company, + [cls.ou1, cls.b2c], + ) + cls.user2 = cls._create_user( + "User_2", + [cls.grp_contract_manager, cls.group_user], + cls.company, + [cls.b2c], + ) + cls.contract.operating_unit_id = cls.ou1 + cls.contract2.operating_unit_id = cls.b2c + + @classmethod + def _create_user(cls, login, groups, company, operating_units, context=None): + """Creates a user.""" + group_ids = [group.id for group in groups] + user = cls.res_users_model.create( + { + "name": "Test Contract User", + "login": login, + "password": "demo", + "email": "example@yourcompany.com", + "company_id": company.id, + "company_ids": [(4, company.id)], + "operating_unit_ids": [(4, ou.id) for ou in operating_units], + "groups_id": [(6, 0, group_ids)], + } + ) + return user + + def test_contract_ou(self): + """Test Contract Operating Unit""" + # User 2 is only assigned to Operating Unit B2C, and cannot + # Access Contract records of Main Operating Unit. + record = self.contract_model.with_user(self.user2.id).search( + [ + ("id", "=", self.contract.id), + ("operating_unit_id", "=", self.ou1.id), + ] + ) + self.assertFalse( + record, + "User 2 should not have access to OU %s" % self.ou1.name, + ) + + def test_default(self): + """Test that the user's OU is used when creating a contract""" + contract = ( + self.env["contract.contract"] + .with_user(self.user1) + .create( + { + "name": "A contract", + "partner_id": self.env["res.partner"] + .search([], order="customer_rank desc", limit=1) + .id, + } + ) + ) + self.assertEqual(contract.operating_unit_id, self.ou1) + + def test_contract_invoice(self): + """Test that invoices from contracts get the contract's OU assigned""" + invoice = self.contract2._recurring_create_invoice() + self.assertEqual(invoice.operating_unit_id, self.b2c) diff --git a/contract_operating_unit/views/contract_view.xml b/contract_operating_unit/views/contract_view.xml new file mode 100644 index 0000000000..13a4715059 --- /dev/null +++ b/contract_operating_unit/views/contract_view.xml @@ -0,0 +1,81 @@ + + + + + + contract.contract form view (in contract_payment_mode) + contract.contract + + + + + + + + + + + contract.contract tree view (in contract_payment_mode) + contract.contract + + + + + + + + + + + contract.contract search view (in contract_payment_mode) + contract.contract + + + + + + + + + + + + + + + contract.contract supplier form view (in contract_payment_mode) + contract.contract + 18 + + + + + + + + + diff --git a/hr_operating_unit/i18n/de.po b/hr_operating_unit/i18n/de.po new file mode 100644 index 0000000000..79b8c4802a --- /dev/null +++ b/hr_operating_unit/i18n/de.po @@ -0,0 +1,47 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_operating_unit +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-09-18 12:06+0000\n" +"Last-Translator: Bastian Günther \n" +"Language-Team: none\n" +"Language: de\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 5.6.2\n" + +#. module: hr_operating_unit +#: model:ir.model,name:hr_operating_unit.model_hr_employee_base +msgid "Basic Employee" +msgstr "Basismitarbeiter" + +#. module: hr_operating_unit +#: model:ir.model.fields,field_description:hr_operating_unit.field_hr_employee__default_operating_unit_id +#: model:ir.model.fields,field_description:hr_operating_unit.field_hr_employee_base__default_operating_unit_id +#: model:ir.model.fields,field_description:hr_operating_unit.field_hr_employee_public__default_operating_unit_id +#: model_terms:ir.ui.view,arch_db:hr_operating_unit.view_employee_filter +msgid "Default Operating Unit" +msgstr "Standard-Filiale" + +#. module: hr_operating_unit +#: model:ir.model.fields,field_description:hr_operating_unit.field_operating_unit__employee_ids +msgid "Employees Allowed" +msgstr "Zulässige Mitarbeiter" + +#. module: hr_operating_unit +#: model:ir.model,name:hr_operating_unit.model_operating_unit +msgid "Operating Unit" +msgstr "Filiale" + +#. module: hr_operating_unit +#: model:ir.model.fields,field_description:hr_operating_unit.field_hr_employee__operating_unit_ids +#: model:ir.model.fields,field_description:hr_operating_unit.field_hr_employee_base__operating_unit_ids +#: model:ir.model.fields,field_description:hr_operating_unit.field_hr_employee_public__operating_unit_ids +msgid "Operating Units" +msgstr "Filialen" diff --git a/hr_operating_unit_access_all/README.rst b/hr_operating_unit_access_all/README.rst new file mode 100644 index 0000000000..0f5bd133f2 --- /dev/null +++ b/hr_operating_unit_access_all/README.rst @@ -0,0 +1,94 @@ +========================= +Access all OUs' Employees +========================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:1e0412e2b453542971defb93a05c2ed576a01af6553da9da59d3e6f6dc628eba + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/16.0/hr_operating_unit_access_all + :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-16-0/operating-unit-16-0-hr_operating_unit_access_all + :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=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allow a user to have access to all OUs' employees, +without having to add OUs in the user setting. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +To configure a user to have access to all OUs' employees (without all OUs access): + +* Go to *Settings / Users & Companies / Users* +* For a user, select checkbox "Access all OUs' Employees" + +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 +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Ecosoft + +Contributors +~~~~~~~~~~~~ + +* Pimolnat Suntian +* Nopparut S. + +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. + +.. |maintainer-ps-tubtim| image:: https://github.com/ps-tubtim.png?size=40px + :target: https://github.com/ps-tubtim + :alt: ps-tubtim + +Current `maintainer `__: + +|maintainer-ps-tubtim| + +This module is part of the `OCA/operating-unit `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/hr_operating_unit_access_all/__init__.py b/hr_operating_unit_access_all/__init__.py new file mode 100644 index 0000000000..c71289ab17 --- /dev/null +++ b/hr_operating_unit_access_all/__init__.py @@ -0,0 +1 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). diff --git a/hr_operating_unit_access_all/__manifest__.py b/hr_operating_unit_access_all/__manifest__.py new file mode 100644 index 0000000000..f734964dc7 --- /dev/null +++ b/hr_operating_unit_access_all/__manifest__.py @@ -0,0 +1,15 @@ +# Copyright 2021 Ecosoft Co., Ltd. (http://ecosoft.co.th) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + "name": "Access all OUs' Employees", + "version": "16.0.1.0.0", + "author": "Ecosoft, Odoo Community Association (OCA)", + "category": "Human Resources", + "license": "AGPL-3", + "website": "https://github.com/OCA/operating-unit", + "depends": ["hr_operating_unit"], + "data": ["security/hr_security.xml"], + "installable": True, + "maintainers": ["ps-tubtim"], +} diff --git a/hr_operating_unit_access_all/i18n/hr_operating_unit_access_all.pot b/hr_operating_unit_access_all/i18n/hr_operating_unit_access_all.pot new file mode 100644 index 0000000000..091a78563e --- /dev/null +++ b/hr_operating_unit_access_all/i18n/hr_operating_unit_access_all.pot @@ -0,0 +1,19 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_operating_unit_access_all +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.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: hr_operating_unit_access_all +#: model:res.groups,name:hr_operating_unit_access_all.group_all_ou_hr +msgid "Access all OUs' Employees" +msgstr "" diff --git a/hr_operating_unit_access_all/readme/CONFIGURE.rst b/hr_operating_unit_access_all/readme/CONFIGURE.rst new file mode 100644 index 0000000000..a63da0119d --- /dev/null +++ b/hr_operating_unit_access_all/readme/CONFIGURE.rst @@ -0,0 +1,4 @@ +To configure a user to have access to all OUs' employees (without all OUs access): + +* Go to *Settings / Users & Companies / Users* +* For a user, select checkbox "Access all OUs' Employees" diff --git a/hr_operating_unit_access_all/readme/CONTRIBUTORS.rst b/hr_operating_unit_access_all/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..74f45a1a55 --- /dev/null +++ b/hr_operating_unit_access_all/readme/CONTRIBUTORS.rst @@ -0,0 +1,2 @@ +* Pimolnat Suntian +* Nopparut S. diff --git a/hr_operating_unit_access_all/readme/DESCRIPTION.rst b/hr_operating_unit_access_all/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..cbb6bc6412 --- /dev/null +++ b/hr_operating_unit_access_all/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +This module allow a user to have access to all OUs' employees, +without having to add OUs in the user setting. diff --git a/hr_operating_unit_access_all/security/hr_security.xml b/hr_operating_unit_access_all/security/hr_security.xml new file mode 100644 index 0000000000..16f2586384 --- /dev/null +++ b/hr_operating_unit_access_all/security/hr_security.xml @@ -0,0 +1,16 @@ + + + + + Access all OUs' Employees + + + + + + + + + diff --git a/hr_operating_unit_access_all/static/description/icon.png b/hr_operating_unit_access_all/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/hr_operating_unit_access_all/static/description/icon.png differ diff --git a/hr_operating_unit_access_all/static/description/index.html b/hr_operating_unit_access_all/static/description/index.html new file mode 100644 index 0000000000..dfcd5709f0 --- /dev/null +++ b/hr_operating_unit_access_all/static/description/index.html @@ -0,0 +1,436 @@ + + + + + +Access all OUs' Employees + + + +
+

Access all OUs’ Employees

+ + +

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

+

This module allow a user to have access to all OUs’ employees, +without having to add OUs in the user setting.

+

Table of contents

+ +
+

Configuration

+

To configure a user to have access to all OUs’ employees (without all OUs access):

+
    +
  • Go to Settings / Users & Companies / Users
  • +
  • For a user, select checkbox “Access all OUs’ Employees”
  • +
+
+
+

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 +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Ecosoft
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

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.

+

Current maintainer:

+

ps-tubtim

+

This module is part of the OCA/operating-unit project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/operating_unit/i18n/de.po b/operating_unit/i18n/de.po new file mode 100644 index 0000000000..6fb2634a81 --- /dev/null +++ b/operating_unit/i18n/de.po @@ -0,0 +1,148 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * operating_unit +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-09-18 12:06+0000\n" +"Last-Translator: Bastian Günther \n" +"Language-Team: none\n" +"Language: de\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 5.6.2\n" + +#. module: operating_unit +#: model:ir.model.fields,field_description:operating_unit.field_operating_unit__active +msgid "Active" +msgstr "Aktiv" + +#. module: operating_unit +#: model:ir.model.fields,field_description:operating_unit.field_res_users__operating_unit_ids +msgid "Allowed Operating Units" +msgstr "Zulässige Filialen" + +#. module: operating_unit +#: model_terms:ir.actions.act_window,help:operating_unit.action_operating_unit_tree +msgid "Click to start a new Operating Unit." +msgstr "Klicken, um eine neue Filiale anzulegen." + +#. module: operating_unit +#: model:ir.model.fields,field_description:operating_unit.field_operating_unit__code +#: model_terms:ir.ui.view,arch_db:operating_unit.view_operating_unit_search +msgid "Code" +msgstr "Filialnummer" + +#. module: operating_unit +#: model:ir.model.fields,field_description:operating_unit.field_operating_unit__company_id +msgid "Company" +msgstr "Unternehmen" + +#. module: operating_unit +#: model:ir.model.fields,field_description:operating_unit.field_operating_unit__create_uid +msgid "Created by" +msgstr "Erstellt von" + +#. module: operating_unit +#: model:ir.model.fields,field_description:operating_unit.field_operating_unit__create_date +msgid "Created on" +msgstr "Erstellt am" + +#. module: operating_unit +#: model:ir.model.fields,field_description:operating_unit.field_res_users__default_operating_unit_id +msgid "Default Operating Unit" +msgstr "Standard-Filiale" + +#. module: operating_unit +#: model:ir.model.fields,field_description:operating_unit.field_operating_unit__display_name +msgid "Display Name" +msgstr "Anzeigename" + +#. module: operating_unit +#: model:ir.model.fields,field_description:operating_unit.field_operating_unit__id +msgid "ID" +msgstr "ID" + +#. module: operating_unit +#: model:ir.model.fields,field_description:operating_unit.field_operating_unit____last_update +msgid "Last Modified on" +msgstr "Zuletzt geändert am" + +#. module: operating_unit +#: model:ir.model.fields,field_description:operating_unit.field_operating_unit__write_uid +msgid "Last Updated by" +msgstr "Zuletzt aktualisiert von" + +#. module: operating_unit +#: model:ir.model.fields,field_description:operating_unit.field_operating_unit__write_date +msgid "Last Updated on" +msgstr "Zuletzt aktualisiert am" + +#. module: operating_unit +#: model:res.groups,name:operating_unit.group_manager_operating_unit +msgid "Manager of Operating Units" +msgstr "Manager von Filialen" + +#. module: operating_unit +#: model:res.groups,name:operating_unit.group_multi_operating_unit +msgid "Multiple Operating Unit" +msgstr "Mehrere Filialen" + +#. module: operating_unit +#: model:ir.model.fields,field_description:operating_unit.field_operating_unit__name +msgid "Name" +msgstr "Name" + +#. module: operating_unit +#: model:ir.model,name:operating_unit.model_operating_unit +#: model_terms:ir.ui.view,arch_db:operating_unit.view_operating_unit_form +#: model_terms:ir.ui.view,arch_db:operating_unit.view_operating_unit_search +msgid "Operating Unit" +msgstr "Filiale" + +#. module: operating_unit +#: model:ir.actions.act_window,name:operating_unit.action_operating_unit_tree +#: model:ir.model.fields,field_description:operating_unit.field_res_users__assigned_operating_unit_ids +#: model:ir.ui.menu,name:operating_unit.menu_action_operating_unit_tree +#: model_terms:ir.ui.view,arch_db:operating_unit.view_users_form +msgid "Operating Units" +msgstr "Filialen" + +#. module: operating_unit +#: model:ir.module.category,name:operating_unit.module_operating_units +msgid "Operating Units Group" +msgstr "Filialen" + +#. module: operating_unit +#: model:ir.model.fields,field_description:operating_unit.field_operating_unit__partner_id +msgid "Partner" +msgstr "Kontakt" + +#. module: operating_unit +#: model_terms:ir.ui.view,arch_db:operating_unit.view_operating_unit_search +msgid "Search Operating Unit" +msgstr "Suche Filialen" + +#. module: operating_unit +#: model:ir.model.constraint,message:operating_unit.constraint_operating_unit_code_company_uniq +msgid "The code of the operating unit must be unique per company!" +msgstr "Die Filialnummer einer Filiale muss pro Unternehmen eindeutig sein!" + +#. module: operating_unit +#: model:ir.model.constraint,message:operating_unit.constraint_operating_unit_name_company_uniq +msgid "The name of the operating unit must be unique per company!" +msgstr "Der Name einer Filiale muss pro Unternehmen eindeutig sein!" + +#. module: operating_unit +#: model:ir.model,name:operating_unit.model_res_users +msgid "User" +msgstr "Benutzer" + +#. module: operating_unit +#: model:ir.model.fields,field_description:operating_unit.field_operating_unit__user_ids +msgid "Users Allowed" +msgstr "Zulässige Benutzer" diff --git a/project_operating_unit/i18n/de.po b/project_operating_unit/i18n/de.po new file mode 100644 index 0000000000..8169077405 --- /dev/null +++ b/project_operating_unit/i18n/de.po @@ -0,0 +1,32 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * project_operating_unit +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: de\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" + +#. module: project_operating_unit +#: model:ir.model.fields,field_description:project_operating_unit.field_project_project__operating_unit_id +#: model:ir.model.fields,field_description:project_operating_unit.field_project_task__operating_unit_id +#: model_terms:ir.ui.view,arch_db:project_operating_unit.project_group_by_ou +msgid "Operating Unit" +msgstr "" + +#. module: project_operating_unit +#: model:ir.model,name:project_operating_unit.model_project_project +msgid "Project" +msgstr "" + +#. module: project_operating_unit +#: model:ir.model,name:project_operating_unit.model_project_task +msgid "Task" +msgstr "" diff --git a/report_qweb_operating_unit/README.rst b/report_qweb_operating_unit/README.rst new file mode 100644 index 0000000000..27b2a887cb --- /dev/null +++ b/report_qweb_operating_unit/README.rst @@ -0,0 +1,81 @@ +=============================== +Qweb Report With Operating Unit +=============================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:d2833f869026e1d9d22049e1610f1f91ec5a63ca0cb52b5934c6c66c29fe326d + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-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 + :target: https://github.com/OCA/operating-unit/tree/16.0/report_qweb_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-16-0/operating-unit-16-0-report_qweb_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=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows to use custom operating unit headers for any report +in Odoo + +**Table of contents** + +.. contents:: + :local: + +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 +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* ForgeFlow S.L. +* Serpent Consulting Services Pvt. Ltd. + +Contributors +------------ + +- ForgeFlow S.L. +- Serpent Consulting Services Pvt. Ltd. +- Jarsa Sistemas +- Juany Davila + +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 `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/report_qweb_operating_unit/__init__.py b/report_qweb_operating_unit/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/report_qweb_operating_unit/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/report_qweb_operating_unit/__manifest__.py b/report_qweb_operating_unit/__manifest__.py new file mode 100644 index 0000000000..dba1972fed --- /dev/null +++ b/report_qweb_operating_unit/__manifest__.py @@ -0,0 +1,17 @@ +# Copyright 2017 ForgeFlow S.L. +# Copyright 2017 Serpent Consulting Services Pvt. Ltd. +# License LGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +{ + "name": "Qweb Report With Operating Unit", + "version": "16.0.1.0.0", + "category": "Reports/Qweb", + "license": "LGPL-3", + "author": "ForgeFlow S.L., " + "Serpent Consulting Services Pvt. Ltd.," + "Odoo Community Association (OCA)", + "website": "https://github.com/OCA/operating-unit", + "depends": ["operating_unit"], + "data": ["views/operating_unit_view.xml", "views/report_qweb_operating_unit.xml"], + "installable": True, +} diff --git a/report_qweb_operating_unit/i18n/es_MX.po b/report_qweb_operating_unit/i18n/es_MX.po new file mode 100644 index 0000000000..a79792c2d3 --- /dev/null +++ b/report_qweb_operating_unit/i18n/es_MX.po @@ -0,0 +1,181 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * report_qweb_operating_unit +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2020-02-19 16:13+0000\n" +"Last-Translator: Jesús Alan Ramos Rodríguez \n" +"Language-Team: none\n" +"Language: es_MX\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: report_qweb_operating_unit +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_bold_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_boxed_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_standard_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_striped_ou +msgid "Operating Unit address block" +msgstr "" + +#. module: report_qweb_operating_unit +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_bold_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_boxed_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_standard_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_striped_ou +msgid "Operating unit details block" +msgstr "" + +#. module: report_qweb_operating_unit +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_bold_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_boxed_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_standard_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_striped_ou +msgid "Company tagline" +msgstr "" + +#. module: report_qweb_operating_unit +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_bold_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_boxed_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_standard_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_striped_ou +msgid "Contains the operating unit address." +msgstr "" + +#. module: report_qweb_operating_unit +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_bold_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_boxed_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_standard_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_striped_ou +msgid "Contains the operating unit details." +msgstr "" + +#. module: report_qweb_operating_unit +#: model:ir.model.fields,help:report_qweb_operating_unit.field_operating_unit__report_footer +msgid "Footer text displayed at the bottom of all reports." +msgstr "" + +#. module: report_qweb_operating_unit +#: model:ir.model.fields,help:report_qweb_operating_unit.field_operating_unit__operating_unit_details +msgid "Header text displayed at the top of all reports." +msgstr "" + +#. module: report_qweb_operating_unit +#: model:ir.model.fields,field_description:report_qweb_operating_unit.field_operating_unit__is_operating_unit_details_empty +msgid "Is Operating Unit Details Empty" +msgstr "" + +#. module: report_qweb_operating_unit +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_bold_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_boxed_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_standard_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_striped_ou +msgid "Logo" +msgstr "Logo" + +#. module: report_qweb_operating_unit +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_bold_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_boxed_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_striped_ou +msgid "" +"Operating\n" +" Unit tagline" +msgstr "" + +#. module: report_qweb_operating_unit +#: model:ir.model,name:report_qweb_operating_unit.model_operating_unit +msgid "Operating Unit" +msgstr "" + +#. module: report_qweb_operating_unit +#: model:ir.model.fields,field_description:report_qweb_operating_unit.field_operating_unit__operating_unit_details +msgid "Operating Unit Details" +msgstr "" + +#. module: report_qweb_operating_unit +#: model:ir.model.fields,field_description:report_qweb_operating_unit.field_operating_unit__report_header +msgid "Operating Unit Tagline" +msgstr "" + +#. module: report_qweb_operating_unit +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_standard_ou +msgid "Operating Unit tagline" +msgstr "" + +#. module: report_qweb_operating_unit +#: model:ir.model.fields,help:report_qweb_operating_unit.field_operating_unit__report_header +msgid "" +"Operating Unit tagline, which is included in a printed document's header or " +"footer (depending on the selected layout)." +msgstr "" + +#. module: report_qweb_operating_unit +#: model:ir.model.fields,field_description:report_qweb_operating_unit.field_operating_unit__report_footer +msgid "Report Footer" +msgstr "" + +#. module: report_qweb_operating_unit +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.view_operating_unit_form +msgid "Report Layout" +msgstr "" + +#. module: report_qweb_operating_unit +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_bold_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_boxed_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_standard_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_striped_ou +msgid "Tax ID" +msgstr "" + +#. module: report_qweb_operating_unit +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_bold_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_boxed_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_standard_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_striped_ou +msgid "US12345671" +msgstr "" + +#~ msgid "" +#~ "" +#~ msgstr "" +#~ "" + +#~ msgid "" +#~ "" +#~ msgstr "" + +#~ msgid "" +#~ "" +#~ msgstr "" +#~ "" + +#~ msgid "" +#~ "" +#~ msgstr "" +#~ "" + +#~ msgid "Email:" +#~ msgstr "Correo electrónico:" + +#~ msgid "Mail:" +#~ msgstr "Correo electrónico:" + +#~ msgid "Phone:" +#~ msgstr "Teléfono:" + +#~ msgid "Tel:" +#~ msgstr "Tel:" + +#~ msgid "Web:" +#~ msgstr "Web:" diff --git a/report_qweb_operating_unit/i18n/it.po b/report_qweb_operating_unit/i18n/it.po new file mode 100644 index 0000000000..40314ee626 --- /dev/null +++ b/report_qweb_operating_unit/i18n/it.po @@ -0,0 +1,146 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * report_qweb_operating_unit +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-08-31 12:06+0000\n" +"Last-Translator: mymage \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 5.6.2\n" + +#. module: report_qweb_operating_unit +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_bold_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_boxed_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_standard_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_striped_ou +msgid "Operating Unit address block" +msgstr "Blocco indirizzo unità operativa" + +#. module: report_qweb_operating_unit +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_bold_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_boxed_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_standard_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_striped_ou +msgid "Operating unit details block" +msgstr "Blocco dettagli unità operativa" + +#. module: report_qweb_operating_unit +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_bold_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_boxed_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_standard_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_striped_ou +msgid "Company tagline" +msgstr "Slogan azienda" + +#. module: report_qweb_operating_unit +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_bold_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_boxed_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_standard_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_striped_ou +msgid "Contains the operating unit address." +msgstr "Contiene l'indirizzo dell'unità operativa." + +#. module: report_qweb_operating_unit +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_bold_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_boxed_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_standard_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_striped_ou +msgid "Contains the operating unit details." +msgstr "Contiene i dettagli dell'unità operativa." + +#. module: report_qweb_operating_unit +#: model:ir.model.fields,help:report_qweb_operating_unit.field_operating_unit__report_footer +msgid "Footer text displayed at the bottom of all reports." +msgstr "Testo in calce visualizzato in fondo al resoconto." + +#. module: report_qweb_operating_unit +#: model:ir.model.fields,help:report_qweb_operating_unit.field_operating_unit__operating_unit_details +msgid "Header text displayed at the top of all reports." +msgstr "Testo testata visualizzato sulla sommità di ogni resoconto." + +#. module: report_qweb_operating_unit +#: model:ir.model.fields,field_description:report_qweb_operating_unit.field_operating_unit__is_operating_unit_details_empty +msgid "Is Operating Unit Details Empty" +msgstr "I dettagli dell'unità operativa sono vuoti" + +#. module: report_qweb_operating_unit +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_bold_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_boxed_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_standard_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_striped_ou +msgid "Logo" +msgstr "Logo" + +#. module: report_qweb_operating_unit +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_bold_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_boxed_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_striped_ou +msgid "" +"Operating\n" +" Unit tagline" +msgstr "" +"Slogan\n" +" unità operativa" + +#. module: report_qweb_operating_unit +#: model:ir.model,name:report_qweb_operating_unit.model_operating_unit +msgid "Operating Unit" +msgstr "Unità operativa" + +#. module: report_qweb_operating_unit +#: model:ir.model.fields,field_description:report_qweb_operating_unit.field_operating_unit__operating_unit_details +msgid "Operating Unit Details" +msgstr "Dettagli unità operativa" + +#. module: report_qweb_operating_unit +#: model:ir.model.fields,field_description:report_qweb_operating_unit.field_operating_unit__report_header +msgid "Operating Unit Tagline" +msgstr "Slogan unità operativa" + +#. module: report_qweb_operating_unit +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_standard_ou +msgid "Operating Unit tagline" +msgstr "Slogan unità operativa" + +#. module: report_qweb_operating_unit +#: model:ir.model.fields,help:report_qweb_operating_unit.field_operating_unit__report_header +msgid "" +"Operating Unit tagline, which is included in a printed document's header or " +"footer (depending on the selected layout)." +msgstr "" +"Slogan unità operativa, che è inclusa nella testata o a piè pagina del " +"documento stampato (in funzione del layout selezionato)." + +#. module: report_qweb_operating_unit +#: model:ir.model.fields,field_description:report_qweb_operating_unit.field_operating_unit__report_footer +msgid "Report Footer" +msgstr "Piè pagina resoconto" + +#. module: report_qweb_operating_unit +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.view_operating_unit_form +msgid "Report Layout" +msgstr "Layout resoconto" + +#. module: report_qweb_operating_unit +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_bold_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_boxed_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_standard_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_striped_ou +msgid "Tax ID" +msgstr "Partita IVA" + +#. module: report_qweb_operating_unit +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_bold_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_boxed_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_standard_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_striped_ou +msgid "US12345671" +msgstr "US12345671" diff --git a/report_qweb_operating_unit/i18n/report_qweb_operating_unit.pot b/report_qweb_operating_unit/i18n/report_qweb_operating_unit.pot new file mode 100644 index 0000000000..4cecfa05ef --- /dev/null +++ b/report_qweb_operating_unit/i18n/report_qweb_operating_unit.pot @@ -0,0 +1,139 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * report_qweb_operating_unit +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.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: report_qweb_operating_unit +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_bold_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_boxed_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_standard_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_striped_ou +msgid "Operating Unit address block" +msgstr "" + +#. module: report_qweb_operating_unit +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_bold_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_boxed_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_standard_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_striped_ou +msgid "Operating unit details block" +msgstr "" + +#. module: report_qweb_operating_unit +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_bold_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_boxed_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_standard_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_striped_ou +msgid "Company tagline" +msgstr "" + +#. module: report_qweb_operating_unit +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_bold_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_boxed_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_standard_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_striped_ou +msgid "Contains the operating unit address." +msgstr "" + +#. module: report_qweb_operating_unit +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_bold_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_boxed_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_standard_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_striped_ou +msgid "Contains the operating unit details." +msgstr "" + +#. module: report_qweb_operating_unit +#: model:ir.model.fields,help:report_qweb_operating_unit.field_operating_unit__report_footer +msgid "Footer text displayed at the bottom of all reports." +msgstr "" + +#. module: report_qweb_operating_unit +#: model:ir.model.fields,help:report_qweb_operating_unit.field_operating_unit__operating_unit_details +msgid "Header text displayed at the top of all reports." +msgstr "" + +#. module: report_qweb_operating_unit +#: model:ir.model.fields,field_description:report_qweb_operating_unit.field_operating_unit__is_operating_unit_details_empty +msgid "Is Operating Unit Details Empty" +msgstr "" + +#. module: report_qweb_operating_unit +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_bold_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_boxed_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_standard_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_striped_ou +msgid "Logo" +msgstr "" + +#. module: report_qweb_operating_unit +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_bold_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_boxed_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_striped_ou +msgid "" +"Operating\n" +" Unit tagline" +msgstr "" + +#. module: report_qweb_operating_unit +#: model:ir.model,name:report_qweb_operating_unit.model_operating_unit +msgid "Operating Unit" +msgstr "" + +#. module: report_qweb_operating_unit +#: model:ir.model.fields,field_description:report_qweb_operating_unit.field_operating_unit__operating_unit_details +msgid "Operating Unit Details" +msgstr "" + +#. module: report_qweb_operating_unit +#: model:ir.model.fields,field_description:report_qweb_operating_unit.field_operating_unit__report_header +msgid "Operating Unit Tagline" +msgstr "" + +#. module: report_qweb_operating_unit +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_standard_ou +msgid "Operating Unit tagline" +msgstr "" + +#. module: report_qweb_operating_unit +#: model:ir.model.fields,help:report_qweb_operating_unit.field_operating_unit__report_header +msgid "" +"Operating Unit tagline, which is included in a printed document's header or " +"footer (depending on the selected layout)." +msgstr "" + +#. module: report_qweb_operating_unit +#: model:ir.model.fields,field_description:report_qweb_operating_unit.field_operating_unit__report_footer +msgid "Report Footer" +msgstr "" + +#. module: report_qweb_operating_unit +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.view_operating_unit_form +msgid "Report Layout" +msgstr "" + +#. module: report_qweb_operating_unit +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_bold_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_boxed_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_standard_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_striped_ou +msgid "Tax ID" +msgstr "" + +#. module: report_qweb_operating_unit +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_bold_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_boxed_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_standard_ou +#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_striped_ou +msgid "US12345671" +msgstr "" diff --git a/report_qweb_operating_unit/models/__init__.py b/report_qweb_operating_unit/models/__init__.py new file mode 100644 index 0000000000..f5f887b83c --- /dev/null +++ b/report_qweb_operating_unit/models/__init__.py @@ -0,0 +1 @@ +from . import operating_unit diff --git a/report_qweb_operating_unit/models/operating_unit.py b/report_qweb_operating_unit/models/operating_unit.py new file mode 100644 index 0000000000..704e84a387 --- /dev/null +++ b/report_qweb_operating_unit/models/operating_unit.py @@ -0,0 +1,67 @@ +# Copyright 2024 NSI-SA +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). +from odoo import api, fields, models +from odoo.tools import html2plaintext + + +class OperatingUnit(models.Model): + _inherit = "operating.unit" + + report_header = fields.Html( + string="Operating Unit Tagline", + translate=True, + compute="_compute_report_header", + store=True, + readonly=False, + help="Operating Unit tagline, which is included " + "in a printed document's header or footer " + "(depending on the selected layout).", + ) + report_footer = fields.Html( + translate=True, + compute="_compute_report_footer", + store=True, + readonly=False, + help="Footer text displayed at the bottom of all reports.", + ) + operating_unit_details = fields.Html( + translate=True, + compute="_compute_operating_unit_details", + store=True, + readonly=False, + help="Header text displayed at the top of all reports.", + ) + is_operating_unit_details_empty = fields.Boolean( + compute="_compute_empty_operating_unit_details" + ) + + @api.depends("company_id") + def _compute_report_header(self): + for operating_unit in self: + if operating_unit.company_id: + operating_unit.report_header = operating_unit.company_id.report_header + + @api.depends("company_id") + def _compute_report_footer(self): + for operating_unit in self: + if operating_unit.company_id: + operating_unit.report_footer = operating_unit.company_id.report_footer + + @api.depends("company_id") + def _compute_operating_unit_details(self): + for operating_unit in self: + if operating_unit.company_id: + operating_unit.operating_unit_details = ( + operating_unit.company_id.company_details + ) + + @api.depends("operating_unit_details") + def _compute_empty_operating_unit_details(self): + # In recent change when an html field is + # empty a

balise remains with a
in it, + # but when operating unit details is empty + # we want to put the info of the operating unit + for operating_unit in self: + operating_unit.is_operating_unit_details_empty = not html2plaintext( + operating_unit.operating_unit_details or "" + ) diff --git a/report_qweb_operating_unit/pyproject.toml b/report_qweb_operating_unit/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/report_qweb_operating_unit/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/report_qweb_operating_unit/readme/CONTRIBUTORS.md b/report_qweb_operating_unit/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..0e9ebbf5b0 --- /dev/null +++ b/report_qweb_operating_unit/readme/CONTRIBUTORS.md @@ -0,0 +1,4 @@ +- ForgeFlow S.L. \<\> +- Serpent Consulting Services Pvt. Ltd. \<\> +- Jarsa Sistemas \<\> +- Juany Davila \<\> diff --git a/report_qweb_operating_unit/readme/DESCRIPTION.md b/report_qweb_operating_unit/readme/DESCRIPTION.md new file mode 100644 index 0000000000..76bb07bdad --- /dev/null +++ b/report_qweb_operating_unit/readme/DESCRIPTION.md @@ -0,0 +1,2 @@ +This module allows to use custom operating unit headers for any report +in Odoo diff --git a/report_qweb_operating_unit/static/description/icon.png b/report_qweb_operating_unit/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/report_qweb_operating_unit/static/description/icon.png differ diff --git a/report_qweb_operating_unit/static/description/index.html b/report_qweb_operating_unit/static/description/index.html new file mode 100644 index 0000000000..4858f7e954 --- /dev/null +++ b/report_qweb_operating_unit/static/description/index.html @@ -0,0 +1,428 @@ + + + + + +Qweb Report With Operating Unit + + + +

+

Qweb Report With Operating Unit

+ + +

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

+

This module allows to use custom operating unit headers for any report +in Odoo

+

Table of contents

+ +
+

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 +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • ForgeFlow S.L.
  • +
  • Serpent Consulting Services Pvt. Ltd.
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

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 project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/report_qweb_operating_unit/tests/__init__.py b/report_qweb_operating_unit/tests/__init__.py new file mode 100644 index 0000000000..580eccdc61 --- /dev/null +++ b/report_qweb_operating_unit/tests/__init__.py @@ -0,0 +1 @@ +from . import test_report_qweb_operating_unit diff --git a/report_qweb_operating_unit/tests/test_report_qweb_operating_unit.py b/report_qweb_operating_unit/tests/test_report_qweb_operating_unit.py new file mode 100644 index 0000000000..e70222b32c --- /dev/null +++ b/report_qweb_operating_unit/tests/test_report_qweb_operating_unit.py @@ -0,0 +1,41 @@ +from unittest.mock import MagicMock + +from odoo.tests.common import TransactionCase + + +class TestReportQwebOperatingUnit(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.ou = cls.env.ref("operating_unit.b2b_operating_unit") + cls.env.company.report_header = "Company report header" + cls.ou.report_header = "OU report header" + cls.mock_user = MagicMock(wraps=cls.env.user) + cls.mock_user.__contains__ = lambda self, other: True + cls.mock_user.operating_unit_id = cls.ou + + def test_rendering(self): + for layout in ("standard", "striped", "bold", "boxed"): + xmlid = "web.external_layout_%s" % layout + render_context = dict( + company=self.env.company, + o=self.env.user, + ) + html = ( + self.env["ir.actions.report"] + ._render_template( + xmlid, + render_context, + ) + .decode("utf8") + ) + self.assertIn(self.env.company.report_header, html) + html = ( + self.env["ir.actions.report"] + ._render_template( + xmlid, + dict(render_context, o=self.mock_user), + ) + .decode("utf8") + ) + self.assertIn(self.ou.report_header, html) diff --git a/report_qweb_operating_unit/views/operating_unit_view.xml b/report_qweb_operating_unit/views/operating_unit_view.xml new file mode 100644 index 0000000000..9705a532f3 --- /dev/null +++ b/report_qweb_operating_unit/views/operating_unit_view.xml @@ -0,0 +1,21 @@ + + + + operating.unit.form + operating.unit + + +
+ + + + + + + + + +
+
+
+
diff --git a/report_qweb_operating_unit/views/report_qweb_operating_unit.xml b/report_qweb_operating_unit/views/report_qweb_operating_unit.xml new file mode 100644 index 0000000000..e1e83a0f6d --- /dev/null +++ b/report_qweb_operating_unit/views/report_qweb_operating_unit.xml @@ -0,0 +1,389 @@ + + + + + + + + diff --git a/sales_team_operating_unit/i18n/de.po b/sales_team_operating_unit/i18n/de.po new file mode 100644 index 0000000000..4bb0a7b8df --- /dev/null +++ b/sales_team_operating_unit/i18n/de.po @@ -0,0 +1,38 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sales_team_operating_unit +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-09-20 17:06+0000\n" +"Last-Translator: Bastian Günther \n" +"Language-Team: none\n" +"Language: de\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 5.6.2\n" + +#. module: sales_team_operating_unit +#. odoo-python +#: code:addons/sales_team_operating_unit/models/crm_team.py:0 +#, python-format +msgid "" +"Configuration error, The Company in the Sales Team and in the Operating Unit" +" must be the same." +msgstr "" +"Konfigurationsfehler. Das Verkaufsteam und die Filiale müssen demselben " +"Unternehmen zugeordnet sein." + +#. module: sales_team_operating_unit +#: model:ir.model.fields,field_description:sales_team_operating_unit.field_crm_team__operating_unit_id +msgid "Operating Unit" +msgstr "Filiale" + +#. module: sales_team_operating_unit +#: model:ir.model,name:sales_team_operating_unit.model_crm_team +msgid "Sales Team" +msgstr "Verkaufsteam" diff --git a/setup/_metapackage/VERSION.txt b/setup/_metapackage/VERSION.txt index c5ceb64be8..2f41eec62a 100644 --- a/setup/_metapackage/VERSION.txt +++ b/setup/_metapackage/VERSION.txt @@ -1 +1 @@ -16.0.20240730.0 \ No newline at end of file +16.0.20240829.0 \ No newline at end of file diff --git a/setup/_metapackage/setup.py b/setup/_metapackage/setup.py index dfc0403c3c..116e60be5d 100644 --- a/setup/_metapackage/setup.py +++ b/setup/_metapackage/setup.py @@ -10,10 +10,12 @@ install_requires=[ 'odoo-addon-account_operating_unit>=16.0dev,<16.1dev', 'odoo-addon-analytic_operating_unit>=16.0dev,<16.1dev', + 'odoo-addon-contract_operating_unit>=16.0dev,<16.1dev', 'odoo-addon-hr_operating_unit>=16.0dev,<16.1dev', 'odoo-addon-operating_unit>=16.0dev,<16.1dev', 'odoo-addon-product_operating_unit>=16.0dev,<16.1dev', 'odoo-addon-project_operating_unit>=16.0dev,<16.1dev', + 'odoo-addon-report_qweb_operating_unit>=16.0dev,<16.1dev', 'odoo-addon-sales_team_operating_unit>=16.0dev,<16.1dev', 'odoo-addon-stock_operating_unit>=16.0dev,<16.1dev', ], diff --git a/setup/contract_operating_unit/odoo/addons/contract_operating_unit b/setup/contract_operating_unit/odoo/addons/contract_operating_unit new file mode 120000 index 0000000000..3ce69de57a --- /dev/null +++ b/setup/contract_operating_unit/odoo/addons/contract_operating_unit @@ -0,0 +1 @@ +../../../../contract_operating_unit \ No newline at end of file diff --git a/setup/contract_operating_unit/setup.py b/setup/contract_operating_unit/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/contract_operating_unit/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/setup/hr_operating_unit_access_all/odoo/addons/hr_operating_unit_access_all b/setup/hr_operating_unit_access_all/odoo/addons/hr_operating_unit_access_all new file mode 120000 index 0000000000..b58e22d2da --- /dev/null +++ b/setup/hr_operating_unit_access_all/odoo/addons/hr_operating_unit_access_all @@ -0,0 +1 @@ +../../../../hr_operating_unit_access_all \ No newline at end of file diff --git a/setup/hr_operating_unit_access_all/setup.py b/setup/hr_operating_unit_access_all/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/hr_operating_unit_access_all/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/setup/report_qweb_operating_unit/odoo/addons/report_qweb_operating_unit b/setup/report_qweb_operating_unit/odoo/addons/report_qweb_operating_unit new file mode 120000 index 0000000000..679f3054ac --- /dev/null +++ b/setup/report_qweb_operating_unit/odoo/addons/report_qweb_operating_unit @@ -0,0 +1 @@ +../../../../report_qweb_operating_unit \ No newline at end of file diff --git a/setup/report_qweb_operating_unit/setup.py b/setup/report_qweb_operating_unit/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/report_qweb_operating_unit/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/stock_operating_unit/i18n/de.po b/stock_operating_unit/i18n/de.po new file mode 100644 index 0000000000..0a88b51def --- /dev/null +++ b/stock_operating_unit/i18n/de.po @@ -0,0 +1,183 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_operating_unit +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-09-20 17:06+0000\n" +"Last-Translator: Bastian Günther \n" +"Language-Team: none\n" +"Language: de\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 5.6.2\n" + +#. module: stock_operating_unit +#. odoo-python +#: code:addons/stock_operating_unit/model/stock_warehouse.py:0 +#, python-format +msgid "" +"Configuration Error. The Operating Unit of the Warehouse and the Location " +"must be the same. " +msgstr "" +"Konfigurationsfehler. Die Filiale des Lagers und des Lagerortes müssen " +"identisch sein. " + +#. module: stock_operating_unit +#. odoo-python +#: code:addons/stock_operating_unit/model/stock_location.py:0 +#, python-format +msgid "Configuration error. Internal locations should have an operating unit" +msgstr "" +"Konfigurationsfehler. Interne Lagerorte sollten einer Filiale zugeordnet sein" + +#. module: stock_operating_unit +#. odoo-python +#: code:addons/stock_operating_unit/model/stock_location.py:0 +#, python-format +msgid "" +"Configuration error. The Company in the Stock Location and in the Operating " +"Unit must be the same." +msgstr "" +"Konfigurationsfehler. Der Lagerort und die Filiale müssen demselben " +"Unternehmen zugeordnet sein." + +#. module: stock_operating_unit +#. odoo-python +#: code:addons/stock_operating_unit/model/stock_picking.py:0 +#, python-format +msgid "" +"Configuration error. The Company in the Stock Picking and in the Operating " +"Unit must be the same." +msgstr "" +"Konfigurationsfehler. Die Lagerentnahme und die Filiale müssen demselben " +"Unternehmen zugeordnet sein." + +#. module: stock_operating_unit +#. odoo-python +#: code:addons/stock_operating_unit/model/stock_warehouse.py:0 +#, python-format +msgid "" +"Configuration error. The Company in the Stock Warehouse and in the Operating" +" Unit must be the same." +msgstr "" +"Konfigurationsfehler. Das Lager und die Filiale müssen demselben Unternehmen " +"zugeordnet sein." + +#. module: stock_operating_unit +#. odoo-python +#: code:addons/stock_operating_unit/model/stock_picking.py:0 +#, python-format +msgid "" +"Configuration error. The Operating Unit of the picking must be the same as " +"that of the warehouse of the Picking Type." +msgstr "" +"Konfigurationsfehler. Die Lagerentnahme und das dem Vorgangstyp zugehörige " +"Lager müssen derselben Filiale zugeordnet sein." + +#. module: stock_operating_unit +#. odoo-python +#: code:addons/stock_operating_unit/model/stock_location.py:0 +#, python-format +msgid "" +"Configuration error. The Parent Stock Location must belong to the same " +"Operating Unit." +msgstr "" +"Konfigurationsfehler. Der übergeordnete Lagerort muss derselben Filiale " +"zugeordnet sein." + +#. module: stock_operating_unit +#. odoo-python +#: code:addons/stock_operating_unit/model/stock_move.py:0 +#, python-format +msgid "" +"Configuration error. The Stock moves must be related to a location (source " +"or destination) that belongs to the requesting Operating Unit." +msgstr "" +"Konfigurationsfehler. Die Lagerbewegung muss zu einem Lagerort gehören (" +"Quelle oder Ziel), welcher der anfragenden Filiale zugeordnet ist." + +#. module: stock_operating_unit +#. odoo-python +#: code:addons/stock_operating_unit/model/stock_location.py:0 +#, python-format +msgid "" +"Configuration error. The operating unit should be assigned to internal " +"locations only." +msgstr "" +"Konfigurationsfehler. Nur interne Lagerorte sollten einer Filiale zugeordnet " +"werden." + +#. module: stock_operating_unit +#. odoo-python +#: code:addons/stock_operating_unit/model/stock_location.py:0 +#, python-format +msgid "" +"Configuration error. This location is assigned to a warehouse that belongs " +"to a different operating unit." +msgstr "" +"Konfigurationsfehler. Dieser Lagerort gehört zu einemLager, welches einer " +"anderen Filiale zugeordnet ist." + +#. module: stock_operating_unit +#: model:ir.model.fields,field_description:stock_operating_unit.field_stock_move__operating_unit_dest_id +msgid "Dest. Location Operating Unit" +msgstr "Zielort Filiale" + +#. module: stock_operating_unit +#: model:ir.model,name:stock_operating_unit.model_stock_location +msgid "Inventory Locations" +msgstr "Lagerorte" + +#. module: stock_operating_unit +#: model:ir.model,name:stock_operating_unit.model_stock_warehouse_orderpoint +msgid "Minimum Inventory Rule" +msgstr "Mindestbestandsregel" + +#. module: stock_operating_unit +#: model:ir.model.fields,field_description:stock_operating_unit.field_stock_location__operating_unit_id +#: model:ir.model.fields,field_description:stock_operating_unit.field_stock_quant__operating_unit_id +#: model:ir.model.fields,field_description:stock_operating_unit.field_stock_rule__operating_unit_id +#: model:ir.model.fields,field_description:stock_operating_unit.field_stock_warehouse__operating_unit_id +#: model_terms:ir.ui.view,arch_db:stock_operating_unit.view_picking_internal_search +msgid "Operating Unit" +msgstr "Filiale" + +#. module: stock_operating_unit +#: model:ir.model,name:stock_operating_unit.model_stock_quant +msgid "Quants" +msgstr "Mengen" + +#. module: stock_operating_unit +#: model:ir.model.fields,field_description:stock_operating_unit.field_stock_picking__operating_unit_id +msgid "Requesting Operating Unit" +msgstr "Anfragende Filiale" + +#. module: stock_operating_unit +#: model:ir.model.fields,field_description:stock_operating_unit.field_stock_move__operating_unit_id +msgid "Source Location Operating Unit" +msgstr "Quelllagerort Filiale" + +#. module: stock_operating_unit +#: model:ir.model,name:stock_operating_unit.model_stock_move +msgid "Stock Move" +msgstr "Lagerbuchung" + +#. module: stock_operating_unit +#: model:ir.model,name:stock_operating_unit.model_stock_rule +msgid "Stock Rule" +msgstr "Lagerbestandsregel" + +#. module: stock_operating_unit +#: model:ir.model,name:stock_operating_unit.model_stock_picking +msgid "Transfer" +msgstr "Transfer" + +#. module: stock_operating_unit +#: model:ir.model,name:stock_operating_unit.model_stock_warehouse +msgid "Warehouse" +msgstr "Lager"