Initial commit: OCA Technical packages (595 packages)

This commit is contained in:
Ernad Husremovic 2025-08-29 15:43:03 +02:00
commit 2cc02aac6e
24950 changed files with 2318079 additions and 0 deletions

View file

@ -0,0 +1,48 @@
# Optional CSV import
Odoo addon: base_import_security_group
## Installation
```bash
pip install odoo-bringout-oca-server-ux-base_import_security_group
```
## Dependencies
This addon depends on:
- web
- web_tour
- base_import
## Manifest Information
- **Name**: Optional CSV import
- **Version**: 16.0.1.0.0
- **Category**: Server tools
- **License**: AGPL-3
- **Installable**: True
## Source
Based on [OCA/server-ux](https://github.com/OCA/server-ux) branch 16.0, addon `base_import_security_group`.
## License
This package maintains the original AGPL-3 license from the upstream Odoo project.
## Documentation
- Overview: doc/OVERVIEW.md
- Architecture: doc/ARCHITECTURE.md
- Models: doc/MODELS.md
- Controllers: doc/CONTROLLERS.md
- Wizards: doc/WIZARDS.md
- Reports: doc/REPORTS.md
- Security: doc/SECURITY.md
- Install: doc/INSTALL.md
- Usage: doc/USAGE.md
- Configuration: doc/CONFIGURATION.md
- Dependencies: doc/DEPENDENCIES.md
- Troubleshooting: doc/TROUBLESHOOTING.md
- FAQ: doc/FAQ.md

View file

@ -0,0 +1,104 @@
===================
Optional CSV import
===================
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:fe2d7959aa71ca276bb4b9fb395d9588490642e013a064a6c332860fa24edfeb
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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%2Fserver--ux-lightgray.png?logo=github
:target: https://github.com/OCA/server-ux/tree/16.0/base_import_security_group
:alt: OCA/server-ux
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/server-ux-16-0/server-ux-16-0-base_import_security_group
: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/server-ux&target_branch=16.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
This module makes importing data from CSV and Excel files optional for each user,
depending on whether `Import CSV/Excel files` is ticked on the `Access Rights`
tab on the user form. This corresponds to a user group by the same name.
Only users that belong to this group will have the `Import records` button
available under the `Favorites` button of each list or kanban view.
If this GUI restriction is circumvented (through a crafted JSONRPC call for
instance), there is another check in the backend to prevent batch imports by
restricted users.
**Table of contents**
.. contents::
:local:
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-ux/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 <https://github.com/OCA/server-ux/issues/new?body=module:%20base_import_security_group%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
Credits
=======
Authors
~~~~~~~
* Alejandro Santana <alejandrosantana@anubia.es>
* Onestein
Contributors
~~~~~~~~~~~~
* Alejandro Santana <alejandrosantana@anubia.es>
* Antonio Esposito <a.esposito@onestein.nl>
* Druidoo <https://www.druidoo.io>
* `Tecnativa <https://www.tecnativa.com>`_:
* Víctor Martínez
* `Open Source Integrators <https://www.opensourceintegrators.com/>`_:
* Daniel Reis
* Chandresh Thakkar
* `Opener B.V. <https://opener.amsterdam/>`_:
* Stefan Rijnhart <stefan@opener.amsterdam>
* `ACSONE SA/NV <https://acsone.eu/>`_:
* Souheil Bejaoui <souheil.bejaoui@acsone.eu>
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/server-ux <https://github.com/OCA/server-ux/tree/16.0/base_import_security_group>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View file

@ -0,0 +1,5 @@
# Copyright 2015 Anubía, soluciones en la nube,SL (http://www.anubia.es)
# Copyright 2017 Onestein (http://www.onestein.eu)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import models

View file

@ -0,0 +1,34 @@
# Copyright 2015 Anubía, soluciones en la nube,SL (http://www.anubia.es)
# Copyright 2017 Onestein (http://www.onestein.eu)
# Copyright (C) 2019-Today: Druidoo (<https://www.druidoo.io>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Optional CSV import",
"version": "16.0.1.0.0",
"category": "Server tools",
"summary": "Group-based permissions for importing CSV files",
"license": "AGPL-3",
"author": "Odoo Community Association (OCA), "
"Alejandro Santana <alejandrosantana@anubia.es>, "
"Onestein",
"maintainer": "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/server-ux",
"depends": [
"web",
"web_tour",
"base_import",
],
"data": [
"security/base_import_security_group_security.xml",
],
"assets": {
"web.assets_backend": [
"base_import_security_group/static/src/js/import.esm.js"
],
"web.assets_tests": [
"base_import_security_group/static/src/js/tour_import.js",
],
},
"installable": True,
}

View file

@ -0,0 +1,29 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * base_import_security_group
#
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: base_import_security_group
#: model:ir.model,name:base_import_security_group.model_base
msgid "Base"
msgstr ""
#. module: base_import_security_group
#: model:ir.model,name:base_import_security_group.model_ir_http
msgid "HTTP Routing"
msgstr ""
#. module: base_import_security_group
#: model:res.groups,name:base_import_security_group.group_import_csv
msgid "Import CSV/Excel files"
msgstr ""

View file

@ -0,0 +1,29 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * base_import_security_group
#
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: base_import_security_group
#: model:ir.model,name:base_import_security_group.model_base
msgid "Base"
msgstr "Osnova"
#. module: base_import_security_group
#: model:ir.model,name:base_import_security_group.model_ir_http
msgid "HTTP Routing"
msgstr "HTTP usmjeravanje"
#. module: base_import_security_group
#: model:res.groups,name:base_import_security_group.group_import_csv
msgid "Import CSV/Excel files"
msgstr "Uvoz CSV/Excel datoteka"

View file

@ -0,0 +1,33 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * base_import_security_group
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-08-06 18:37+0000\n"
"PO-Revision-Date: 2015-08-06 18:37+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: base_import_security_group
#: model:ir.model,name:base_import_security_group.model_base
msgid "Base"
msgstr ""
#. module: base_import_security_group
#: model:ir.model,name:base_import_security_group.model_ir_http
msgid "HTTP Routing"
msgstr ""
#. module: base_import_security_group
#: model:res.groups,name:base_import_security_group.group_import_csv
#, fuzzy
msgid "Import CSV/Excel files"
msgstr "Importar arxius CSV"

View file

@ -0,0 +1,37 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * base_import_security_group
#
# Translators:
# Niki Waibel <niki.waibel@gmail.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-07-26 11:57+0000\n"
"PO-Revision-Date: 2017-07-26 11:57+0000\n"
"Last-Translator: Niki Waibel <niki.waibel@gmail.com>, 2017\n"
"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\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: base_import_security_group
#: model:ir.model,name:base_import_security_group.model_base
msgid "Base"
msgstr ""
#. module: base_import_security_group
#: model:ir.model,name:base_import_security_group.model_ir_http
msgid "HTTP Routing"
msgstr ""
#. module: base_import_security_group
#: model:res.groups,name:base_import_security_group.group_import_csv
msgid "Import CSV/Excel files"
msgstr ""
#~ msgid "base"
#~ msgstr "base"

View file

@ -0,0 +1,38 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * base_import_security_group
#
# Translators:
# Fernando Lara <gennesis45@gmail.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-07-26 11:57+0000\n"
"PO-Revision-Date: 2023-11-13 21:40+0000\n"
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\n"
"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n"
"Language: es\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 4.17\n"
#. module: base_import_security_group
#: model:ir.model,name:base_import_security_group.model_base
msgid "Base"
msgstr "Base"
#. module: base_import_security_group
#: model:ir.model,name:base_import_security_group.model_ir_http
msgid "HTTP Routing"
msgstr "Ruta HTTP"
#. module: base_import_security_group
#: model:res.groups,name:base_import_security_group.group_import_csv
msgid "Import CSV/Excel files"
msgstr "Importar archivos CSV/Excel"
#~ msgid "base"
#~ msgstr "base de datos"

View file

@ -0,0 +1,33 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * base_import_security_group
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-08-06 18:37+0000\n"
"PO-Revision-Date: 2015-08-06 18:37+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: base_import_security_group
#: model:ir.model,name:base_import_security_group.model_base
msgid "Base"
msgstr ""
#. module: base_import_security_group
#: model:ir.model,name:base_import_security_group.model_ir_http
msgid "HTTP Routing"
msgstr ""
#. module: base_import_security_group
#: model:res.groups,name:base_import_security_group.group_import_csv
#, fuzzy
msgid "Import CSV/Excel files"
msgstr "Importation de fichiers CSV"

View file

@ -0,0 +1,33 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * base_import_security_group
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-08-06 18:37+0000\n"
"PO-Revision-Date: 2015-08-06 18:37+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: base_import_security_group
#: model:ir.model,name:base_import_security_group.model_base
msgid "Base"
msgstr ""
#. module: base_import_security_group
#: model:ir.model,name:base_import_security_group.model_ir_http
msgid "HTTP Routing"
msgstr ""
#. module: base_import_security_group
#: model:res.groups,name:base_import_security_group.group_import_csv
#, fuzzy
msgid "Import CSV/Excel files"
msgstr "Importar arquivos CSV"

View file

@ -0,0 +1,38 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * base_import_security_group
#
# Translators:
# Bole <bole@dajmi5.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-03-02 18:40+0000\n"
"PO-Revision-Date: 2018-03-02 18:40+0000\n"
"Last-Translator: Bole <bole@dajmi5.com>, 2017\n"
"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n"
"Language: hr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
#. module: base_import_security_group
#: model:ir.model,name:base_import_security_group.model_base
msgid "Base"
msgstr ""
#. module: base_import_security_group
#: model:ir.model,name:base_import_security_group.model_ir_http
msgid "HTTP Routing"
msgstr ""
#. module: base_import_security_group
#: model:res.groups,name:base_import_security_group.group_import_csv
msgid "Import CSV/Excel files"
msgstr "Uvoz CSV/Excel datoteka"
#~ msgid "base"
#~ msgstr "base"

View file

