diff --git a/base_technical_user/README.rst b/base_technical_user/README.rst new file mode 100644 index 000000000..d68044f45 --- /dev/null +++ b/base_technical_user/README.rst @@ -0,0 +1,49 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +=================== +Base Technical User +=================== + +This module extends the functionality of company management. +It allows you to bind a technical user on the company in order to use it in +batch processes. + +The technical user must +- be inactive to avoid login +- be in the required groups depending of what you need to do + +Usage +===== + +If you install the module, you will find a tab on the company form allowing +to define the technical user. + +Credits +======= + +Images +------ + +* Odoo Community Association: `Icon `_. + +Contributors +------------ + +* Cédric Pigeon + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +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. + +To contribute to this module, please visit http://odoo-community.org. \ No newline at end of file diff --git a/base_technical_user/__init__.py b/base_technical_user/__init__.py new file mode 100644 index 000000000..a0fdc10fe --- /dev/null +++ b/base_technical_user/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +from . import models diff --git a/base_technical_user/__manifest__.py b/base_technical_user/__manifest__.py new file mode 100644 index 000000000..9f91e7618 --- /dev/null +++ b/base_technical_user/__manifest__.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +{ + 'name': "Base Technical User", + 'summary': """ + Add a technical user parameter on the company """, + 'author': 'ACSONE SA/NV, Odoo Community Association (OCA)', + 'website': "http://acsone.eu", + 'category': 'Hidden/Dependency', + 'version': '10.0.1.0.0', + 'license': 'AGPL-3', + 'depends': [ + 'base', + ], + 'data': [ + 'views/res_company_view.xml' + ], + 'installable': True +} diff --git a/base_technical_user/models/__init__.py b/base_technical_user/models/__init__.py new file mode 100644 index 000000000..88de5f995 --- /dev/null +++ b/base_technical_user/models/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +from . import res_company diff --git a/base_technical_user/models/res_company.py b/base_technical_user/models/res_company.py new file mode 100644 index 000000000..af30a3761 --- /dev/null +++ b/base_technical_user/models/res_company.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import models, fields + + +class ResCompany(models.Model): + _inherit = 'res.company' + + user_tech_id = fields.Many2one( + comodel_name="res.users", + string="Technical User", + help="This user can be used by process for technical purpose", + domain="[('company_id', '=', id)]") diff --git a/base_technical_user/views/res_company_view.xml b/base_technical_user/views/res_company_view.xml new file mode 100644 index 000000000..032751b11 --- /dev/null +++ b/base_technical_user/views/res_company_view.xml @@ -0,0 +1,20 @@ + + + + res.company.form (base_technical_user) + res.company + + 20 + + + + + + + + + + + + + diff --git a/setup/base_technical_user/odoo/__init__.py b/setup/base_technical_user/odoo/__init__.py new file mode 100644 index 000000000..de40ea7ca --- /dev/null +++ b/setup/base_technical_user/odoo/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/setup/base_technical_user/odoo/addons/__init__.py b/setup/base_technical_user/odoo/addons/__init__.py new file mode 100644 index 000000000..de40ea7ca --- /dev/null +++ b/setup/base_technical_user/odoo/addons/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/setup/base_technical_user/odoo/addons/base_technical_user b/setup/base_technical_user/odoo/addons/base_technical_user new file mode 120000 index 000000000..e1d0b1917 --- /dev/null +++ b/setup/base_technical_user/odoo/addons/base_technical_user @@ -0,0 +1 @@ +../../../../base_technical_user \ No newline at end of file diff --git a/setup/base_technical_user/setup.py b/setup/base_technical_user/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/base_technical_user/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)