diff --git a/analytic_operating_unit/README.rst b/analytic_operating_unit/README.rst new file mode 100644 index 0000000000..9b275d134f --- /dev/null +++ b/analytic_operating_unit/README.rst @@ -0,0 +1,86 @@ +======================= +Analytic Operating Unit +======================= + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/14.0/analytic_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-14-0/operating-unit-14-0-analytic_operating_unit + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/213/14.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows users to introduce into the analytic accounts the allowed +operating units. Only a user with permissions to operate on the operating +units indicated in an analytic account will have the rights to use it. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +* Go to 'Accounting / Configuration / Analytic Accounting / Analytic + Accounts' and add the accepted Operating Units to each analytic account. + +Analytic accounts with no Operating Unit assigned to them will be accessible +by all users with access to analytic accounts. + +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 +~~~~~~~ + +* ForgeFlow + +Contributors +~~~~~~~~~~~~ + +* Jordi Ballester Alomar +* Sudhir Arya +* Alan Ramos + +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/analytic_operating_unit/__init__.py b/analytic_operating_unit/__init__.py new file mode 100644 index 0000000000..133f68732d --- /dev/null +++ b/analytic_operating_unit/__init__.py @@ -0,0 +1,2 @@ +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). +from . import models diff --git a/analytic_operating_unit/__manifest__.py b/analytic_operating_unit/__manifest__.py new file mode 100644 index 0000000000..6609f852f7 --- /dev/null +++ b/analytic_operating_unit/__manifest__.py @@ -0,0 +1,16 @@ +# Copyright 2016-17 ForgeFlow S.L. +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). +{ + "name": "Analytic Operating Unit", + "version": "14.0.1.0.0", + "author": "ForgeFlow, Odoo Community Association (OCA)", + "license": "LGPL-3", + "website": "https://github.com/OCA/operating-unit", + "category": "Sales", + "depends": ["analytic", "operating_unit"], + "data": [ + "security/analytic_account_security.xml", + "views/analytic_account_view.xml", + ], + "installable": True, +} diff --git a/analytic_operating_unit/i18n/analytic_operating_unit.pot b/analytic_operating_unit/i18n/analytic_operating_unit.pot new file mode 100644 index 0000000000..fb55cccd38 --- /dev/null +++ b/analytic_operating_unit/i18n/analytic_operating_unit.pot @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * analytic_operating_unit +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.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: analytic_operating_unit +#: model:ir.model,name:analytic_operating_unit.model_account_analytic_account +msgid "Analytic Account" +msgstr "" + +#. module: analytic_operating_unit +#: model:ir.model.fields,field_description:analytic_operating_unit.field_account_analytic_account__operating_unit_ids +msgid "Operating Units" +msgstr "" diff --git a/analytic_operating_unit/i18n/es_MX.po b/analytic_operating_unit/i18n/es_MX.po new file mode 100644 index 0000000000..e077c7b79b --- /dev/null +++ b/analytic_operating_unit/i18n/es_MX.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 13.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2020-02-15 14: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: analytic_operating_unit +#: model:ir.model,name:analytic_operating_unit.model_account_analytic_account +msgid "Analytic Account" +msgstr "Cuenta Analítica" + +#. module: analytic_operating_unit +#: model:ir.model.fields,field_description:analytic_operating_unit.field_account_analytic_account__operating_unit_ids +msgid "Operating Units" +msgstr "Unidades Operativas" diff --git a/analytic_operating_unit/models/__init__.py b/analytic_operating_unit/models/__init__.py new file mode 100644 index 0000000000..12b7ff4d41 --- /dev/null +++ b/analytic_operating_unit/models/__init__.py @@ -0,0 +1,2 @@ +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). +from . import account_analytic_account diff --git a/analytic_operating_unit/models/account_analytic_account.py b/analytic_operating_unit/models/account_analytic_account.py new file mode 100644 index 0000000000..cffc7cac1c --- /dev/null +++ b/analytic_operating_unit/models/account_analytic_account.py @@ -0,0 +1,17 @@ +# Copyright 2016-17 ForgeFlow S.L. +# Copyright 2016-17 Serpent Consulting Services Pvt. Ltd. +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). +from odoo import fields, models + + +class AccountAnalyticAccount(models.Model): + _inherit = "account.analytic.account" + + operating_unit_ids = fields.Many2many( + comodel_name="operating.unit", + string="Operating Units", + relation="analytic_account_operating_unit_rel", + domain="[('user_ids', '=', uid)]", + column1="analytic_account_id", + column2="operating_unit_id", + ) diff --git a/analytic_operating_unit/readme/CONTRIBUTORS.rst b/analytic_operating_unit/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..33e834b5ec --- /dev/null +++ b/analytic_operating_unit/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* Jordi Ballester Alomar +* Sudhir Arya +* Alan Ramos diff --git a/analytic_operating_unit/readme/DESCRIPTION.rst b/analytic_operating_unit/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..b2c362f417 --- /dev/null +++ b/analytic_operating_unit/readme/DESCRIPTION.rst @@ -0,0 +1,3 @@ +This module allows users to introduce into the analytic accounts the allowed +operating units. Only a user with permissions to operate on the operating +units indicated in an analytic account will have the rights to use it. diff --git a/analytic_operating_unit/readme/USAGE.rst b/analytic_operating_unit/readme/USAGE.rst new file mode 100644 index 0000000000..d636019a96 --- /dev/null +++ b/analytic_operating_unit/readme/USAGE.rst @@ -0,0 +1,5 @@ +* Go to 'Accounting / Configuration / Analytic Accounting / Analytic + Accounts' and add the accepted Operating Units to each analytic account. + +Analytic accounts with no Operating Unit assigned to them will be accessible +by all users with access to analytic accounts. diff --git a/analytic_operating_unit/security/analytic_account_security.xml b/analytic_operating_unit/security/analytic_account_security.xml new file mode 100644 index 0000000000..82fbda92ce --- /dev/null +++ b/analytic_operating_unit/security/analytic_account_security.xml @@ -0,0 +1,18 @@ + + + + + + + ['|',('operating_unit_ids','=',False),('operating_unit_ids','in',[g.id for g + in user.operating_unit_ids])] + + Analytic Accounts from allowed operating units + + + + + + + diff --git a/analytic_operating_unit/static/description/icon.png b/analytic_operating_unit/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/analytic_operating_unit/static/description/icon.png differ diff --git a/analytic_operating_unit/static/description/index.html b/analytic_operating_unit/static/description/index.html new file mode 100644 index 0000000000..b1d3e03fb5 --- /dev/null +++ b/analytic_operating_unit/static/description/index.html @@ -0,0 +1,433 @@ + + + + + + +Analytic Operating Unit + + + +
+

Analytic Operating Unit

+ + +

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

+

This module allows users to introduce into the analytic accounts the allowed +operating units. Only a user with permissions to operate on the operating +units indicated in an analytic account will have the rights to use it.

+

Table of contents

+ +
+

Usage

+
    +
  • Go to ‘Accounting / Configuration / Analytic Accounting / Analytic +Accounts’ and add the accepted Operating Units to each analytic account.
  • +
+

Analytic accounts with no Operating Unit assigned to them will be accessible +by all users with access to analytic accounts.

+
+
+

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

+
    +
  • ForgeFlow
  • +
+
+
+

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/analytic_operating_unit/views/analytic_account_view.xml b/analytic_operating_unit/views/analytic_account_view.xml new file mode 100644 index 0000000000..001c6f9108 --- /dev/null +++ b/analytic_operating_unit/views/analytic_account_view.xml @@ -0,0 +1,19 @@ + + + + + analytic.analytic.account.form + account.analytic.account + + + + + + + + diff --git a/setup/analytic_operating_unit/odoo/addons/analytic_operating_unit b/setup/analytic_operating_unit/odoo/addons/analytic_operating_unit new file mode 120000 index 0000000000..2e7ab36dec --- /dev/null +++ b/setup/analytic_operating_unit/odoo/addons/analytic_operating_unit @@ -0,0 +1 @@ +../../../../analytic_operating_unit \ No newline at end of file diff --git a/setup/analytic_operating_unit/setup.py b/setup/analytic_operating_unit/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/analytic_operating_unit/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)