Skip to content

Commit

Permalink
[ADD] product_standard_margin_security: Adds security to product_stan…
Browse files Browse the repository at this point in the history
…dard_margin module
  • Loading branch information
luisDIXMIT committed Oct 3, 2024
1 parent 9c4f767 commit 86f3809
Show file tree
Hide file tree
Showing 19 changed files with 913 additions and 0 deletions.
204 changes: 204 additions & 0 deletions product_standard_margin_security/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
================================
Product Standard Margin Security
================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:7cfaa0f82cde1dd7ec11b08ff0885472344ac94abf822dbd307328060cc65429
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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%2Fmargin--analysis-lightgray.png?logo=github
:target: https://github.com/OCA/margin-analysis/tree/16.0/product_standard_margin_security
:alt: OCA/margin-analysis
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/margin-analysis-16-0/margin-analysis-16-0-product_standard_margin_security
: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/margin-analysis&target_branch=16.0
:alt: Try me on Runboat

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

[ This file must be max 2-3 paragraphs, and is required.

The goal of this document is to explain quickly the features of this
module: “what” this module does and “what” it is for. ]

Example:

This module extends the functionality of ... to support ... and to allow
users to ...

**Table of contents**

.. contents::
:local:

Use Cases / Context
===================

[ This file is optional but strongly suggested to allow end-users to
evaluate the module's usefulness in their context. ]

BUSINESS NEED: It should explain the “why” of the module:

- what is the business requirement that generated the need to develop
this module
- in which context or use cases this module can be useful (practical
examples are welcome!).

APPROACH: It could also explain the approach to address the mentioned
need.

USEFUL INFORMATION: It can also inform on related modules:

- modules it depends on and their features
- other modules that can work well together with this one
- suggested setups where the module is useful (eg: multicompany,
multi-website)

Installation
============

[ This file must only be present if there are very specific installation
instructions, such as installing non-python dependencies. The audience
is systems administrators. ]

To install this module, you need to:

1. Do this ...

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

[ This file is not always required; it should explain **how to configure
the module before using it**; it is aimed at users with administration
privileges.

Please be detailed on the path to configuration (eg: do you need to
activate developer mode?), describe step by step configurations and the
use of screenshots is strongly recommended.]

To configure this module, you need to:

- Go to Settings > Users & Companies > Groups
- Search "Product costs / Read" group
- Add your user in this group.

Usage
=====

[ This file is required and contains the instructions on **“how”** to
use the module for end-users.

If the module does not have a visible impact on the user interface, just
add the following sentence:

This module does not impact the user interface.

If that’s not the case, please make sure that every usage step is
covered and remember that images speak more than words!]

To use this module, you need to:

- Go to a product form.

- Margin fields should be showns.

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

[ Enumerate known caveats and future potential improvements. It is
mostly intended for end-users, and can also help potential new
contributors discovering new features to implement. ]

- ...

Changelog
=========

[ The change log. The goal of this file is to help readers understand
changes between version. The primary audience is end users and
integrators. Purely technical changes such as code refactoring must not
be mentioned here.

This file may contain ONE level of section titles, underlined with the ~
(tilde) character. Other section markers are forbidden and will likely
break the structure of the README.rst or other documents where this
fragment is included. ]

11.0.x.y.z (YYYY-MM-DD)
-----------------------

- [BREAKING] Breaking changes come first.
(`#70 <https://github.com/OCA/repo/issues/70>`__)
- [ADD] New feature. (`#74 <https://github.com/OCA/repo/issues/74>`__)
- [FIX] Correct this. (`#71 <https://github.com/OCA/repo/issues/71>`__)

11.0.x.y.z (YYYY-MM-DD)
-----------------------

- ...

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/margin-analysis/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/margin-analysis/issues/new?body=module:%20product_standard_margin_security%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
-------

* Dixmit

Contributors
------------

- Firstname Lastname [email protected] (optional company
website url)
- Second Person [email protected] (optional company website
url)

Other credits
-------------

[ This file is optional and contains additional credits, other than
authors, contributors, and maintainers. ]

The development of this module has been financially supported by:

- Company 1 name
- Company 2 name

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/margin-analysis <https://github.com/OCA/margin-analysis/tree/16.0/product_standard_margin_security>`_ project on GitHub.

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

{
"name": "Product Standard Margin Security",
"summary": """Security for product standard margin""",
"version": "16.0.1.0.0",
"license": "AGPL-3",
"author": "Dixmit,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/margin-analysis",
"depends": ["product_standard_margin", "product_cost_security"],
"data": [],
"demo": [],
"auto_install": True,
}
2 changes: 2 additions & 0 deletions product_standard_margin_security/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import product_product
from . import product_template
23 changes: 23 additions & 0 deletions product_standard_margin_security/models/product_product.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2024 Dixmit
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class ProductProduct(models.Model):

_inherit = "product.product"

list_price_vat_excl = fields.Float(
groups="product_cost_security.group_product_cost"
)

standard_margin = fields.Float(groups="product_cost_security.group_product_cost")

standard_margin_rate = fields.Float(
groups="product_cost_security.group_product_cost"
)

standard_markup_rate = fields.Float(
groups="product_cost_security.group_product_cost"
)
23 changes: 23 additions & 0 deletions product_standard_margin_security/models/product_template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2024 Dixmit
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class ProductTemplate(models.Model):

_inherit = "product.template"

list_price_vat_excl = fields.Float(
groups="product_cost_security.group_product_cost"
)

standard_margin = fields.Float(groups="product_cost_security.group_product_cost")

standard_margin_rate = fields.Float(
groups="product_cost_security.group_product_cost"
)

standard_markup_rate = fields.Float(
groups="product_cost_security.group_product_cost"
)
10 changes: 10 additions & 0 deletions product_standard_margin_security/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[ This file is not always required; it should explain **how to configure the module before using it**; it is aimed at users with administration privileges.

Please be detailed on the path to configuration (eg: do you need to activate developer mode?), describe step by step configurations and the use of screenshots is strongly recommended.]


To configure this module, you need to:

- Go to Settings > Users & Companies > Groups
- Search "Product costs / Read" group
- Add your user in this group.
16 changes: 16 additions & 0 deletions product_standard_margin_security/readme/CONTEXT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[ This file is optional but strongly suggested to allow end-users to evaluate the
module's usefulness in their context. ]

BUSINESS NEED:
It should explain the “why” of the module:
- what is the business requirement that generated the need to develop this module
- in which context or use cases this module can be useful (practical examples are welcome!).

APPROACH:
It could also explain the approach to address the mentioned need.

USEFUL INFORMATION:
It can also inform on related modules:
- modules it depends on and their features
- other modules that can work well together with this one
- suggested setups where the module is useful (eg: multicompany, multi-website)
2 changes: 2 additions & 0 deletions product_standard_margin_security/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Firstname Lastname <[email protected]> (optional company website url)
- Second Person <[email protected]> (optional company website url)
7 changes: 7 additions & 0 deletions product_standard_margin_security/readme/CREDITS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[ This file is optional and contains additional credits, other than
authors, contributors, and maintainers. ]

The development of this module has been financially supported by:

- Company 1 name
- Company 2 name
7 changes: 7 additions & 0 deletions product_standard_margin_security/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[ This file must be max 2-3 paragraphs, and is required.

The goal of this document is to explain quickly the features of this module: “what” this module does and “what” it is for. ]

Example:

This module extends the functionality of ... to support ... and to allow users to ...
22 changes: 22 additions & 0 deletions product_standard_margin_security/readme/HISTORY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[ The change log. The goal of this file is to help readers
understand changes between version. The primary audience is
end users and integrators. Purely technical changes such as
code refactoring must not be mentioned here.

This file may contain ONE level of section titles, underlined
with the ~ (tilde) character. Other section markers are
forbidden and will likely break the structure of the README.rst
or other documents where this fragment is included. ]

## 11.0.x.y.z (YYYY-MM-DD)

- [BREAKING] Breaking changes come first.
([#70](https://github.com/OCA/repo/issues/70))
- [ADD] New feature.
([#74](https://github.com/OCA/repo/issues/74))
- [FIX] Correct this.
([#71](https://github.com/OCA/repo/issues/71))

## 11.0.x.y.z (YYYY-MM-DD)

- ...
7 changes: 7 additions & 0 deletions product_standard_margin_security/readme/INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[ This file must only be present if there are very specific
installation instructions, such as installing non-python
dependencies. The audience is systems administrators. ]

To install this module, you need to:

1. Do this ...
5 changes: 5 additions & 0 deletions product_standard_margin_security/readme/ROADMAP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[ Enumerate known caveats and future potential improvements.
It is mostly intended for end-users, and can also help
potential new contributors discovering new features to implement. ]

- ...
13 changes: 13 additions & 0 deletions product_standard_margin_security/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[ This file is required and contains the instructions on **“how”** to use the module for end-users.

If the module does not have a visible impact on the user interface, just add the following sentence:

> This module does not impact the user interface.
If that’s not the case, please make sure that every usage step is covered and remember that images speak more than words!]

To use this module, you need to:

- Go to a product form.

- Margin fields should be showns.
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 86f3809

Please sign in to comment.