Skip to content
Snippets Groups Projects
Commit 664f8f44 authored by Rémy Voet (ryv)'s avatar Rémy Voet (ryv) Committed by Lois Rilo
Browse files

[FIX] purchase: fix state of extra product


As explained in issues-59664, the commit
f18bdc4fcf2b6b0bdb7699c3b2aa38d332301a84 add
readonly attribute in the `purchase.order.line` state field
to avoid to save bad `state` in the server (then the state of the
PO line != PO line).
But it breaks the feature to add product
when the PO is already confirm (the state will be 'purchase' and the
`product_id` is readonly when state == 'purchase').

To fix both issues, add a `default_state` in the context.
It will "bypass" the attrs of `product_id` and the state of PO
('draft') line won't be save because it is readonly.

resolve #59664

closes odoo/odoo#59720

closes odoo/odoo#58966

Signed-off-by: default avatarArnold Moyaux <amoyaux@users.noreply.github.com>
parent f6626ed4
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