@ -0,0 +1,28 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * base_import_security_group
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-08-06 18:37+0000\n"
"PO-Revision-Date: 2023-12-28 15:22+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
"Language-Team: \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 4.17\n"
#. module: base_import_security_group
#: model:ir.model,name:base_import_security_group.model_base
msgid "Base"
msgstr "Base"
#. module: base_import_security_group
#: model:res.groups,name:base_import_security_group.group_import_csv
msgid "Import CSV/Excel files"
msgstr "Importa file CSV/Excel"

View file

@ -0,0 +1,28 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * base_import_security_group
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-08-06 18:37+0000\n"
"PO-Revision-Date: 2015-08-06 18:37+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: base_import_security_group
#: model:ir.model,name:base_import_security_group.model_base
msgid "Base"
msgstr ""
#. module: base_import_security_group
#: model:res.groups,name:base_import_security_group.group_import_csv
#, fuzzy
msgid "Import CSV/Excel files"
msgstr "Importar arquivos CSV"

View file

@ -0,0 +1,28 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * base_import_security_group
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-08-06 18:37+0000\n"
"PO-Revision-Date: 2015-08-06 18:37+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: base_import_security_group
#: model:ir.model,name:base_import_security_group.model_base
msgid "Base"
msgstr ""
#. module: base_import_security_group
#: model:res.groups,name:base_import_security_group.group_import_csv
#, fuzzy
msgid "Import CSV/Excel files"
msgstr "Importovať súbory CSV"

View file

@ -0,0 +1,6 @@
# Copyright 2015 Anubía, soluciones en la nube,SL (http://www.anubia.es)
# Copyright 2017 Onestein (http://www.onestein.eu)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import base
from . import ir_http

View file

@ -0,0 +1,36 @@
# Copyright 2015 Anubía, soluciones en la nube,SL (http://www.anubia.es)
# Copyright 2017 Onestein (http://www.onestein.eu)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import logging
from odoo import api, models
_logger = logging.getLogger(__name__)
class Base(models.AbstractModel):
_inherit = "base"
@api.model
def load(self, fields, data):
"""Overriding this method we only allow its execution
if current user belongs to the group allowed for CSV data import.
An exception is raised otherwise, and also log the import attempt.
"""
current_user = self.env.user
allowed_group = "base_import_security_group.group_import_csv"
allowed_group_id = self.env.ref(allowed_group, raise_if_not_found=False)
if not allowed_group_id or current_user.has_group(allowed_group):
res = super().load(fields=fields, data=data)
else:
msg = ("User (ID: %s) is not allowed to import data " "in model %s.") % (
self.env.uid,
self._name,
)
_logger.info(msg)
messages = []
info = {}
messages.append(dict(info, type="error", message=msg, moreinfo=None))
res = {"ids": None, "messages": messages}
return res

View file

@ -0,0 +1,19 @@
# Copyright 2021 Opener B.V. <stefan@opener.amsterdam>
# Copyright 2017 Antonio Esposito <a.esposito@onestein.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models
from odoo.http import request
class Http(models.AbstractModel):
_inherit = "ir.http"
def session_info(self):
"""Expose in the env whether the user is allowed to import records"""
res = super().session_info()
allowed_group = "base_import_security_group.group_import_csv"
allowed_group_id = request.env.ref(allowed_group, raise_if_not_found=False)
res["base_import_security_group__allow_import"] = (
1 if allowed_group_id and request.env.user.has_group(allowed_group) else 0
)
return res

View file

@ -0,0 +1,20 @@
* Alejandro Santana <alejandrosantana@anubia.es>
* Antonio Esposito <a.esposito@onestein.nl>
* Druidoo <https://www.druidoo.io>
* `Tecnativa <https://www.tecnativa.com>`_:
* Víctor Martínez
* `Open Source Integrators <https://www.opensourceintegrators.com/>`_:
* Daniel Reis
* Chandresh Thakkar
* `Opener B.V. <https://opener.amsterdam/>`_:
* Stefan Rijnhart <stefan@opener.amsterdam>
* `ACSONE SA/NV <https://acsone.eu/>`_:
* Souheil Bejaoui <souheil.bejaoui@acsone.eu>

View file

@ -0,0 +1,9 @@
This module makes importing data from CSV and Excel files optional for each user,
depending on whether `Import CSV/Excel files` is ticked on the `Access Rights`
tab on the user form. This corresponds to a user group by the same name.
Only users that belong to this group will have the `Import records` button
available under the `Favorites` button of each list or kanban view.
If this GUI restriction is circumvented (through a crafted JSONRPC call for
instance), there is another check in the backend to prevent batch imports by
restricted users.

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!-- GROUPS -->
<record id="group_import_csv" model="res.groups">
<field name="name">Import CSV/Excel files</field>
<field
name="users"
eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"
/>
</record>
</odoo>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

View file

