Repository
OCA/sale-workflow · module folder · Try on Runboat
Module version
1.0.1
Category
Sales/Sales
Folder size
0.21 MB
License
LGPL-3
Application
No
Auto-installable
No
Website
https://github.com/OCA/sale-workflow
Last tracking update
2026-08-07 08:09:12
Authors
Odoo Community Association (OCA), Moduon
Maintainers
Odoo Community Association (OCA), Moduon
Committers
Miquel Raïch, Eduardo de Miguel, OCA-git-bot, oca-ci
Odoo dependencies
Python dependencies
None
System dependencies
None
Required by
sale_report_delivered_price_compliance
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 form Inherits product.product_category_form_view
product_category_search_view product.category.search product.category search Inherits product.product_category_search_view
product_template_form_view product.template.common.form product.template form Inherits sale.product_template_form_view
product_template_search_view product.template.search product.template search Inherits product.product_template_search_view
product_variant_easy_edit_view product.product.view.form.easy product.product form Inherits product.product_variant_easy_edit_view
res_config_settings_view_form res.config.settings.view.form.inherit.price.compliance res.config.settings form Inherits sale.res_config_settings_view_form
sale_report_view_tree sale.report.view.pcl.list sale.report list Inherits sale.sale_report_view_tree
view_order_form sale.order.form sale.order form Inherits sale.view_order_form
view_order_line_tree sale.order.line.tree sale.order.line tree Inherits sale.view_order_line_tree
view_order_product_search sale.report.pcl.search sale.report search Inherits sale.view_order_product_search
view_sales_order_line_filter sale.order.line.select sale.order.line Inherits sale.view_sales_order_line_filter
HTTP endpoints (0)

No HTTP endpoints found for this module.

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
Open migration PR — not merged yet for this version
CI status
checks failing
Open since
156 days ago
Last activity
133 days ago
Repository
OCA/sale-workflow
Pull request
[18.0][MIG] sale_price_compliance (#4218)