Skip to content
Snippets Groups Projects
Commit a2574b45 authored by yhu-odoo's avatar yhu-odoo
Browse files

[FIX] mrp: wrong workorder state in tests

As a good pratice, in compute method, we assign a default value before
we do the actual calculation to avoid issues like no value is assigned
for fields with required=True. For example `reservation_state`:
https://github.com/odoo/odoo/blob/7ebc8cc5771d069b32722d493dd0ae5341e54c96/addons/mrp/models/mrp_production.py#L572
However, since workorder state is depends on this field:
https://github.com/odoo/odoo/blob/7ebc8cc5771d069b32722d493dd0ae5341e54c96/addons/mrp/models/mrp_workorder.py#L158-L159


For some reason, this unexpected false value can lead to some transit
wrong state in tests (it happens when you run the test, but correct
state show when you put a breakpoint and step into each state
computation).
To solve it, we remove this default value assignment. It should be safe
since this field is not required.

closes odoo/odoo#134264

Related: odoo/enterprise#46875
Signed-off-by: default avatarSteve Van Essche <svs@odoo.com>
parent 82e85c14
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