Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various server-side form view fixes #32047

Closed
wants to merge 4 commits into from

Conversation

xmo-odoo
Copy link
Collaborator

@xmo-odoo
Copy link
Collaborator Author

robodoo rebase-ff

@robodoo
Copy link
Contributor

robodoo commented Mar 22, 2019

Merge method set to rebase and fast-forward

@C3POdoo C3POdoo added the RD research & development, internal work label Mar 22, 2019
PRs odoo#28645 and odoo#31494 were not applied to 12.0, but there's no reason
not to, they should only fix things (make behaviours more in-line with
the regular client), and since o2m is an area where more fixes are
needed and it would be nice to have them in 12.0...
@robodoo robodoo added the CI 🤖 Robodoo has seen passing statuses label Apr 3, 2019
The extra setup probably affects any o2m whose edition view itself
contains an o2m, but most likely to blow up entirely on models with
some sort of tree structure (parent/child relationship): the SSF
eagerly loads and setups the o2m's view, and the o2m's o2m's, ... ad
infinitam.

A better / cleaner fix would be to set up the subview on-demand (and
possibly cache it), but the rest of the o2m stuff is unlikely to work
correctly recursively so just don't recurse the o2m view setup at all
for now.

fixes odoo#31458
The SSF would correctly filter out readonly fields when saving a
toplevel form, however it could not remove readonly values when saving
o2m pseudo-records to the parent form (as these would be expected to
remain available for reading upon the next edition and whatnot), so
these values would get sent in 0/1 commands.

Filter out these fields during the parent / toplevel save call.

Complexity notes:

* evaluating readonly modifiers requires the entire record, so
  unchanged fields still have to be written back to the parent form
  and be filtered out when *it* is set up for save, an alternative
  would be to store the `changed` and `readonly` flags alongside the
  record dict, and have the post-process only override the
  pre-computed readonly flag using force_save
* had to fix a test to match the new behaviour, the post-edition
  states turns out to be in line with the client's behaviour (or how
  it looks anyway)

Fixes odoo#32019
@robodoo robodoo added CI 🤖 Robodoo has seen passing statuses and removed CI 🤖 Robodoo has seen passing statuses labels Apr 3, 2019
Test was relying on qty_to_consume getting saved when the produce form
is saved, a behaviour of the SSF which diverged from the actual
client.

After fixing the SSF to behave more in-line with the actual
client (don't save o2m sub-fields unless they're flagged as
force_save) the test is now visibly broken.

Fix it so qty_done is properly updated during wizard configuration /
edition instead of updating the in-database object directly.
@robodoo robodoo removed the CI 🤖 Robodoo has seen passing statuses label Apr 3, 2019
@xmo-odoo
Copy link
Collaborator Author

xmo-odoo commented Apr 3, 2019

robodoo r+

@robodoo robodoo added r+ 👌 CI 🤖 Robodoo has seen passing statuses labels Apr 3, 2019
@robodoo robodoo closed this in 2430e28 Apr 3, 2019
@robodoo
Copy link
Contributor

robodoo commented Apr 3, 2019

Merged, thanks!

@fw-bot fw-bot deleted the 12.0-ssf-fixes-xmo branch October 19, 2019 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI 🤖 Robodoo has seen passing statuses RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants