[FIX] project_average_acceptable_time: use on_account_update hook #37

Merged
stephansainleger merged 1 commits from 18.0-project-average-acceptable-time-portal-fix into 18.0 2026-11-12 16:36:21 +00:00

1 Commits

Author SHA1 Message Date
Stéphan Sainléger
dbb5711ae9 [FIX] project_average_acceptable_time: use on_account_update hook
Some checks failed
pre-commit / pre-commit (pull_request) Failing after 1m23s
tests / test (pull_request) Successful in 2m39s
The portal override validated the submitted data a second time after
``super().account()`` returned. When the partner cannot edit its VAT (child
contact or issued invoices), the country select is disabled and not
submitted; Odoo core injects the missing ``country_id`` in its own copy of
the posted data, but the raw payload re-validated by the module still
lacked it, raising ``KeyError: 'country_id'`` and a 500 on save.

Move the default-project update to ``on_account_update()``, which Odoo
calls after a successful validation, and drop the duplicate validation.
Add a regression test with a child contact whose country field is disabled.
2026-11-10 22:57:57 +01:00