Skip to content
Snippets Groups Projects
Commit b5e158c3 authored by Denis Ledoux's avatar Denis Ledoux
Browse files

[FIX] purchase_stock: `on_time_rate` in multi companies


Because of the weird behavior of the ORM regarding
related field pointing to computed fields,
`on_time_rate` was taking account of all companies
when asking it through `purchase.order.on_time_rate`
but it was single-company when asked through `res.partner.on_time_rate`.

It was observed during an upgrade request issue analysis,
and in that case the problem was not even the fact
it was miscomputed, but the fact this computed field,
computed as sudo, leaded to fill the cache for
`purchase.order.line.move_ids` with `stock.move` belonging
to other companies than the user one,
and then when attempting to read values from these stock moves
a multi-company access error was raised.

upg-8106

closes odoo/odoo#66882

X-original-commit: 1b729171
Signed-off-by: default avatarDenis Ledoux (dle) <dle@odoo.com>
parent 965eed79
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment