Sale Price Compliance
sale_price_compliance · OCA/sale-workflow
-
Security25/25No findings
-
Activity20/25Last human commit 9 months ago
-
Required by15/251 module depends on it
-
Maturity5/25In 1 Odoo series since 16.0
Heuristic over the facts below, not an audit · How it's computed
Migration considerations
PriceComplianceThresholdConfigMixin— Migrating to 19.0: `_sql_constraints` is ignored and its constraints are silently not created: declare `models.Constraint` attributes instead. migration-sql-constraints · sourceproduct_category_form_view— Migrating to 17.0: `attrs=`/`states=` are rejected in views: convert them to Python expressions in `invisible`/`readonly`/`required`, keeping the original AND/OR logic. migration-view-attrs-states · sourceproduct_template_form_view— Migrating to 17.0: `attrs=`/`states=` are rejected in views: convert them to Python expressions in `invisible`/`readonly`/`required`, keeping the original AND/OR logic. migration-view-attrs-states · sourceproduct_variant_easy_edit_view— Migrating to 17.0: `attrs=`/`states=` are rejected in views: convert them to Python expressions in `invisible`/`readonly`/`required`, keeping the original AND/OR logic. migration-view-attrs-states · sourceres_config_settings_view_form— Migrating to 17.0: `attrs=`/`states=` are rejected in views: convert them to Python expressions in `invisible`/`readonly`/`required`, keeping the original AND/OR logic. migration-view-attrs-states · sourceview_order_form— Migrating to 17.0: `attrs=`/`states=` are rejected in views: convert them to Python expressions in `invisible`/`readonly`/`required`, keeping the original AND/OR logic. migration-view-attrs-states · source
Migration review checklist, not a compatibility verdict. "Migrating to X.0" applies once you upgrade to that version; "Since X.0" means this version already ignores or rejects that code. Methodology
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.




Dependencies
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
Views touched 11
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
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
No new fields.
Public methods (0)No public methods.
-
price_compliance_threshold_t1Floatdefault=0.0digits='Discount'string='Tier 1' -
price_compliance_threshold_t2Floatdefault=0.0digits='Discount'string='Tier 2' -
price_compliance_threshold_t3Floatdefault=0.0digits='Discount'string='Tier 3' -
use_price_compliance_thresholdBooleanstring='Use Price Compliance Thresholds'
-
get_view(self, view_id=None, view_type='form', **options)@api.modelReplaces price_compliance_threshold_t[1,2,3] labels based on tier text definitions from sale.order.line, which can be customized via system parameters.
-
price_compliance_tierSelectionhelp='Indicates the Tier of Price Compliance based on the unit price and applied discount compared to defined thresholds.'readonly=Trueselection='_get_price_compliance_selection_tiers'
No public methods.
No new fields.
Public methods (0)No public methods.
No new fields.
Public methods (0)No public methods.
No new fields.
Public methods (0)No public methods.
-
price_compliance_threshold_t1Floathelp='Threshold for Tier 1 Price Compliance (e.g., High-yield). Prices below this tier are considered fully compliant.'readonly=Falserelated='company_id.price_compliance_threshold_t1' -
price_compliance_threshold_t2Floathelp='Threshold for Tier 2 Price Compliance (e.g., Medium-yield). Prices between Tier 1 and Tier 2 are considered moderately compliant.'readonly=Falserelated='company_id.price_compliance_threshold_t2' -
price_compliance_threshold_t3Floathelp='Threshold for Tier 3 Price Compliance (e.g., Low-yield). Prices between Tier 2 and Tier 3 are considered low compliant.'readonly=Falserelated='company_id.price_compliance_threshold_t3' -
use_price_compliance_thresholdBooleanreadonly=Falserelated='company_id.use_price_compliance_threshold'
No public methods.
No new fields.
Public methods (0)No public methods.
-
price_compliance_dataJsoncompute='_compute_price_compliance_tier'help='Holds additional data related to price compliance calculations.'readonly=Truestore=True -
price_compliance_tierSelectioncompute='_compute_price_compliance_tier'store=True
No public methods.
-
price_compliance_tierSelectionhelp='Indicates the Tier of Price Compliance based on the unit price and applied discount compared to defined thresholds.'selection='_get_price_compliance_tiers'
No public methods.
Loading…