Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
abdawone committed Feb 14, 2023
1 parent 6f42a64 commit dcec6f3
Show file tree
Hide file tree
Showing 776 changed files with 100,151 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ibel_pos/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-

25 changes: 25 additions & 0 deletions ibel_pos/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
{
'name': "ibel_pos",

'summary': """
Customize Ibel POS
""",
'description': """
Customize Ibel POS
""",

'author': "Ibel technology",
'website': "https://ibeltechnology.com.com",
'license': 'LGPL-3',

'category': 'Uncategorized',
'version': '14.0',
'depends': ['base','web','point_of_sale'],

'qweb': ['static/src/xml/Chrome.xml'],
'data': [
'views/templates.xml',
],
"auto_install": True,
}
Binary file added ibel_pos/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file added ibel_pos/static/src/img/favicon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions ibel_pos/static/src/img/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions ibel_pos/static/src/js/abstract_web_client.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
odoo.define('ibel_pos.WebClient', function (require) {

"use strict";

var AbstractWebClient = require('web.AbstractWebClient');
AbstractWebClient = AbstractWebClient.include({
init: function() {
this._super.apply(this, arguments);
this.set('title_part', {"zopenerp": 'Ibel'});
}
});
});
9 changes: 9 additions & 0 deletions ibel_pos/static/src/xml/Chrome.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<template xml:space="preserve">
<t t-inherit="point_of_sale.Chrome" t-inherit-mode="extension" owl="1">
<xpath expr="//img[@class='pos-logo']" position="replace">
<img class="pos-logo" t-on-click="trigger('toggle-debug-widget')"
src="/ibel_pos/static/src/img/logo.svg" alt="Logo" />
</xpath>
</t>
</template>
19 changes: 19 additions & 0 deletions ibel_pos/views/templates.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8" ?>

<odoo>

<template id="pos_title_debrand" inherit_id="point_of_sale.index">
<xpath expr="//title" position="replace">
<title>Ibel POS</title>
</xpath>
<xpath expr="//link" position="replace">
<link type="image/x-icon" rel="shortcut icon" t-att-href="x_icon or '/ibel_pos/static/src/img/favicon.ico'"/>
</xpath>
</template>

<template id="debranding_title_pos" name="Debranding title pos JS" inherit_id="point_of_sale.assets">
<xpath expr="." position="inside">
<script type="text/javascript" src="/ibel_pos/static/src/js/abstract_web_client.js"/>
</xpath>
</template>
</odoo>
84 changes: 84 additions & 0 deletions web_access_rule_buttons/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
========================
Web Access Rules Buttons
========================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! 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%2Fweb-lightgray.png?logo=github
:target: https://github.com/OCA/web/tree/14.0/web_access_rule_buttons
:alt: OCA/web
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/web-14-0/web-14-0-web_access_rule_buttons
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/162/14.0
:alt: Try me on Runbot

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

This addon disables the Edit button on the form views if the user
cannot edit the current record according to the record access rules.

**Table of contents**

.. contents::
:local:

Usage
=====

When using Odoo, even if a user has no rights to edit a record, the Edit button
is shown. The user can edit the record but won't be able to save his changes.
Now, the user won't be able to click on the Edit button.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/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/web/issues/new?body=module:%20web_access_rule_buttons%0Aversion:%2014.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
~~~~~~~

* Camptocamp
* Onestein

Contributors
~~~~~~~~~~~~

* Guewen Baconnier <[email protected]>
* Antonio Esposito <[email protected]>
* Dhara Solanki <[email protected]>

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/web <https://github.com/OCA/web/tree/14.0/web_access_rule_buttons>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions web_access_rule_buttons/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import models
19 changes: 19 additions & 0 deletions web_access_rule_buttons/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2016 Camptocamp SA
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Web Access Rules Buttons",
"summary": "Disable Edit button if access rules prevent this action",
"version": "14.0.1.0.1",
"author": "Camptocamp, Onestein, Odoo Community Association (OCA)",
"license": "AGPL-3",
"category": "Web",
"depends": [
"web",
],
"website": "https://github.com/OCA/web",
"data": [
"views/web_access_rule_buttons.xml",
],
"installable": True,
}
22 changes: 22 additions & 0 deletions web_access_rule_buttons/i18n/de.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_access_rule_buttons
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2021-10-13 20:46+0000\n"
"Last-Translator: Corneliuus <[email protected]>\n"
"Language-Team: none\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"
"X-Generator: Weblate 4.3.2\n"

#. module: web_access_rule_buttons
#: model:ir.model,name:web_access_rule_buttons.model_base
msgid "Base"
msgstr "Basis"
19 changes: 19 additions & 0 deletions web_access_rule_buttons/i18n/web_access_rule_buttons.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_access_rule_buttons
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.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: web_access_rule_buttons
#: model:ir.model,name:web_access_rule_buttons.model_base
msgid "Base"
msgstr ""
3 changes: 3 additions & 0 deletions web_access_rule_buttons/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import models
37 changes: 37 additions & 0 deletions web_access_rule_buttons/models/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright 2016 Camptocamp SA
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import exceptions, models


class Base(models.AbstractModel):
"""The base model, which is implicitly inherited by all models."""

_inherit = "base"

def check_access_rule_all(self, operations=None):
"""Verifies that the operation given by ``operations`` is allowed for
the user according to ir.rules.
If ``operations`` is empty, it returns the result for all actions.
:param operation: a list of ``read``, ``create``, ``write``, ``unlink``
:return: {operation: access} (access is a boolean)
"""
if not operations or not any(operations):
operations = ["read", "create", "write", "unlink"]
result = {}
for operation in operations:
if self.is_transient() or not self.ids:
# If we call check_access_rule() without id, it will try to
# run a SELECT without ID which will crash, so we just blindly
# allow the operations
result[operation] = True
continue
try:
self.check_access_rule(operation)
except exceptions.AccessError:
result[operation] = False
else:
result[operation] = True
return result
3 changes: 3 additions & 0 deletions web_access_rule_buttons/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* Guewen Baconnier <[email protected]>
* Antonio Esposito <[email protected]>
* Dhara Solanki <[email protected]>
2 changes: 2 additions & 0 deletions web_access_rule_buttons/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This addon disables the Edit button on the form views if the user
cannot edit the current record according to the record access rules.
3 changes: 3 additions & 0 deletions web_access_rule_buttons/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
When using Odoo, even if a user has no rights to edit a record, the Edit button
is shown. The user can edit the record but won't be able to save his changes.
Now, the user won't be able to click on the Edit button.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit dcec6f3

Please sign in to comment.