Skip to content

Commit

Permalink
Merge PR #533 into 12.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Dec 3, 2019
2 parents c0a171c + cd81ced commit bb2af58
Show file tree
Hide file tree
Showing 14 changed files with 667 additions and 0 deletions.
98 changes: 98 additions & 0 deletions product_cost_security/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
=====================
Product Cost Security
=====================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
:target: https://odoo-community.org/page/development-status
:alt: Production/Stable
.. |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%2Fproduct--attribute-lightgray.png?logo=github
:target: https://github.com/OCA/product-attribute/tree/12.0/product_cost_security
:alt: OCA/product-attribute
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/product-attribute-12-0/product-attribute-12-0-product_cost_security
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/135/12.0
:alt: Try me on Runbot

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

Adds a security group for product cost price field.
Only users with this group can view this field.

**Table of contents**

.. contents::
:local:

Configuration
=============

To use this module you need to:

#. Go to a *Setting > Users and Companies > Users*.
#. Select a user and add "Access to product costs" group.

Usage
=====

To use this module you need to:

#. Go to product form view logged with this user and you will see the
standard_price field.

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

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

* Tecnativa

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

* Sergio Teruel <sergio.teruel@tecnativa.com>

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.

.. |maintainer-sergio-teruel| image:: https://github.com/sergio-teruel.png?size=40px
:target: https://github.com/sergio-teruel
:alt: sergio-teruel

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-sergio-teruel|

This module is part of the `OCA/product-attribute <https://github.com/OCA/product-attribute/tree/12.0/product_cost_security>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions product_cost_security/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import models
21 changes: 21 additions & 0 deletions product_cost_security/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2018 Tecnativa - Sergio Teruel
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
'name': 'Product Cost Security',
'summary': 'Product cost security restriction view',
'version': '12.0.1.0.0',
'development_status': 'Production/Stable',
'maintainers': ['sergio-teruel'],
'category': 'Product',
'website': 'https://github.com/OCA/product-attribute',
'author': 'Tecnativa, Odoo Community Association (OCA)',
'license': 'AGPL-3',
'application': False,
'installable': True,
'depends': [
'product',
],
'data': [
'security/product_cost_security.xml',
],
}
33 changes: 33 additions & 0 deletions product_cost_security/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * product_cost_security
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-11-16 15:34+0000\n"
"PO-Revision-Date: 2018-11-16 16:35+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 2.0.6\n"

#. module: product_cost_security
#: model:res.groups,name:product_cost_security.group_product_cost
msgid "Access to product costs"
msgstr "Acceso a ver el coste de productos"

#. module: product_cost_security
#: model:ir.model,name:product_cost_security.model_product_product
msgid "Product"
msgstr "Producto"

#. module: product_cost_security
#: model:ir.model,name:product_cost_security.model_product_template
msgid "Product Template"
msgstr "Plantilla de producto"
30 changes: 30 additions & 0 deletions product_cost_security/i18n/product_cost_security.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * product_cost_security
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.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: product_cost_security
#: model:res.groups,name:product_cost_security.group_product_cost
msgid "Access to product costs"
msgstr ""

#. module: product_cost_security
#: model:ir.model,name:product_cost_security.model_product_product
msgid "Product"
msgstr ""

#. module: product_cost_security
#: model:ir.model,name:product_cost_security.model_product_template
msgid "Product Template"
msgstr ""

2 changes: 2 additions & 0 deletions product_cost_security/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import product
19 changes: 19 additions & 0 deletions product_cost_security/models/product.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2018 Sergio Teruel - Tecnativa <sergio.teruel@tecnativa.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import fields, models


class ProductTemplate(models.Model):
_inherit = 'product.template'

standard_price = fields.Float(
groups='product_cost_security.group_product_cost',
)


class ProductProduct(models.Model):
_inherit = 'product.product'

standard_price = fields.Float(
groups='product_cost_security.group_product_cost',
)
4 changes: 4 additions & 0 deletions product_cost_security/readme/CONFIGURE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
To use this module you need to:

#. Go to a *Setting > Users and Companies > Users*.
#. Select a user and add "Access to product costs" group.
1 change: 1 addition & 0 deletions product_cost_security/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Sergio Teruel <sergio.teruel@tecnativa.com>
2 changes: 2 additions & 0 deletions product_cost_security/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Adds a security group for product cost price field.
Only users with this group can view this field.
4 changes: 4 additions & 0 deletions product_cost_security/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
To use this module you need to:

#. Go to product form view logged with this user and you will see the
standard_price field.
11 changes: 11 additions & 0 deletions product_cost_security/security/product_cost_security.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0"?>
<odoo>
<!--
Only users with this group can view the fields with this security group
-->
<record model="res.groups" id="group_product_cost">
<field name="name">Access to product costs</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>

</odoo>
Binary file added product_cost_security/static/description/icon.png
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 bb2af58

Please sign in to comment.