Metadata-Version: 2.1
Name: odoo-addon-sale_price_compliance
Version: 16.0.1.0.1
Requires-Python: >=3.10
Requires-Dist: odoo>=16.0a,<16.1dev
Summary: Visual price compliance based on product, category and company thresholds
Home-page: https://github.com/OCA/sale-workflow
License: LGPL-3
Author: Moduon, Odoo Community Association (OCA)
Author-email: support@odoo-community.org
Classifier: Programming Language :: Python
Classifier: Framework :: Odoo
Classifier: Framework :: Odoo :: 16.0
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
Classifier: Development Status :: 3 - Alpha
Description-Content-Type: text/x-rst

.. image:: https://odoo-community.org/readme-banner-image
   :target: https://odoo-community.org/get-involved?utm_source=readme
   :alt: Odoo Community Association

=====================
Sale Price Compliance
=====================

.. 
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! This file is generated by oca-gen-addon-readme !!
   !! changes will be overwritten.                   !!
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! source digest: sha256:6c6eae895444ca224e96ca0bcf926519a28f9773f44222164f8e509e7203e429
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png
    :target: https://odoo-community.org/page/development-status
    :alt: Alpha
.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png
    :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
    :alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsale--workflow-lightgray.png?logo=github
    :target: https://github.com/OCA/sale-workflow/tree/16.0/sale_price_compliance
    :alt: OCA/sale-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
    :target: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_price_compliance
    :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/sale-workflow&target_branch=16.0
    :alt: Try me on Runboat

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

This module extends the sales pricing functionality to display a color
code based on the price at which products are being sold.

Managing Price Compliance Thresholds can be done by adding *Manage Price
Compliance* group to any user. Compliance Tiers can be filtered on sale
reports.

You can use up to 3 different price compliance tiers for products,
categories or for all company.

You can customize the texts and icons of the tiers via the System
Parameters.

Labels of the tier fields will change according to
``sale_price_compliance.price_compliance_selection_tiers_text`` System
Parameter in views.

This functionality only applies to Sales.

A sale with a line with Non Compliant price (doesn't fit in any defined
tiers) can't be confirmed. Only Sale Administrators can validate this
sales and a message will be posted.

Price Compliance thresholds are selected in this order: Product >
Product Category > Company

Each Tier represents the maximun discount applied to the Price of the
Product to achieve the target tier.

**Color Compliance Tiers**

- Tier 1 🟩: High-yield (Fully compliant)
- Tier 2 🟨: Medium-yield (Moderately compliant)
- Tier 3 🟧: Low-yield (Low compliant)
- Non Compliant 🟥: Non Compliant price (blocked)
- Pricelist 🟦: Pricelist has been used and it's price is between
  pricelist and last compliant tier.

**Information Display on Price Compliant Tiers** Includes a popup to
display detailed information about the price ranges within each price
compliance tiers.

Also displays Product Base UoM and Product List Price in Sale Currency
in the Top Right corner of the Popup.

|Price Compliance Widget|

|Price Compliance Sale Line Form|

|Price Compliance Sale Line List|

|Price Compliance Sale Line Kanban|

.. |Price Compliance Widget| image:: https://raw.githubusercontent.com/OCA/sale-workflow/16.0/sale_price_compliance/static/img/price_compliance_widget.png
.. |Price Compliance Sale Line Form| image:: https://raw.githubusercontent.com/OCA/sale-workflow/16.0/sale_price_compliance/static/img/price_compliance_sale_line_form.png
.. |Price Compliance Sale Line List| image:: https://raw.githubusercontent.com/OCA/sale-workflow/16.0/sale_price_compliance/static/img/price_compliance_sale_line_list.png
.. |Price Compliance Sale Line Kanban| image:: https://raw.githubusercontent.com/OCA/sale-workflow/16.0/sale_price_compliance/static/img/price_compliance_sale_line_kanban.png

.. IMPORTANT::
   This is an alpha version, the data model and design can change at any time without warning.
   Only for development or testing purpose, do not use in production.
   `More details on development status <https://odoo-community.org/page/development-status>`_

**Table of contents**

.. contents::
   :local:

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

This module was developed because sometimes commercial users are
incentivized to sell at prices that are more beneficial to the company.

It will be useful if you want to visually show your commercial users
whether the price they are selling at is in line with the company's
pricing policy.

