Skip to content

Commit

Permalink
[ADD] Addon: sale_margin_product_cost_security
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiago370 committed Dec 20, 2024
1 parent 001095c commit d28424c
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 0 deletions.
35 changes: 35 additions & 0 deletions sale_margin_product_cost_security/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
==========================
Sale Product Cost Security
==========================

KMEE

Purpose
=======

This module extends the functionality of the product_cost_security module to the purchase_price field of the sale_margin module.

When the user does not belong to the group product_cost_group, he cannot see the "Cost" field in the Sale Order Line view.

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

To configure this module, you need to:

#. Go to ...

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.

#. Go to sale order line form view logged with this user and you will see the
purchase_price field.

How to test
===========

...
Empty file.
16 changes: 16 additions & 0 deletions sale_margin_product_cost_security/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2024 KMEE
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Sale Product Cost Security",
"summary": """KMEE""",
"version": "14.0.1.0.0",
"license": "AGPL-3",
"author": "KMEE",
"website": "https://github.com/KMEE/kmee-odoo-addons",
"depends": ["sale_margin", "product_cost_security"],
"data": [
"views/sale_order_line_views.xml",
],
"demo": [],
}
16 changes: 16 additions & 0 deletions sale_margin_product_cost_security/views/sale_order_line_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2024 KMEE
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
<record id="sale_margin_sale_order_line" model="ir.ui.view">
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale_margin.sale_margin_sale_order_line" />
<field name="arch" type="xml">
<field name="purchase_price" position="attributes">
<attribute
name="groups"
>product_cost_security.group_product_cost</attribute>
</field>
</field>
</record>
</odoo>
6 changes: 6 additions & 0 deletions setup/sale_margin_product_cost_security/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)

0 comments on commit d28424c

Please sign in to comment.