@ -0,0 +1,168 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
id="svg2"
version="1.1"
inkscape:version="0.48.4 r9939"
width="128"
height="128"
sodipodi:docname="icon.svg"
inkscape:export-filename="icon.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90">
<metadata
id="metadata8">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs6">
<linearGradient
id="linearGradient3779">
<stop
style="stop-color:#ff6600;stop-opacity:1;"
offset="0"
id="stop3781" />
<stop
style="stop-color:#ffcc00;stop-opacity:1;"
offset="1"
id="stop3783" />
</linearGradient>
<linearGradient
id="linearGradient3798">
<stop
style="stop-color:#99cc00;stop-opacity:1;"
offset="0"
id="stop3800" />
<stop
style="stop-color:#669900;stop-opacity:1;"
offset="1"
id="stop3802" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3798"
id="linearGradient3804"
x1="64"
y1="124"
x2="64"
y2="4"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(-140,0)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3798"
id="linearGradient4053"
gradientUnits="userSpaceOnUse"
x1="64"
y1="124"
x2="64"
y2="4" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3779"
id="linearGradient3874"
x1="64"
y1="136"
x2="64"
y2="8"
gradientUnits="userSpaceOnUse" />
</defs>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1025"
id="namedview4"
showgrid="false"
inkscape:zoom="1.4142136"
inkscape:cx="24.182947"
inkscape:cy="79.115464"
inkscape:window-x="-2"
inkscape:window-y="-3"
inkscape:window-maximized="1"
inkscape:current-layer="svg2"
inkscape:snap-bbox="false"
inkscape:bbox-paths="true"
inkscape:bbox-nodes="true"
inkscape:snap-bbox-edge-midpoints="true"
inkscape:snap-bbox-midpoints="true"
inkscape:object-paths="true"
inkscape:snap-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
inkscape:snap-page="false"
inkscape:snap-smooth-nodes="true"
inkscape:object-nodes="true"
inkscape:snap-intersection-paths="true"
inkscape:snap-grids="false"
showguides="true"
inkscape:guide-bbox="true"
borderlayer="true"
inkscape:snap-nodes="false"
inkscape:snap-global="true">
<inkscape:grid
type="xygrid"
id="grid2984"
empspacing="4"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true"
dotted="false" />
</sodipodi:namedview>
<rect
style="fill:#ff7f2a;fill-opacity:1;stroke:none"
id="rect3858"
width="128"
height="128"
x="-128"
y="0"
transform="matrix(0,-1,1,0,0,0)" />
<text
xml:space="preserve"
style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
x="-184.20132"
y="6.0240803"
id="text2995"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan2997"
x="-184.20132"
y="6.0240803" /></text>
<path
style="fill:#c87137;fill-opacity:1;stroke:none"
d="M 48.46875 39.1875 L 0 87.65625 L 0 128 L 76.78125 128 L 102.90625 101.875 L 99.53125 98.5 L 101.9375 96.0625 L 92.71875 86.8125 L 90.28125 89.25 L 80.09375 79.0625 L 80.0625 79.125 L 78.96875 78.03125 L 68.09375 88.90625 L 69.1875 89.96875 L 64.75 94.40625 L 59.90625 89.53125 L 72.34375 77.09375 L 67.6875 72.4375 L 87.71875 52.40625 L 78.5 43.15625 L 65.46875 56.1875 L 48.46875 39.1875 z "
id="rect3087" />
<path
id="path3027"
d="m 85.85809,93.664544 q 0,-1.26855 -0.92703,-2.195567 -0.92701,-0.927017 -2.19556,-0.927017 -1.26855,0 -2.19557,0.927017 -0.92702,0.927017 -0.92702,2.195567 0,1.268548 0.92702,2.195566 0.92702,0.927017 2.19557,0.927017 1.26855,0 2.19556,-0.927017 0.92703,-0.927018 0.92703,-2.195566 z m 12.49033,0 q 0,-1.26855 -0.92702,-2.195567 -0.92702,-0.927017 -2.19556,-0.927017 -1.26856,0 -2.19557,0.927017 -0.92702,0.927017 -0.92702,2.195567 0,1.268548 0.92702,2.195566 0.92701,0.927017 2.19557,0.927017 1.26854,0 2.19556,-0.927017 0.92702,-0.927018 0.92702,-2.195566 z M 104.59359,82.7355 v 15.612919 q 0,1.951621 -1.36614,3.317751 -1.36613,1.36613 -3.31774,1.36613 H 28.09028 q -1.95161,0 -3.31774,-1.36613 -1.36613,-1.36613 -1.36613,-3.317751 V 82.7355 q 0,-1.951615 1.36613,-3.317745 1.36613,-1.36613 3.31774,-1.36613 h 20.83349 q 1.0246,2.73226 3.43972,4.488715 2.41512,1.756452 5.39134,1.756452 h 12.49033 q 2.97621,0 5.39134,-1.756452 2.41512,-1.756455 3.43972,-4.488715 h 20.83349 q 1.95161,0 3.31774,1.36613 1.36614,1.36613 1.36614,3.317745 z M 88.73671,51.119343 q -0.82943,1.951614 -2.87862,1.951614 H 73.36775 v 21.858085 q 0,1.26855 -0.92702,2.195567 -0.92702,0.927017 -2.19557,0.927017 H 57.75483 q -1.26855,0 -2.19557,-0.927017 -0.92701,-0.927017 -0.92701,-2.195567 V 53.070957 H 42.14191 q -2.04919,0 -2.87863,-1.951614 -0.82944,-1.902825 0.68306,-3.366536 L 61.80443,25.894722 Q 62.68265,24.967705 64,24.967705 q 1.31733,0 2.19556,0.927017 l 21.85809,21.858085 q 1.5125,1.463711 0.68306,3.366536 z"
inkscape:connector-curvature="0"
style="fill:#ffffff" />
<path
id="path3016"
d="m 66.979191,59.343527 v 4.895685 q 0,0.326379 -0.244778,0.571165 -0.244797,0.244783 -0.571181,0.244783 h -4.895668 q -0.326383,0 -0.571181,-0.244783 -0.244777,-0.244786 -0.244777,-0.571165 v -4.895685 q 0,-0.32638 0.244777,-0.571163 0.244798,-0.244785 0.571181,-0.244785 h 4.895668 q 0.326384,0 0.571181,0.244785 0.244778,0.244783 0.244778,0.571163 z M 73.42517,47.104314 q 0,1.101528 -0.316172,2.060266 -0.316173,0.958739 -0.713951,1.560501 -0.397778,0.601761 -1.121941,1.213721 -0.724141,0.611962 -1.172913,0.887343 -0.448772,0.275383 -1.244329,0.724154 -0.836339,0.469171 -1.397309,1.325916 -0.56097,0.856745 -0.56097,1.366711 0,0.346777 -0.244778,0.662957 -0.244777,0.316181 -0.57116,0.316181 h -4.895689 q -0.305982,0 -0.520167,-0.377377 -0.214185,-0.377375 -0.214185,-0.76495 v -0.917942 q 0,-1.69309 1.325914,-3.192395 1.325915,-1.499303 2.917008,-2.213257 1.203525,-0.550764 1.713502,-1.142326 0.509956,-0.591562 0.509956,-1.5503 0,-0.856745 -0.948537,-1.509503 -0.948538,-0.652759 -2.192846,-0.652759 -1.325915,0 -2.203057,0.591562 -0.713971,0.509966 -2.182676,2.345849 -0.265178,0.326379 -0.632345,0.326379 -0.244797,0 -0.509976,-0.163189 L 54.903171,45.45202 q -0.265199,-0.203986 -0.316193,-0.509968 -0.05099,-0.30598 0.112198,-0.571163 3.263793,-5.426052 9.464994,-5.426052 1.631896,0 3.284194,0.632361 1.652298,0.632359 2.978212,1.69309 1.325915,1.060732 2.162254,2.600834 0.83634,1.540099 0.83634,3.233192 z"
inkscape:connector-curvature="0"
style="fill:#c87137" />
</svg>

After

Width:  |  Height:  |  Size: 7.8 KiB

View file

@ -0,0 +1,448 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>Optional CSV import</title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
border: 0 }
table.borderless td, table.borderless th {
/* Override padding for "table.docutils td" with "! important".
The right padding separates the table cells. */
padding: 0 0.5em 0 0 ! important }
.first {
/* Override more specific margin styles with "! important". */
margin-top: 0 ! important }
.last, .with-subtitle {
margin-bottom: 0 ! important }
.hidden {
display: none }
.subscript {
vertical-align: sub;
font-size: smaller }
.superscript {
vertical-align: super;
font-size: smaller }
a.toc-backref {
text-decoration: none ;
color: black }
blockquote.epigraph {
margin: 2em 5em ; }
dl.docutils dd {
margin-bottom: 0.5em }
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
overflow: hidden;
}
/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
font-weight: bold }
*/
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error {
color: red ;
font-weight: bold ;
font-family: sans-serif }
/* Uncomment (and remove this text!) to get reduced vertical space in
compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
margin-bottom: 0.5em }
div.compound .compound-last, div.compound .compound-middle {
margin-top: 0.5em }
*/
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em ;
margin-right: 2em }
div.footer, div.header {
clear: both;
font-size: smaller }
div.line-block {
display: block ;
margin-top: 1em ;
margin-bottom: 1em }
div.line-block div.line-block {
margin-top: 0 ;
margin-bottom: 0 ;
margin-left: 1.5em }
div.sidebar {
margin: 0 0 0.5em 1em ;
border: medium outset ;
padding: 1em ;
background-color: #ffffee ;
width: 40% ;
float: right ;
clear: right }
div.sidebar p.rubric {
font-family: sans-serif ;
font-size: medium }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
margin-top: 0.4em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr.docutils {
width: 75% }
img.align-left, .figure.align-left, object.align-left, table.align-left {
clear: left ;
float: left ;
margin-right: 1em }
img.align-right, .figure.align-right, object.align-right, table.align-right {
clear: right ;
float: right ;
margin-left: 1em }
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
table.align-center {
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left }
.align-center {
clear: both ;
text-align: center }
.align-right {
text-align: right }
/* reset inner alignment in figures */
div.align-right {
text-align: inherit }
/* div.align-center * { */
/* text-align: left } */
.align-top {
vertical-align: top }
.align-middle {
vertical-align: middle }
.align-bottom {
vertical-align: bottom }
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.attribution {
text-align: right ;
margin-left: 50% }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.rubric {
font-weight: bold ;
font-size: larger ;
color: maroon ;
text-align: center }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font: inherit }
pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: grey; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.pre {
white-space: pre }
span.problematic {
color: red }
span.section-subtitle {
/* font-size relative to parent (h1..h6 element) */
font-size: 80% }
table.citation {
border-left: solid 1px gray;
margin-left: 1px }
table.docinfo {
margin: 2em 4em }
table.docutils {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.footnote {
border-left: solid 1px black;
margin-left: 1px }
table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
table.docutils th.field-name, table.docinfo th.docinfo-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap ;
padding-left: 0 }
/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
border: 0px;
border-top: 2px solid;
border-bottom: 2px solid;
border-collapse: collapse;
}
table.docutils.booktabs * {
border: 0px;
}
table.docutils.booktabs th {
border-bottom: thin solid;
text-align: left;
}
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% }
ul.auto-toc {
list-style-type: none }
</style>
</head>
<body>
<div class="document" id="optional-csv-import">
<h1 class="title">Optional CSV import</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:fe2d7959aa71ca276bb4b9fb395d9588490642e013a064a6c332860fa24edfeb
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/server-ux/tree/16.0/base_import_security_group"><img alt="OCA/server-ux" src="https://img.shields.io/badge/github-OCA%2Fserver--ux-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/server-ux-16-0/server-ux-16-0-base_import_security_group"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/server-ux&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module makes importing data from CSV and Excel files optional for each user,
depending on whether <cite>Import CSV/Excel files</cite> is ticked on the <cite>Access Rights</cite>
tab on the user form. This corresponds to a user group by the same name.
Only users that belong to this group will have the <cite>Import records</cite> button
available under the <cite>Favorites</cite> button of each list or kanban view.</p>
<p>If this GUI restriction is circumvented (through a crafted JSONRPC call for
instance), there is another check in the backend to prevent batch imports by
restricted users.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-1">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-2">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-3">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-4">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-5">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/server-ux/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/server-ux/issues/new?body=module:%20base_import_security_group%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#toc-entry-2">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2>
<ul class="simple">
<li>Alejandro Santana &lt;<a class="reference external" href="mailto:alejandrosantana&#64;anubia.es">alejandrosantana&#64;anubia.es</a>&gt;</li>
<li>Onestein</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
<ul class="simple">
<li>Alejandro Santana &lt;<a class="reference external" href="mailto:alejandrosantana&#64;anubia.es">alejandrosantana&#64;anubia.es</a>&gt;</li>
<li>Antonio Esposito &lt;<a class="reference external" href="mailto:a.esposito&#64;onestein.nl">a.esposito&#64;onestein.nl</a>&gt;</li>
<li>Druidoo &lt;<a class="reference external" href="https://www.druidoo.io">https://www.druidoo.io</a>&gt;</li>
<li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:<ul>
<li>Víctor Martínez</li>
</ul>
</li>
<li><a class="reference external" href="https://www.opensourceintegrators.com/">Open Source Integrators</a>:<ul>
<li>Daniel Reis</li>
<li>Chandresh Thakkar</li>
</ul>
</li>
<li><a class="reference external" href="https://opener.amsterdam/">Opener B.V.</a>:<ul>
<li>Stefan Rijnhart &lt;<a class="reference external" href="mailto:stefan&#64;opener.amsterdam">stefan&#64;opener.amsterdam</a>&gt;</li>
</ul>
</li>
<li><a class="reference external" href="https://acsone.eu/">ACSONE SA/NV</a>:<ul>
<li>Souheil Bejaoui &lt;<a class="reference external" href="mailto:souheil.bejaoui&#64;acsone.eu">souheil.bejaoui&#64;acsone.eu</a>&gt;</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-ux/tree/16.0/base_import_security_group">OCA/server-ux</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
</div>
</body>
</html>