Usage
=====

To use this module, you need to:

**Configure Parameter Text: Change the default price compliance tiers
texts**

1. Go to System Parameters.
2. Create a new parameter with key
   ``sale_price_compliance.price_compliance_selection_tiers_text``.
3. Write a *dictionary* with the values for tiers that you want to
   change it's default text.
4. Save the parameter.
5. Create a new parameter with key
   ``sale_price_compliance.price_compliance_selection_tiers_icon``.
6. Write a *dictionary* with the values for tiers that you want to
   change it's default icon.
7. Save the parameter.

Example:

Param *sale_price_compliance.price_compliance_selection_tiers_text*:

{'t1': 'Gold', 't2': 'Silver', 't3': 'Bronze', 'pricelist': 'Draw'}

Param *sale_price_compliance.price_compliance_selection_tiers_icon*:

{'t1': '🥇', 't2': '🥈', 't3': '🥉', 'non_compliant': '⛔️', 'pricelist':
'🤝'}

Resulting texts and icons will be:

- Gold: 🥇
- Silver: 🥈
- Bronze: 🥉
- Non Compliant: ⛔️
- Draw: 🤝

Available keys to be used in the dictionary are:

- t1: Tier 1
- t2: Tier 2
- t3: Tier 3
- non_compliant: Non Compliant
- pricelist: Pricelist

**Configure: Product Price Compliance Thresholds configuration**

1. Go to Sales > Products > Products > Select one > Sales tab
2. Enable Use Price Compliance Thresholds under Sale Price Compliance
   Thresholds
3. Fill from 1 to 3 tiers that you want to use in this product.

Example: Tier 1: 10%, Tier 2: 20%, Tier 3: 30%. (Use all tiers)

**Configure: Product Category Price Compliance Thresholds
configuration**

1. Go to Sales > Configuration > Products > Product Categories > Select
   one
2. Enable Use Price Compliance Thresholds under Sale Price Compliance
   Thresholds
3. Fill from 1 to 3 tiers that you want to use in this category.

Example: Tier 1: 15%, Tier 2: 25%, Tier 3: 0%. (Don't use tier 3)

**Configure: Company Price Compliance Thresholds configuration**

1. Go to Sales > Configuration > Settings
2. Enable Use Price Compliance Thresholds under Pricing section
3. Fill from 1 to 3 tiers that you want to use for the company.

Example: Tier 1: 30%, Tier 2: 0%, Tier 3: 0%. (Don't use tier 2 and 3)

**Sale: As a Salesman user**

1. Create a new sale and fill contact field
2. Add a new line with a product that has been configured to use Price
   Compliance
3. Click on the 🟩, 🟨, 🟧, 🟥 or 🟦 icon at the start of the line.
4. You will see a popup with useful information about the Tier ranges.
5. Play with it and then set a Non Compliant price (change price or
   discount to achieve this).
6. Try to confirm the Sale and see the error.

**Sale: As a Sales Administrator**

1. Confirm the previous Sale.
2. See the message on the chatter.

**Reporting: Sales report**

1. Go to Sales > Reporting > Sales
2. Select bar chart or Pivot view
3. Group by Price Compliance Level

**Reporting: Salesperson report**

1. Go to Sales > Reporting > Salesperson
2. Select Bar chart + stacked or Pivot view
3. Group by Price Compliance Level

**Reporting: Product report**

1. Go to Sales > Reporting > Product
2. Select Pie chart + stacked or Pivot view
3. Group by Price Compliance Level

**Reporting: Customers report**

1. Go to Sales > Reporting > Customers
2. Select Bar chart + stacked or Pivot view
3. Group by Price Compliance Level

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

- Widget is not shown properly if the order is not saved and refreshed.

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

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

* Moduon

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

- Eduardo de Miguel (`Moduon <https://www.moduon.team/>`__)

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-Shide| image:: https://github.com/Shide.png?size=40px
    :target: https://github.com/Shide
    :alt: Shide
.. |maintainer-rafaelbn| image:: https://github.com/rafaelbn.png?size=40px
    :target: https://github.com/rafaelbn
    :alt: rafaelbn

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

|maintainer-Shide| |maintainer-rafaelbn| 

This module is part of the `OCA/sale-workflow <https://github.com/OCA/sale-workflow/tree/16.0/sale_price_compliance>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
