diff --git a/bankayma_account/i18n/he_IL.po b/bankayma_account/i18n/he_IL.po index 795473e8c..78f419cd7 100644 --- a/bankayma_account/i18n/he_IL.po +++ b/bankayma_account/i18n/he_IL.po @@ -36,7 +36,7 @@ msgstr ". עבור" #. module: bankayma_account #: model_terms:ir.ui.view,arch_db:bankayma_account.qweb_template_account_move_paid msgid ". from" -msgstr ". מ" +msgstr "מ" #. module: bankayma_account #: model:account.tax,name:bankayma_account.tax_social_security_76ex @@ -2052,7 +2052,7 @@ msgstr "[בנקיימא] תשלום מעוכב עד להשלמת מסמכים ע #: code:addons/bankayma_account/models/account_move.py:0 #, python-format msgid "[BanKayma] %(company)s you've been paid! 🤑 (Ref %(ref)s)" -msgstr "[בנקיימא] %(company)s שילמנו לך! 🤑 (Ref %(ref)s)" +msgstr "[בנקיימא] %(company)s - שילמנו לך! 🤑 (Ref %(ref)s)" #. module: bankayma_account #. odoo-python @@ -2101,7 +2101,7 @@ msgstr "חשבון" #. module: bankayma_account #: model_terms:ir.ui.view,arch_db:bankayma_account.qweb_template_account_move_rejected msgid "is on hold after checking 1000 system:" -msgstr "- הבקשה מעוכבת עד לעדכון פרטים או מסמכים." +msgstr "- הבקשה מעוכבת עד לעדכון פרטים או מסמכים -" #. module: bankayma_account #: model_terms:ir.ui.view,arch_db:bankayma_account.qweb_template_account_move_draft @@ -2124,12 +2124,12 @@ msgstr "או" #. module: bankayma_account #: model_terms:ir.ui.view,arch_db:bankayma_account.qweb_template_account_move_paid msgid "to" -msgstr "ל" +msgstr ":)" #. module: bankayma_account #: model_terms:ir.ui.view,arch_db:bankayma_account.qweb_template_account_move_rejected msgid "until up to date documents" -msgstr "" +msgstr "-" #. module: bankayma_account #: model_terms:ir.ui.view,arch_db:bankayma_account.qweb_template_account_move_draft diff --git a/bankayma_account/migrations/16.0.1.0.10/post-migration.py b/bankayma_account/migrations/16.0.1.0.10/post-migration.py index e627bcb4e..86bb96d8e 100644 --- a/bankayma_account/migrations/16.0.1.0.10/post-migration.py +++ b/bankayma_account/migrations/16.0.1.0.10/post-migration.py @@ -11,4 +11,6 @@ def migrate(env, version=None): "template_account_move_new_from_portal", "template_account_move_tier_rejected", ): - env.ref("bankayma_account.%s" % xmlid).unlink() + record = env.ref("bankayma_account.%s" % xmlid, False) + if record: + record.unlink() diff --git a/company_cascade_category/README.rst b/company_cascade_category/README.rst new file mode 100644 index 000000000..abd9dee1d --- /dev/null +++ b/company_cascade_category/README.rst @@ -0,0 +1,99 @@ +=================== +Cascading companies +=================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png + :target: https://odoo-community.org/page/development-status + :alt: Alpha +.. |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%2Fmulti--company-lightgray.png?logo=github + :target: https://github.com/OCA/multi-company/tree/16.0/company_cascade + :alt: OCA/multi-company +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/multi-company-16-0/multi-company-16-0-company_cascade + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/webui/builds.html?repo=OCA/multi-company&target_branch=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module maintains relations between company specific records (think accounts, journals) of parent and child companies, enabling users to configure things in the parent company and then copy (=cascade) this configuration to child companies. + +Originally conceived for financial hosting, this mechanism is useful for any setting where Odoo is used to manage multiple organizations that have a very similar financial configuration, but organizational units are a bad fit because the companies are different (legal) entities, or just need more independence from the parent company than OUs provide. + +.. IMPORTANT:: + This is an alpha version, the data model and design can change at any time without warning. + Only for development or testing purpose, do not use in production. + `More details on development status `_ + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To use this module, you need to: + +#. Go to an account/journal/etc in your parent company +#. Click Actions/Cascade to child companies +#. If not existing yet, an equivalent record will be created in the child company +#. If an equivalent record exists already, it will be overwritten with the parent company's values + +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 smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Hunki Enterprises BV +* Moshchot Coop + +Contributors +~~~~~~~~~~~~ + +* Holger Brunn (https://hunki-enterprises.com) + +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-hbrunn| image:: https://github.com/hbrunn.png?size=40px + :target: https://github.com/hbrunn + :alt: hbrunn + +Current `maintainer `__: + +|maintainer-hbrunn| + +This module is part of the `OCA/multi-company `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/company_cascade_category/__init__.py b/company_cascade_category/__init__.py new file mode 100644 index 000000000..aee8895e7 --- /dev/null +++ b/company_cascade_category/__init__.py @@ -0,0 +1,2 @@ +from . import models +from . import wizards diff --git a/company_cascade_category/__manifest__.py b/company_cascade_category/__manifest__.py new file mode 100644 index 000000000..cb3fdee6d --- /dev/null +++ b/company_cascade_category/__manifest__.py @@ -0,0 +1,21 @@ +# Copyright 2023 Hunki Enterprises BV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0) + +{ + "name": "Cascading companies (company category support)", + "summary": "Sync configuration from parent companies to children", + "version": "16.0.1.0.0", + "development_status": "Alpha", + "category": "Technical", + "website": "https://github.com/moshchot/BANKayma", + "author": "Hunki Enterprises BV, Odoo Community Association (OCA), Moshchot Coop", + "maintainers": ["hbrunn"], + "license": "AGPL-3", + "application": False, + "installable": True, + "preloadable": True, + "depends": ["company_cascade", "res_company_category"], + "data": [ + "wizards/company_cascade_wizard.xml", + ], +} diff --git a/company_cascade_category/i18n/he_IL.po b/company_cascade_category/i18n/he_IL.po new file mode 100644 index 000000000..932eb7172 --- /dev/null +++ b/company_cascade_category/i18n/he_IL.po @@ -0,0 +1,43 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * company_cascade +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-07-12 09:38+0000\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: he_IL\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: company_cascade_category +#: model:ir.model,name:company_cascade_category.model_company_cascade_wizard +msgid "Cascade records to child companies" +msgstr "" + +#. module: company_cascade_category +#: model:ir.model,name:company_cascade_category.model_company_cascade_mixin +msgid "Cascade values to child companies" +msgstr "" + +#. module: company_cascade_category +#: model:ir.model.fields,field_description:company_cascade_category.field_company_cascade_wizard__category_ids +msgid "Categories" +msgstr "" + +#. module: company_cascade_category +#: model_terms:ir.ui.view,arch_db:company_cascade_category.view_company_cascade_wizard_form +msgid "Select company categories to cascade to" +msgstr "" + +#. module: company_cascade_category +#: model_terms:ir.ui.view,arch_db:company_cascade_category.view_company_cascade_wizard_form +msgid "" +"You very probably should choose a category to restrict the\n" +" cascading." +msgstr "" diff --git a/company_cascade_category/models/__init__.py b/company_cascade_category/models/__init__.py new file mode 100644 index 000000000..2af2c754f --- /dev/null +++ b/company_cascade_category/models/__init__.py @@ -0,0 +1 @@ +from . import company_cascade_mixin diff --git a/company_cascade_category/models/company_cascade_mixin.py b/company_cascade_category/models/company_cascade_mixin.py new file mode 100644 index 000000000..c9568c8ac --- /dev/null +++ b/company_cascade_category/models/company_cascade_mixin.py @@ -0,0 +1,44 @@ +# Copyright 2024 Hunki Enterprises BV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + + +from odoo import models + + +class CompanyCascadeMixin(models.AbstractModel): + _inherit = "company.cascade.mixin" + + def _company_cascade_get_categories(self): + return self.env.context.get("company_cascade_catgory_categories") or self.env[ + "res.company.category" + ].search([]) + + def _company_cascade_get_companies(self): + categories = self._company_cascade_get_categories() + return ( + super() + ._company_cascade_get_companies() + .filtered(lambda x: not x.category_id or x.category_id in categories) + ) + + def _company_cascade_get_children(self): + categories = self._company_cascade_get_categories() + return ( + super() + ._company_cascade_get_children() + .filtered( + lambda x: not x.company_id.category_id + or x.company_id.category_id in categories + ) + ) + + def _company_cascade_get_all(self, company=None): + categories = self._company_cascade_get_categories() + return ( + super() + ._company_cascade_get_all(company=company) + .filtered( + lambda x: not x.company_id.category_id + or x.company_id.category_id in categories + ) + ) diff --git a/company_cascade_category/readme/CONTRIBUTORS.rst b/company_cascade_category/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..33b6eb2c3 --- /dev/null +++ b/company_cascade_category/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Holger Brunn (https://hunki-enterprises.com) diff --git a/company_cascade_category/readme/DESCRIPTION.rst b/company_cascade_category/readme/DESCRIPTION.rst new file mode 100644 index 000000000..2238d7fc7 --- /dev/null +++ b/company_cascade_category/readme/DESCRIPTION.rst @@ -0,0 +1,3 @@ +This module maintains relations between company specific records (think accounts, journals) of parent and child companies, enabling users to configure things in the parent company and then copy (=cascade) this configuration to child companies. + +Originally conceived for financial hosting, this mechanism is useful for any setting where Odoo is used to manage multiple organizations that have a very similar financial configuration, but organizational units are a bad fit because the companies are different (legal) entities, or just need more independence from the parent company than OUs provide. diff --git a/company_cascade_category/readme/USAGE.rst b/company_cascade_category/readme/USAGE.rst new file mode 100644 index 000000000..e11c1214a --- /dev/null +++ b/company_cascade_category/readme/USAGE.rst @@ -0,0 +1,7 @@ +To use this module, you need to: + +#. Go to an account/journal/etc in your parent company +#. Click Actions/Cascade to child companies +#. Select the company categories to cascade to +#. If not existing yet, an equivalent record will be created in the child company +#. If an equivalent record exists already, it will be overwritten with the parent company's values diff --git a/company_cascade_category/static/description/icon.png b/company_cascade_category/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/company_cascade_category/static/description/icon.png differ diff --git a/company_cascade_category/static/description/index.html b/company_cascade_category/static/description/index.html new file mode 100644 index 000000000..96b90bf34 --- /dev/null +++ b/company_cascade_category/static/description/index.html @@ -0,0 +1,440 @@ + + + + + + +Cascading companies + + + +
+