View file

@ -0,0 +1,25 @@
/** @odoo-module **/
/*
* Copyright 2023 ACSONE SA/NV
* Copyright 2021 Stefan Rijnhart <stefan@opener.amsterdam>
* Copyright 2021 Chandresh Thakkar OSI <cthakkar@opensourceintegrators.com>
* Copyright 2019 Iryna Vushnevska <i.vyshnevska@mobilunity.com>
* Copyright 2017 Antonio Esposito <a.esposito@onestein.nl>
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
*
* Patch the method on the ImportMenu class that determines whether the
* import button under Favorites will be displayed to return false if the
* user does not belong to this module's access group.
*/
import {importRecordsItem} from "@base_import/import_records/import_records";
import {session} from "@web/session";
const isDisplayed_orig = importRecordsItem.isDisplayed;
importRecordsItem.isDisplayed = function (config, isSmall) {
return (
isDisplayed_orig(config, isSmall) &&
session.base_import_security_group__allow_import === 1
);
};

View file

@ -0,0 +1,70 @@
odoo.define("base_import_security_group.tour", function (require) {
"use strict";
var tour = require("web_tour.tour");
tour.register(
"button_import_ok",
{
test: true,
url: "/web",
},
[
{
trigger: ".o_navbar_apps_menu > button.dropdown-toggle",
},
{
id: "settings_menu_click",
trigger: '[data-menu-xmlid="base.menu_administration"]',
},
{
id: "settings_menu_users_and_companies",
trigger: '.dropdown-toggle[data-menu-xmlid="base.menu_users"]',
},
{
id: "settings_menu_companies",
trigger:
'.dropdown-item[data-menu-xmlid="base.menu_action_res_company_form"]',
},
{
id: "favorites_dropdown_click",
trigger: ".o_favorite_menu > .dropdown-toggle",
},
{
trigger: "span.o_import_menu",
},
]
);
tour.register(
"button_import_ko",
{
test: true,
url: "/web",
},
[
{
trigger: ".o_navbar_apps_menu > button.dropdown-toggle",
},
{
id: "settings_menu_click",
trigger: '[data-menu-xmlid="base.menu_administration"]',
},
{
id: "settings_menu_users_and_companies",
trigger: '.dropdown-toggle[data-menu-xmlid="base.menu_users"]',
},
{
id: "settings_menu_companies",
trigger:
'.dropdown-item[data-menu-xmlid="base.menu_action_res_company_form"]',
},
{
id: "favorites_dropdown_click",
trigger: ".o_favorite_menu > .dropdown-toggle",
},
{
trigger: ".dropdown-menu:not(:has(span.o_import_menu))",
},
]
);
});

