Skip to content

Commit

Permalink
[11.0][MIG] base_import_security_group: adapt to v11
Browse files Browse the repository at this point in the history
  • Loading branch information
Iryna Vushnevska committed Jul 17, 2019
1 parent 8fff49c commit ad9e8b0
Show file tree
Hide file tree
Showing 11 changed files with 530 additions and 64 deletions.
75 changes: 48 additions & 27 deletions base_import_security_group/README.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,32 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl
:alt: License: AGPL-3
===================
Optional CSV import
===================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! 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-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--tools-lightgray.png?logo=github
:target: https://github.com/OCA/server-tools/tree/10.0/base_import_security_group
:alt: OCA/server-tools
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/server-tools-10-0/server-tools-10-0-base_import_security_group
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/149/10.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|

===============================================
Group-based permissions for importing CSV files
Group-based permissions for importing CSV files
===============================================

This module makes importing data from CSV and Excel files optional for each user,
Expand All @@ -12,51 +35,49 @@ Any other user not belonging to such group will not have the "Import" button
available anywhere. The action will even be blocked internally (to prevent
XMLRPC access, for example).

Usage
=====
**Table of contents**

To allow a user to import data from CSV and Excel files, just follow this steps:

* Go to *Settings/Users/Users* menu.
* Enter the user you want to allow.
* Within the "Access Rights" tab and "Technical Settings" group, check the
option "Allow importing CSV/Excel files".
.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues
<https://github.com/OCA/server-tools/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smash it by providing detailed and welcomed feedback.
Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-tools/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 <https://github.com/OCA/server-tools/issues/new?body=module:%20base_import_security_group%0Aversion:%2010.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>

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

Maintainer
----------
This module is maintained by the OCA.

.. 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 https://odoo-community.org.

Icon
----
This module is part of the `OCA/server-tools <https://github.com/OCA/server-tools/tree/10.0/base_import_security_group>`_ project on GitHub.

Iconic fonts used in module icon are Font Awesome: http://fontawesome.io/
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 0 additions & 1 deletion base_import_security_group/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# 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).
Expand Down
3 changes: 1 addition & 2 deletions base_import_security_group/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# -*- coding: utf-8 -*-
# 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).

{
'name': 'Optional CSV import',
'version': '10.0.1.0.0',
'version': '11.0.1.0.0',
'category': 'Server tools',
'summary': 'Group-based permissions for importing CSV files',
'license': 'AGPL-3',
Expand Down
1 change: 0 additions & 1 deletion base_import_security_group/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# 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).
Expand Down
3 changes: 1 addition & 2 deletions base_import_security_group/models/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# 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).
Expand Down Expand Up @@ -26,7 +25,7 @@ def load(self, fields, data):
raise_if_not_found=False
)
if not allowed_group_id or current_user.has_group(allowed_group):
res = super(Base, self).load(fields=fields, data=data)
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)
Expand Down
2 changes: 2 additions & 0 deletions base_import_security_group/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Alejandro Santana <alejandrosantana@anubia.es>
* Antonio Esposito <a.esposito@onestein.nl>
5 changes: 5 additions & 0 deletions base_import_security_group/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This module makes importing data from CSV and Excel files optional for each user,
allowing it only for those users belonging to a specific group.
Any other user not belonging to such group will not have the "Import" button
available anywhere. The action will even be blocked internally (to prevent
XMLRPC access, for example).
Loading

0 comments on commit ad9e8b0

Please sign in to comment.