OdooWiki OCA HUB

Sale Margin Update

sale_margin_update folder_open OCA/sale-workflow open_in_new
Uncategorised License: LGPL-3

Recalculate expected unit price from margin.

auto_awesome What this module does

AI-generated from the code · Odoo 16.0

Adds a refresh button on sale orders and order lines that opens a small wizard where you enter a margin percentage and Odoo recalculates the unit price of the products accordingly.

This module extends the sale margin features already available in Odoo. On a sales order and on each sales order line, a small refresh icon button appears next to the margin information. Clicking it opens a pop-up window titled "Update Sale Order Line Price by Margin".

In that pop-up you type a margin percentage. The field is mandatory and Odoo immediately blocks values below 0 or equal to or above 100 with an error message, so the margin must stay between 0 and 100.

When you press the "Recalculate" button, Odoo updates the unit price of the products on the order or on the selected line. The new price is calculated from the product's cost (purchase price) and the quantity, so that the chosen margin percentage is reached. Existing line discounts are taken into account so the final price stays consistent with the discount. Lines without a product are skipped.

The change is applied to the whole sales order when the button is used from the order, or only to one line when the button is used from that line. The module works together with the standard sales and sale margin apps and does not create new menus; everything happens through the refresh buttons and the pop-up wizard.

Depends on

salesales_teamsale_margin
Models and fields (3)
  • sale.order · extends an existing model
  • sale.order.line · extends an existing model
  • sale.recalculate.price.margin · new modelline_id, order_id, sale_margin_percent (Margin (%))

Text generated by AI (DeepSeek) from reading the Odoo 16.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub

Availability by version

Reviewed: 2026-11-03
Confirmed (verified in repository and branch) Estimated (unverified) No information

Confirmation status: 1 confirmed, 8 with no information of 9 versions.

Sources · Odoo 16.0

Confirmed on 2026-11-03 in branch 16.0 of OCA/sale-workflow.

terminal Installation and usage

No verified information

Installation instructions, the distribution package, dependencies and configuration steps are not shown because they have not yet been verified in the module documentation for any version.

info

Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.