View file

@ -0,0 +1,4 @@
# Copyright 2017 Onestein (http://www.onestein.eu)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import test_base_import_security_group

View file

@ -0,0 +1,63 @@
# Copyright 2017 Onestein (http://www.onestein.eu)
# Copyright 2021 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.tests import common, tagged
from odoo.tools import mute_logger
@tagged("-at_install", "post_install")
class TestImportSecurityGroup(common.HttpCase):
def setUp(self):
super().setUp()
self.Access = self.env["ir.model.access"]
self.user_test = self.env.ref("base.user_demo")
self.user_admin = self.env.ref("base.user_admin")
self.fields = (
"id",
"name",
"perm_read",
"perm_write",
"perm_create",
"perm_unlink",
)
self.data = [
("access_res_users_test", "res.users test", "1", "0", "0", "0"),
("access_res_users_test2", "res.users test2", "1", "1", "1", "1"),
]
def test_import_button(self):
"""Whether or not the import button is available depending on permissions"""
self.start_tour("/web", "button_import_ok", login="admin")
group = self.env.ref("base_import_security_group.group_import_csv")
group.users -= self.user_admin
self.start_tour("/web", "button_import_ko", login="admin")
def test_access_admin(self):
"""Admin user can import data"""
with mute_logger("odoo.sql_db"):
res = self.Access.with_user(self.user_admin).load(self.fields, self.data)
self.assertEqual(res["ids"], False)
self.assertEqual(len(res["messages"]), 2)
self.assertEqual(
res["messages"][0]["message"],
"Missing required value for the field 'Model' (model_id)",
)
self.assertEqual(
res["messages"][1]["message"],
"Missing required value for the field 'Model' (model_id)",
)
def test_access_demo(self):
"""Demo user cannot import data"""
self.user_test.write({"groups_id": [(4, self.ref("base.group_system"))]})
self.start_tour("/web", "button_import_ko", login="demo")
res2 = self.Access.with_user(self.user_test).load(self.fields, self.data)
self.assertEqual(res2["ids"], None)
self.assertEqual(len(res2["messages"]), 1)
self.assertEqual(
res2["messages"][0]["message"],
"User (ID: %s) is not allowed to import data in "
"model ir.model.access." % self.user_test.id,
)

View file

@ -0,0 +1,32 @@
# Architecture
```mermaid
flowchart TD
U[Users] -->|HTTP| V[Views and QWeb Templates]
V --> C[Controllers]
V --> W[Wizards Transient Models]
C --> M[Models and ORM]
W --> M
M --> R[Reports]
DX[Data XML] --> M
S[Security ACLs and Groups] -. enforces .-> M
subgraph Base_import_security_group Module - base_import_security_group
direction LR
M:::layer
W:::layer
C:::layer
V:::layer
R:::layer
S:::layer
DX:::layer
end
classDef layer fill:#eef8ff,stroke:#6ea8fe,stroke-width:1px
```
Notes
- Views include tree/form/kanban templates and report templates.
- Controllers provide website/portal routes when present.
- Wizards are UI flows implemented with `models.TransientModel`.
- Data XML loads data/demo records; Security defines groups and access.

View file

@ -0,0 +1,3 @@
# Configuration
Refer to Odoo settings for base_import_security_group. Configure related models, access rights, and options as needed.

View file

@ -0,0 +1,3 @@
# Controllers
This module does not define custom HTTP controllers.

View file

@ -0,0 +1,7 @@
# Dependencies
This addon depends on:
- [web](../../odoo-bringout-oca-ocb-web)
- [web_tour](../../odoo-bringout-oca-ocb-web_tour)
- [base_import](../../odoo-bringout-oca-ocb-base_import)

View file

