Skip to content

[FIX] product_replenishment_cost_stock: remove standard_price fallback - #904

Open
jcadhoc wants to merge 1 commit into
ingadhoc:18.0from
adhoc-dev:18.0-fix-replenishment-cost-standard-price-fallback
Open

[FIX] product_replenishment_cost_stock: remove standard_price fallback#904
jcadhoc wants to merge 1 commit into
ingadhoc:18.0from
adhoc-dev:18.0-fix-replenishment-cost-standard-price-fallback

Conversation

@jcadhoc

@jcadhoc jcadhoc commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Problem

When price_unit resolved to 0 during procurement/replenishment flows, product_replenishment_cost_stock was falling back to product_id.standard_price. With product_replenishment_cost installed, the replenishment-cost cron overwrites standard_price with the replenishment cost (often expressed in a different currency, e.g. ARS), producing wrong prices in purchase orders instead of 0 or the correct supplier net price.

Affected methods:

  • _prepare_purchase_order_line_from_procurement in product_replenishment_cost_stock/purchase_order_line.py
  • _update_purchase_order_line in product_replenishment_cost_stock/stock_rule.py

Fix

Remove both standard_price fallbacks. When net_price is 0 or unavailable, the price stays 0 and the caller handles it explicitly — no silent corruption from the replenishment cost value.

Notes

When price_unit resolved to 0 (e.g. net_price not available for the
supplier), the fallback to standard_price was producing incorrect
prices because the replenishment-cost cron overwrites standard_price
with the replenishment cost (often in a different currency/value than
the supplier price).

Backport of ingadhoc#892 to 18.0 — remove the fallback in
both _prepare_purchase_order_line_from_procurement and
_update_purchase_order_line so that a zero price stays zero and the
caller handles the missing price explicitly.
@roboadhoc

Copy link
Copy Markdown
Contributor

Pull request status dashboard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants