Skip to content

[FIX] purchase_stock_ux: use product_uom_id when merging procurement into PO line - #396

Closed
fw-bot-adhoc wants to merge 1 commit into
ingadhoc:20.0from
adhoc-dev:20.0-19.0-h-131058-pam-10636-fw
Closed

fw-bot-adhoc wants to merge 1 commit into
ingadhoc:20.0from
adhoc-dev:20.0-19.0-h-131058-pam-10636-fw

Conversation

@fw-bot-adhoc

Copy link
Copy Markdown

Ticket: https://www.adhoc.inc/odoo/helpdesk.ticket/131058

In 19.0 purchase.order.line.product_uom was renamed to product_uom_id. The standard price fallback in stock.rule._update_purchase_order_line still used the old name.

Reproduction

  1. Storable product with route Buy, cost > 0 and a vendor with price 0 (vendor without buyer).
  2. Replenish the product: a draft RFQ is created.
  3. Replenish again: the procurement is merged into the existing RFQ line and raises AttributeError: 'purchase.order.line' object has no attribute 'product_uom'.

Fix
Use product_uom_id. Added a test that runs two buy procurements and checks that they merge into one line priced at the product cost.

Forward-Port-Of: #394

@roboadhoc

Copy link
Copy Markdown
Contributor

Pull request status dashboard

@fw-bot-adhoc

Copy link
Copy Markdown
Author

@pablohmontenegro @les-adhoc cherrypicking of pull request #394 failed.

stdout:

Auto-merging purchase_stock_ux/tests/__init__.py
CONFLICT (content): Merge conflict in purchase_stock_ux/tests/__init__.py

Either perform the forward-port manually (and push to this branch, proceeding as usual) or close this PR (maybe?).

:shipit: you can use git-fw to re-do the forward-port for you locally.

⚠️ after resolving this conflict, you will need to merge it via @roboadhoc.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

…into PO line

In 19.0 purchase.order.line.product_uom was renamed to product_uom_id.
The standard price fallback in _update_purchase_order_line still used the
old name, so merging a buy procurement into an existing RFQ line raised
AttributeError when the vendor had no price and the product had a cost.

X-original-commit: 3ebaa9e
@pablohmontenegro
pablohmontenegro force-pushed the 20.0-19.0-h-131058-pam-10636-fw branch from b66a3aa to d50968e Compare October 29, 2026 13:34
@pablohmontenegro

Copy link
Copy Markdown
Contributor

@roboadhoc nobump r+

@roboadhoc roboadhoc closed this in 39f6188 Oct 29, 2026
@roboadhoc
roboadhoc deleted the 20.0-19.0-h-131058-pam-10636-fw branch October 29, 2026 14:42
@roboadhoc roboadhoc added the 19.1 label Oct 29, 2026

This branch was successfully deployed

1 active deployment
merge — d50968e6 Deployed Oct 29, 2026 by roboadhoc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants