Sale Price Compliance

sale_price_compliance
REPOSITORY
REPOSITORYOCA/sale-workflow
GIT
GIThttps://github.com/OCA/sale-workflow.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/sale-workflow/tree/16.0/sale_price_compliance
VERSION
VERSION 1.0.1
CATEGORY
CATEGORYSales/Sales
LICENSE
LICENSELGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Moduon
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Moduon
COMMITTERS
COMMITTERSMiquel Raïch, OCA-git-bot, oca-ci, Eduardo de Miguel
WEBSITE
WEBSITEhttps://github.com/OCA/sale-workflow
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 19:11:58
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - sale
    - sales_team
    - base
    - mail
    - base_setup
    - web
    - bus
    - web_tour
    - account_payment
    - account
    - product
    - uom
    - analytic
    - portal
    - web_editor
    - http_routing
    - auth_signup
    - digest
    - resource
    - payment
    - utm
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION
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](../static/img/price_compliance_widget.png)

![Price Compliance Sale Line Form](../static/img/price_compliance_sale_line_form.png)

![Price Compliance Sale Line List](../static/img/price_compliance_sale_line_list.png)

![Price Compliance Sale Line Kanban](../static/img/price_compliance_sale_line_kanban.png)

Code Analysis

Views touched (11)
XML IDNameModelTypeStatus
product_category_form_view product.category.form product.category xpath Inherits product.product_category_form_view
product_category_search_view product.category.search product.category xpath Inherits product.product_category_search_view
product_template_form_view product.template.common.form product.template xpath Inherits sale.product_template_form_view
product_template_search_view product.template.search product.template xpath Inherits product.product_template_search_view
product_variant_easy_edit_view product.product.view.form.easy product.product xpath Inherits product.product_variant_easy_edit_view
res_config_settings_view_form res.config.settings.view.form.inherit.price.compliance res.config.settings xpath Inherits sale.res_config_settings_view_form
sale_report_view_tree sale.report.view.pcl.list sale.report xpath Inherits sale.sale_report_view_tree
view_order_form sale.order.form sale.order xpath Inherits sale.view_order_form
view_order_line_tree sale.order.line.tree sale.order.line xpath Inherits sale.view_order_line_tree
view_order_product_search sale.report.pcl.search sale.report xpath Inherits sale.view_order_product_search
view_sales_order_line_filter sale.order.line.select sale.order.line xpath Inherits sale.view_sales_order_line_filter
Models touched (10)

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (4)
  • price_compliance_threshold_t1 Float
    default=0.0 digits='Discount' string='Tier 1'
  • price_compliance_threshold_t2 Float
    default=0.0 digits='Discount' string='Tier 2'
  • price_compliance_threshold_t3 Float
    default=0.0 digits='Discount' string='Tier 3'
  • use_price_compliance_threshold Boolean
    string='Use Price Compliance Thresholds'
Public methods (1)
  • get_view(self, view_id=None, view_type='form', **options)
    @api.model
    Replaces price_compliance_threshold_t[1,2,3] labels based on tier text definitions from sale.order.line, which can be customized via system parameters.

New fields (1)
  • price_compliance_tier Selection
    help='Indicates the Tier of Price Compliance based on the unit price and applied discount compared to defined thresholds.' readonly=True selection='_get_price_compliance_selection_tiers'
Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (4)
  • price_compliance_threshold_t1 Float
    help='Threshold for Tier 1 Price Compliance (e.g., High-yield). Prices below this tier are considered fully compliant.' readonly=False related='company_id.price_compliance_threshold_t1'
  • price_compliance_threshold_t2 Float
    help='Threshold for Tier 2 Price Compliance (e.g., Medium-yield). Prices between Tier 1 and Tier 2 are considered moderately compliant.' readonly=False related='company_id.price_compliance_threshold_t2'
  • price_compliance_threshold_t3 Float
    help='Threshold for Tier 3 Price Compliance (e.g., Low-yield). Prices between Tier 2 and Tier 3 are considered low compliant.' readonly=False related='company_id.price_compliance_threshold_t3'
  • use_price_compliance_threshold Boolean
    readonly=False related='company_id.use_price_compliance_threshold'
Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (2)
  • price_compliance_data Json
    compute='_compute_price_compliance_tier' help='Holds additional data related to price compliance calculations.' readonly=True store=True
  • price_compliance_tier Selection
    compute='_compute_price_compliance_tier' store=True
Public methods (0)

No public methods.

New fields (1)
  • price_compliance_tier Selection
    help='Indicates the Tier of Price Compliance based on the unit price and applied discount compared to defined thresholds.' selection='_get_price_compliance_tiers'
Public methods (0)

No public methods.

STATUS
STATUSOpen migration PR - not merged yet for this version
REPOSITORY
REPOSITORYOCA/sale-workflow
PULL REQUEST
PULL REQUEST[18.0][MIG] sale_price_compliance (#4218)