-
-
Notifications
You must be signed in to change notification settings - Fork 601
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by legalsylvain
- Loading branch information
Showing
17 changed files
with
735 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
======================== | ||
PoS Hide Cost and Margin | ||
======================== | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:9eb4f117b7596b2076213a1a04f614cb65967b56fabab9e83d53fcec56f33f99 | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |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%2Fpos-lightgray.png?logo=github | ||
:target: https://github.com/OCA/pos/tree/17.0/pos_hide_cost_price_and_margin | ||
:alt: OCA/pos | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/pos-17-0/pos-17-0-pos_hide_cost_price_and_margin | ||
: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/pos&target_branch=17.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
By default since odoo v16.0, Margin/Cost is hidden for PoS/User. But you | ||
also want it hidden for PoS/Manager, in some contexts. Installing this | ||
module will hide it for every user | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Usage | ||
===== | ||
|
||
|
||
|
||
Changelog | ||
========= | ||
|
||
15.0.1.0.0 | ||
---------- | ||
|
||
- Add to V15.0 | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/pos/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/pos/issues/new?body=module:%20pos_hide_cost_price_and_margin%0Aversion:%2017.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 | ||
|
||
Contributors | ||
------------ | ||
|
||
- `Trobz <https://trobz.com>`__: | ||
|
||
- Hai Lang <[email protected]> | ||
- Tri Doan <[email protected]> | ||
|
||
Other credits | ||
------------- | ||
|
||
The migration of this module from 15.0 to 17.0 was financially supported | ||
by Camptocamp | ||
|
||
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/pos <https://github.com/OCA/pos/tree/17.0/pos_hide_cost_price_and_margin>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Copyright (C) 2022 - Today: camptocamp (https://www.camptocamp.com) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
{ | ||
"name": "PoS Hide Cost and Margin", | ||
"summary": "Hide Cost and Margin on PoS", | ||
"version": "17.0.1.0.0", | ||
"category": "Point Of Sale", | ||
"author": "CampToCamp, Odoo Community Association (OCA)", | ||
"maintainers": [], | ||
"website": "https://github.com/OCA/pos", | ||
"license": "AGPL-3", | ||
"depends": [ | ||
"point_of_sale", | ||
], | ||
"data": [ | ||
"views/res_config_settings_views.xml", | ||
], | ||
"assets": { | ||
"point_of_sale.assets_prod": [ | ||
"pos_hide_cost_price_and_margin/static/src/js/**/*", | ||
], | ||
}, | ||
"installable": True, | ||
} |
62 changes: 62 additions & 0 deletions
62
pos_hide_cost_price_and_margin/i18n/pos_hide_cost_price_and_margin.pot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * pos_hide_cost_price_and_margin | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 17.0+e\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-04-26 10:08+0000\n" | ||
"PO-Revision-Date: 2024-04-26 10:08+0000\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: pos_hide_cost_price_and_margin | ||
#: model:ir.model,name:pos_hide_cost_price_and_margin.model_res_config_settings | ||
msgid "Config Settings" | ||
msgstr "" | ||
|
||
#. module: pos_hide_cost_price_and_margin | ||
#: model:ir.model.fields,field_description:pos_hide_cost_price_and_margin.field_pos_config__is_margins_costs_accessible_to_every_user | ||
msgid "Margins & Costs" | ||
msgstr "" | ||
|
||
#. module: pos_hide_cost_price_and_margin | ||
#: model:ir.model.fields,field_description:pos_hide_cost_price_and_margin.field_pos_config__is_margins_costs_accessible_to_admin | ||
#: model:ir.model.fields,field_description:pos_hide_cost_price_and_margin.field_res_config_settings__pos_is_margins_costs_accessible_to_admin | ||
#: model_terms:ir.ui.view,arch_db:pos_hide_cost_price_and_margin.res_config_settings_view_form | ||
msgid "Margins & Costs (Admin)" | ||
msgstr "" | ||
|
||
#. module: pos_hide_cost_price_and_margin | ||
#: model_terms:ir.ui.view,arch_db:pos_hide_cost_price_and_margin.res_config_settings_view_form | ||
msgid "Margins & Costs (every user)" | ||
msgstr "" | ||
|
||
#. module: pos_hide_cost_price_and_margin | ||
#: model:ir.model,name:pos_hide_cost_price_and_margin.model_pos_config | ||
msgid "Point of Sale Configuration" | ||
msgstr "" | ||
|
||
#. module: pos_hide_cost_price_and_margin | ||
#: model_terms:ir.ui.view,arch_db:pos_hide_cost_price_and_margin.res_config_settings_view_form | ||
msgid "Show margins & costs on product information for Admin" | ||
msgstr "" | ||
|
||
#. module: pos_hide_cost_price_and_margin | ||
#: model:ir.model.fields,help:pos_hide_cost_price_and_margin.field_pos_config__is_margins_costs_accessible_to_admin | ||
#: model:ir.model.fields,help:pos_hide_cost_price_and_margin.field_res_config_settings__pos_is_margins_costs_accessible_to_admin | ||
msgid "" | ||
"When disabled, margin and cost of product are hide in the Product info." | ||
msgstr "" | ||
|
||
#. module: pos_hide_cost_price_and_margin | ||
#: model:ir.model.fields,help:pos_hide_cost_price_and_margin.field_pos_config__is_margins_costs_accessible_to_every_user | ||
msgid "" | ||
"When disabled, only PoS manager can view the margin and cost of product " | ||
"among the Product info." | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from . import pos_config | ||
from . import res_config_settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Copyright 2024 Camptocamp SA | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo import api, fields, models | ||
|
||
|
||
class PosConfig(models.Model): | ||
_inherit = "pos.config" | ||
|
||
is_margins_costs_accessible_to_admin = fields.Boolean( | ||
string="Margins & Costs (Admin)", | ||
default=False, | ||
) | ||
is_margins_costs_accessible_to_every_user = fields.Boolean( | ||
compute="_compute_is_margins_costs_accessible_to_every_user", | ||
readonly=False, | ||
store=True, | ||
) | ||
|
||
@api.depends("is_margins_costs_accessible_to_admin") | ||
def _compute_is_margins_costs_accessible_to_every_user(self): | ||
for rec in self: | ||
if not rec.is_margins_costs_accessible_to_admin: | ||
rec.is_margins_costs_accessible_to_every_user = False |
12 changes: 12 additions & 0 deletions
12
pos_hide_cost_price_and_margin/models/res_config_settings.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Copyright 2024 Camptocamp SA | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class ResConfigSettings(models.TransientModel): | ||
_inherit = "res.config.settings" | ||
|
||
pos_is_margins_costs_accessible_to_admin = fields.Boolean( | ||
related="pos_config_id.is_margins_costs_accessible_to_admin", readonly=False | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[build-system] | ||
requires = ["whool"] | ||
build-backend = "whool.buildapi" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
- [Trobz](https://trobz.com): | ||
- Hai Lang \<<[email protected]>\> | ||
- Tri Doan \<<[email protected]>\> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
The migration of this module from 15.0 to 17.0 was financially supported by Camptocamp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
By default since odoo v16.0, Margin/Cost is hidden for PoS/User. But you also want it hidden for PoS/Manager, in some contexts. | ||
Installing this module will hide it for every user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## 15.0.1.0.0 | ||
|
||
- Add to V15.0 |
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.