Skip to content

Commit

Permalink
[MIG] poduct_code_mandatory: Migration to 16.0
Browse files Browse the repository at this point in the history
Move setUp test class to setUpClass for better performant

[ADD] product_code_mandatory: Add contributors

[IMP] product_cost_security: clarify product cost edit required permissions

As seen in OCA/margin-analysis#198 (review), a user needs some other group that grants them permissions for editing products, apart from this one that allows them to edit product cost.

This might not seem obvious to the user, so it's better to document it.

Btw, I renamed the groups to be shorter. Still easy to understand, now that groups are grouped (🥁).

@moduon MT-5158

[UPD] Update product_cost_security.pot

[BOT] post-merge updates

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: product-attribute-16.0/product-attribute-16.0-product_cost_security
Translate-URL: https://translation.odoo-community.org/projects/product-attribute-16-0/product-attribute-16-0-product_cost_security/
  • Loading branch information
mario committed May 2, 2024
1 parent be3f773 commit e0aa2d2
Show file tree
Hide file tree
Showing 15 changed files with 120 additions and 72 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ addon | version | maintainers | summary
[product_category_type](product_category_type/) | 16.0.1.0.0 | [![legalsylvain](https://github.com/legalsylvain.png?size=30px)](https://github.com/legalsylvain) | Add Type field on Product Categories to distinguish between parent and final categories
[product_code_unique](product_code_unique/) | 16.0.1.0.1 | | Set Product Internal Reference as Unique
[product_company_default](product_company_default/) | 16.0.1.0.0 | | Product Company Default
[product_cost_security](product_cost_security/) | 16.0.1.1.0 | [![sergio-teruel](https://github.com/sergio-teruel.png?size=30px)](https://github.com/sergio-teruel) [![rafaelbn](https://github.com/rafaelbn.png?size=30px)](https://github.com/rafaelbn) [![yajo](https://github.com/yajo.png?size=30px)](https://github.com/yajo) | Product cost security restriction view
[product_cost_security](product_cost_security/) | 16.0.1.2.0 | [![sergio-teruel](https://github.com/sergio-teruel.png?size=30px)](https://github.com/sergio-teruel) [![rafaelbn](https://github.com/rafaelbn.png?size=30px)](https://github.com/rafaelbn) [![yajo](https://github.com/yajo.png?size=30px)](https://github.com/yajo) | Product cost security restriction view
[product_country_restriction](product_country_restriction/) | 16.0.1.0.0 | [![rousseldenis](https://github.com/rousseldenis.png?size=30px)](https://github.com/rousseldenis) | Allows to define product restrictions country based
[product_dimension](product_dimension/) | 16.0.1.2.0 | | Product Dimension
[product_expiry_configurable](product_expiry_configurable/) | 16.0.1.0.0 | | This model allows setting expiry times on category and to use the 'end_of_life' date for the computation of lot dates
Expand Down
5 changes: 4 additions & 1 deletion product_code_mandatory/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Product Code Mandatory
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:ed48efe42666c69b92c54175dfe132a3c88310de79d137e3ef65c13e436c9f80
!! source digest: sha256:8897572a4299897859406955a16af1e98a44c18ef495008346d34d6eb57ab5b1
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down Expand Up @@ -74,6 +74,9 @@ Contributors
* Sudhir Arya <[email protected]>
* Watthanun Khorchai <[email protected]>
* Nedas Žilinskas <[email protected]>
* `Binhex <https://binhex.cloud/>`_:

* Mario Luis Mora <[email protected]>

Maintainers
~~~~~~~~~~~
Expand Down
3 changes: 3 additions & 0 deletions product_code_mandatory/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
* Sudhir Arya <[email protected]>
* Watthanun Khorchai <[email protected]>
* Nedas Žilinskas <[email protected]>
* `Binhex <https://binhex.cloud/>`_:

* Mario Luis Mora <[email protected]>
6 changes: 5 additions & 1 deletion product_code_mandatory/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Product Code Mandatory</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:ed48efe42666c69b92c54175dfe132a3c88310de79d137e3ef65c13e436c9f80
!! source digest: sha256:8897572a4299897859406955a16af1e98a44c18ef495008346d34d6eb57ab5b1
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/product-attribute/tree/16.0/product_code_mandatory"><img alt="OCA/product-attribute" src="https://img.shields.io/badge/github-OCA%2Fproduct--attribute-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/product-attribute-16-0/product-attribute-16-0-product_code_mandatory"><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/product-attribute&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 sets the field internal reference (default_code) of the product
Expand Down Expand Up @@ -419,6 +419,10 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<li>Sudhir Arya &lt;<a class="reference external" href="mailto:sudhir&#64;erpharbor.com">sudhir&#64;erpharbor.com</a>&gt;</li>
<li>Watthanun Khorchai &lt;<a class="reference external" href="mailto:watthanun_t&#64;hotmail.com">watthanun_t&#64;hotmail.com</a>&gt;</li>
<li>Nedas Žilinskas &lt;<a class="reference external" href="mailto:nedas.zilinskas&#64;web-veistamo.fi">nedas.zilinskas&#64;web-veistamo.fi</a>&gt;</li>
<li><a class="reference external" href="https://binhex.cloud/">Binhex</a>:<ul>
<li>Mario Luis Mora &lt;<a class="reference external" href="mailto:m.luis&#64;binhex.cloud">m.luis&#64;binhex.cloud</a>&gt;</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand Down
9 changes: 5 additions & 4 deletions product_code_mandatory/tests/test_product_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@


class TestProductCode(TransactionCase):
def setUp(self):
super(TestProductCode, self).setUp()
self.product_model = self.env["product.product"]
self.product = self.product_model.create({"name": "Test Product Code"})
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.product_model = cls.env["product.product"]
cls.product = cls.product_model.create({"name": "Test Product Code"})

def test_product_code(self):
"""Check Product Code"""
Expand Down
9 changes: 8 additions & 1 deletion product_cost_security/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Product Cost Security
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:e0a447c05b96eb98d1209480f72fd5aaa45313571321d852e1d0d0d561d4c775
!! source digest: sha256:b742bd17e19a4443630ab59ac73cd70854d0edd253fc71d1b9fd0027b8509be0
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
Expand Down Expand Up @@ -54,6 +54,13 @@ To use this module you need to:
#. You will not see the *Cost* field unless you follow the *Configuration* steps and get read permissions.
#. You will not be able to edit it unless you are granted write permissions.

Known issues / Roadmap
======================

* To edit product costs, apart from having *Product costs / Edit* permission,
you need to have some other permission that lets you edit products, such as
*Sales / Administrator* or *Inventory / Administrator*.

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

Expand Down
2 changes: 1 addition & 1 deletion product_cost_security/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"name": "Product Cost Security",
"summary": "Product cost security restriction view",
"version": "16.0.1.1.0",
"version": "16.0.1.2.0",
"development_status": "Production/Stable",
"maintainers": ["sergio-teruel", "rafaelbn", "yajo"],
"category": "Product",
Expand Down
23 changes: 13 additions & 10 deletions product_cost_security/i18n/ar.po
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ msgstr ""
"&& n%100<=10 ? 3 : n%100>=11 ? 4 : 5;\n"
"X-Generator: Weblate 4.3.2\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.fields,field_description:product_cost_security.field_product_product__standard_price
#: model:ir.model.fields,field_description:product_cost_security.field_product_template__standard_price
msgid "Cost"
msgstr "التكلفة"

#. module: product_cost_security
#: model:res.groups,name:product_cost_security.group_product_edit_cost
msgid "Edit"
msgstr ""

#. module: product_cost_security
#: model:ir.model.fields,help:product_cost_security.field_product_product__standard_price
#: model:ir.model.fields,help:product_cost_security.field_product_template__standard_price
Expand All @@ -41,11 +41,6 @@ msgid ""
" Used to compute margins on sale orders."
msgstr ""

#. module: product_cost_security
#: model:res.groups,name:product_cost_security.group_product_edit_cost
msgid "Modify product costs"
msgstr ""

#. module: product_cost_security
#: model:ir.model,name:product_cost_security.model_product_template
msgid "Product"
Expand All @@ -66,6 +61,11 @@ msgstr ""
msgid "Product costs"
msgstr ""

#. module: product_cost_security
#: model:res.groups,name:product_cost_security.group_product_cost
msgid "Read"
msgstr ""

#. module: product_cost_security
#: model:ir.model.fields,field_description:product_cost_security.field_product_cost_security_mixin__user_can_update_cost
#: model:ir.model.fields,field_description:product_cost_security.field_product_product__user_can_update_cost
Expand All @@ -85,6 +85,9 @@ msgid ""
"(Operation: %(operation)s)"
msgstr ""

#~ msgid "Access to product costs"
#~ msgstr "الاطلاع على تكلفة المنتجات"

#~ msgid "Product Template"
#~ msgstr "قالب المنتج"

Expand Down
23 changes: 13 additions & 10 deletions product_cost_security/i18n/ca.po
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.3.2\n"

#. module: product_cost_security
#: model:res.groups,name:product_cost_security.group_product_cost
msgid "Access to product costs"
msgstr "Accés als costos del producte"

#. module: product_cost_security
#: model:ir.model.fields,field_description:product_cost_security.field_product_product__standard_price
#: model:ir.model.fields,field_description:product_cost_security.field_product_template__standard_price
msgid "Cost"
msgstr "Cost"

#. module: product_cost_security
#: model:res.groups,name:product_cost_security.group_product_edit_cost
msgid "Edit"
msgstr ""

#. module: product_cost_security
#: model:ir.model.fields,help:product_cost_security.field_product_product__standard_price
#: model:ir.model.fields,help:product_cost_security.field_product_template__standard_price
Expand All @@ -48,11 +48,6 @@ msgstr ""
"compra (p. ex., ajust d'inventari).\n"
" S'utilitza per calcular els marges de les comandes de venda."

#. module: product_cost_security
#: model:res.groups,name:product_cost_security.group_product_edit_cost
msgid "Modify product costs"
msgstr ""

#. module: product_cost_security
#: model:ir.model,name:product_cost_security.model_product_template
msgid "Product"
Expand All @@ -73,6 +68,11 @@ msgstr ""
msgid "Product costs"
msgstr ""

#. module: product_cost_security
#: model:res.groups,name:product_cost_security.group_product_cost
msgid "Read"
msgstr ""

#. module: product_cost_security
#: model:ir.model.fields,field_description:product_cost_security.field_product_cost_security_mixin__user_can_update_cost
#: model:ir.model.fields,field_description:product_cost_security.field_product_product__user_can_update_cost
Expand All @@ -92,5 +92,8 @@ msgid ""
"(Operation: %(operation)s)"
msgstr ""

#~ msgid "Access to product costs"
#~ msgstr "Accés als costos del producte"

#~ msgid "Product Template"
#~ msgstr "Plantilla de producte"
26 changes: 16 additions & 10 deletions product_cost_security/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\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.fields,field_description:product_cost_security.field_product_product__standard_price
#: model:ir.model.fields,field_description:product_cost_security.field_product_template__standard_price
msgid "Cost"
msgstr "Coste"

#. module: product_cost_security
#: model:res.groups,name:product_cost_security.group_product_edit_cost
msgid "Edit"
msgstr ""

#. module: product_cost_security
#: model:ir.model.fields,help:product_cost_security.field_product_product__standard_price
#: model:ir.model.fields,help:product_cost_security.field_product_template__standard_price
Expand All @@ -48,11 +48,6 @@ msgstr ""
"compra (por ejemplo, ajuste de inventario).\n"
" Se utiliza para calcular los márgenes de los pedidos de venta."

#. module: product_cost_security
#: model:res.groups,name:product_cost_security.group_product_edit_cost
msgid "Modify product costs"
msgstr "Modificar los costes de los productos"

#. module: product_cost_security
#: model:ir.model,name:product_cost_security.model_product_template
msgid "Product"
Expand All @@ -73,6 +68,11 @@ msgstr "Mixin de control de acceso al coste del producto"
msgid "Product costs"
msgstr "Costes del Producto"

#. module: product_cost_security
#: model:res.groups,name:product_cost_security.group_product_cost
msgid "Read"
msgstr ""

#. module: product_cost_security
#: model:ir.model.fields,field_description:product_cost_security.field_product_cost_security_mixin__user_can_update_cost
#: model:ir.model.fields,field_description:product_cost_security.field_product_product__user_can_update_cost
Expand All @@ -97,5 +97,11 @@ msgstr ""
"\n"
"(Operación: %(operation)s)"

#~ msgid "Access to product costs"
#~ msgstr "Acceso a ver el coste de productos"

#~ msgid "Modify product costs"
#~ msgstr "Modificar los costes de los productos"

#~ msgid "Product Template"
#~ msgstr "Plantilla de producto"
26 changes: 16 additions & 10 deletions product_cost_security/i18n/it.po
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: product_cost_security
#: model:res.groups,name:product_cost_security.group_product_cost
msgid "Access to product costs"
msgstr "Accesso ai costi prodotto"

#. module: product_cost_security
#: model:ir.model.fields,field_description:product_cost_security.field_product_product__standard_price
#: model:ir.model.fields,field_description:product_cost_security.field_product_template__standard_price
msgid "Cost"
msgstr "Costo"

#. module: product_cost_security
#: model:res.groups,name:product_cost_security.group_product_edit_cost
msgid "Edit"
msgstr ""

#. module: product_cost_security
#: model:ir.model.fields,help:product_cost_security.field_product_product__standard_price
#: model:ir.model.fields,help:product_cost_security.field_product_template__standard_price
Expand All @@ -47,11 +47,6 @@ msgstr ""
"è noto (es. rettifiche di inventario).\n"
" Utilizzato per calcolare i margini negli ordini di vendita."

#. module: product_cost_security
#: model:res.groups,name:product_cost_security.group_product_edit_cost
msgid "Modify product costs"
msgstr "Modifica costi prodotto"

#. module: product_cost_security
#: model:ir.model,name:product_cost_security.model_product_template
msgid "Product"
Expand All @@ -72,6 +67,11 @@ msgstr "Mixin controllo accesso costo prodotto"
msgid "Product costs"
msgstr "Costi prodotto"

#. module: product_cost_security
#: model:res.groups,name:product_cost_security.group_product_cost
msgid "Read"
msgstr ""

#. module: product_cost_security
#: model:ir.model.fields,field_description:product_cost_security.field_product_cost_security_mixin__user_can_update_cost
#: model:ir.model.fields,field_description:product_cost_security.field_product_product__user_can_update_cost
Expand All @@ -95,3 +95,9 @@ msgstr ""
"sistema.\n"
"\n"
"(Operazione: %(operation)s)"

#~ msgid "Access to product costs"
#~ msgstr "Accesso ai costi prodotto"

#~ msgid "Modify product costs"
#~ msgstr "Modifica costi prodotto"
20 changes: 10 additions & 10 deletions product_cost_security/i18n/product_cost_security.pot
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ msgstr ""
"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.fields,field_description:product_cost_security.field_product_product__standard_price
#: model:ir.model.fields,field_description:product_cost_security.field_product_template__standard_price
msgid "Cost"
msgstr ""

#. module: product_cost_security
#: model:res.groups,name:product_cost_security.group_product_edit_cost
msgid "Edit"
msgstr ""

#. module: product_cost_security
#: model:ir.model.fields,help:product_cost_security.field_product_product__standard_price
#: model:ir.model.fields,help:product_cost_security.field_product_template__standard_price
Expand All @@ -34,11 +34,6 @@ msgid ""
" Used to compute margins on sale orders."
msgstr ""

#. module: product_cost_security
#: model:res.groups,name:product_cost_security.group_product_edit_cost
msgid "Modify product costs"
msgstr ""

#. module: product_cost_security
#: model:ir.model,name:product_cost_security.model_product_template
msgid "Product"
Expand All @@ -59,6 +54,11 @@ msgstr ""
msgid "Product costs"
msgstr ""

#. module: product_cost_security
#: model:res.groups,name:product_cost_security.group_product_cost
msgid "Read"
msgstr ""

#. module: product_cost_security
#: model:ir.model.fields,field_description:product_cost_security.field_product_cost_security_mixin__user_can_update_cost
#: model:ir.model.fields,field_description:product_cost_security.field_product_product__user_can_update_cost
Expand Down
3 changes: 3 additions & 0 deletions product_cost_security/readme/ROADMAP.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* To edit product costs, apart from having *Product costs / Edit* permission,
you need to have some other permission that lets you edit products, such as
*Sales / Administrator* or *Inventory / Administrator*.
Loading

0 comments on commit e0aa2d2

Please sign in to comment.