Cascading companies

+ + +

Alpha License: AGPL-3 OCA/multi-company Translate me on Weblate Try me on Runboat

+

This module maintains relations between company specific records (think accounts, journals) of parent and child companies, enabling users to configure things in the parent company and then copy (=cascade) this configuration to child companies.

+

Originally conceived for financial hosting, this mechanism is useful for any setting where Odoo is used to manage multiple organizations that have a very similar financial configuration, but organizational units are a bad fit because the companies are different (legal) entities, or just need more independence from the parent company than OUs provide.

+
+

Important

+

This is an alpha version, the data model and design can change at any time without warning. +Only for development or testing purpose, do not use in production. +More details on development status

+
+

Table of contents

+ +
+

Usage

+

To use this module, you need to:

+
    +
  1. Go to an account/journal/etc in your parent company
  2. +
  3. Click Actions/Cascade to child companies
  4. +
  5. If not existing yet, an equivalent record will be created in the child company
  6. +
  7. If an equivalent record exists already, it will be overwritten with the parent company’s values
  8. +
+
+
+

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 smashing it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Hunki Enterprises BV
  • +
  • Moshchot Coop
  • +
+
+ +
+

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:

+

hbrunn

+

This module is part of the OCA/multi-company project on GitHub.

+

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

+
+
+
+ + diff --git a/company_cascade_category/tests/__init__.py b/company_cascade_category/tests/__init__.py new file mode 100644 index 000000000..e5068547a --- /dev/null +++ b/company_cascade_category/tests/__init__.py @@ -0,0 +1 @@ +from . import test_company_cascade diff --git a/company_cascade_category/tests/test_company_cascade.py b/company_cascade_category/tests/test_company_cascade.py new file mode 100644 index 000000000..c4edb4df9 --- /dev/null +++ b/company_cascade_category/tests/test_company_cascade.py @@ -0,0 +1,2 @@ +# Copyright 2024 Hunki Enterprises BV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0) diff --git a/company_cascade_category/wizards/__init__.py b/company_cascade_category/wizards/__init__.py new file mode 100644 index 000000000..7542edff5 --- /dev/null +++ b/company_cascade_category/wizards/__init__.py @@ -0,0 +1 @@ +from . import company_cascade_wizard diff --git a/company_cascade_category/wizards/company_cascade_wizard.py b/company_cascade_category/wizards/company_cascade_wizard.py new file mode 100644 index 000000000..de6ffda78 --- /dev/null +++ b/company_cascade_category/wizards/company_cascade_wizard.py @@ -0,0 +1,20 @@ +# Copyright 2024 Hunki Enterprises BV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class CompanyCascadeWizard(models.TransientModel): + _inherit = "company.cascade.wizard" + _description = "Cascade records to child companies" + + category_ids = fields.Many2many( + "res.company.category", + string="Categories", + ) + + def action_cascade(self): + return super( + CompanyCascadeWizard, + self.with_context(company_cascade_category_categories=self.category_ids), + ).action_cascade() diff --git a/company_cascade_category/wizards/company_cascade_wizard.xml b/company_cascade_category/wizards/company_cascade_wizard.xml new file mode 100644 index 000000000..71ff85d00 --- /dev/null +++ b/company_cascade_category/wizards/company_cascade_wizard.xml @@ -0,0 +1,31 @@ + + + + + company.cascade.wizard + + +
+ + + + +
+
+
+
diff --git a/setup/company_cascade_category/odoo/addons/company_cascade_category b/setup/company_cascade_category/odoo/addons/company_cascade_category new file mode 120000 index 000000000..1c27b0f52 --- /dev/null +++ b/setup/company_cascade_category/odoo/addons/company_cascade_category @@ -0,0 +1 @@ +../../../../company_cascade_category \ No newline at end of file diff --git a/setup/company_cascade_category/setup.py b/setup/company_cascade_category/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/company_cascade_category/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)