@ -0,0 +1,4 @@
# FAQ
- Q: Which Odoo version? A: 16.0 (OCA/OCB packaged).
- Q: How to enable? A: Start server with --addon base_import_security_group or install in UI.

View file

@ -0,0 +1,7 @@
# Install
```bash
pip install odoo-bringout-oca-server-ux-base_import_security_group"
# or
uv pip install odoo-bringout-oca-server-ux-base_import_security_group"
```

View file

@ -0,0 +1,13 @@
# Models
Detected core models and extensions in base_import_security_group.
```mermaid
classDiagram
class base
class ir_http
```
Notes
- Classes show model technical names; fields omitted for brevity.
- Items listed under _inherit are extensions of existing models.

View file

@ -0,0 +1,6 @@
# Overview
Packaged Odoo addon: base_import_security_group. Provides features documented in upstream Odoo 16 under this addon.
- Source: OCA/OCB 16.0, addon base_import_security_group
- License: LGPL-3

View file

@ -0,0 +1,3 @@
# Reports
This module does not define custom reports.

View file

@ -0,0 +1,74 @@
# Security
Access control and security definitions in base_import_security_group.
## Access Control Lists (ACLs)
Model access permissions defined in:
- **[all_odoo_addons_repos.txt](../all_odoo_addons_repos.txt)**
- 318 model access rules
- **[bosnian_translations.json](../bosnian_translations.json)**
- 50 model access rules
- **[bosnian_translations_output.json](../bosnian_translations_output.json)**
- 444 model access rules
- **[CHANGELOG.md](../CHANGELOG.md)**
- 132 model access rules
- **[delete_all_odoo_addons.sh](../delete_all_odoo_addons.sh)**
- 50 model access rules
- **[delete_odoo_addons.sh](../delete_odoo_addons.sh)**
- 44 model access rules
- **[doc](../doc)**
- **[docker](../docker)**
- **[input](../input)**
- **[nix](../nix)**
- **[odoo.conf](../odoo.conf)**
- 58 model access rules
- **[odoo_packages_bez_l10n.txt](../odoo_packages_bez_l10n.txt)**
- 1947 model access rules
- **[odoo_packages_bringout.txt](../odoo_packages_bringout.txt)**
- 1947 model access rules
- **[odoo_packages.txt](../odoo_packages.txt)**
- 2085 model access rules
- **[output](../output)**
- **[packages](../packages)**
- **[PACKAGES.md](../PACKAGES.md)**
- 298 model access rules
- **[README.md](../README.md)**
- 338 model access rules
- **[scripts](../scripts)**
- **[temp](../temp)**
- **[TRANSLATION_BS_SUMMARY.md](../TRANSLATION_BS_SUMMARY.md)**
- 146 model access rules
- **[verify_deletions.sh](../verify_deletions.sh)**
- 55 model access rules
## Record Rules
Row-level security rules defined in:
## Security Groups & Configuration
Security groups and permissions defined in:
- **[base_import_security_group_security.xml](../base_import_security_group/security/base_import_security_group_security.xml)**
- 1 security groups defined
```mermaid
graph TB
subgraph "Security Layers"
A[Users] --> B[Groups]
B --> C[Access Control Lists]
C --> D[Models]
B --> E[Record Rules]
E --> F[Individual Records]
end
```
Security files overview:
- **[base_import_security_group_security.xml](../base_import_security_group/security/base_import_security_group_security.xml)**
- Security groups, categories, and XML-based rules
Notes
- Access Control Lists define which groups can access which models
- Record Rules provide row-level security (filter records by user/group)
- Security groups organize users and define permission sets
- All security is enforced at the ORM level by Odoo

View file

@ -0,0 +1,5 @@
# Troubleshooting
- Ensure Python and Odoo environment matches repo guidance.
- Check database connectivity and logs if startup fails.
- Validate that dependent addons listed in DEPENDENCIES.md are installed.

View file

@ -0,0 +1,7 @@
# Usage
Start Odoo including this addon (from repo root):
```bash
python3 scripts/nix_odoo_web_server.py --db-name mydb --addon base_import_security_group
```

View file

@ -0,0 +1,3 @@
# Wizards
This module does not include UI wizards.

View file

@ -0,0 +1,44 @@
[project]
name = "odoo-bringout-oca-server-ux-base_import_security_group"
version = "16.0.0"
description = "Optional CSV import - Group-based permissions for importing CSV files"
authors = [
{ name = "Ernad Husremovic", email = "hernad@bring.out.ba" }
]
dependencies = [
"odoo-bringout-oca-ocb-web>=16.0.0",
"odoo-bringout-oca-ocb-web_tour>=16.0.0",
"odoo-bringout-oca-server-ux-base_import>=16.0.0",
"requests>=2.25.1"
]
readme = "README.md"
requires-python = ">= 3.11"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Office/Business",
]
[project.urls]
homepage = "https://github.com/bringout/0"
repository = "https://github.com/bringout/0"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.build.targets.wheel]
packages = ["base_import_security_group"]
[tool.rye]
managed = true
dev-dependencies = [
"pytest>=8.4.1",
]