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

[11.0][Backport] Fix widget handle #855

Closed
wants to merge 3 commits into from

Conversation

Tardo
Copy link
Member

@Tardo Tardo commented Jun 19, 2019

Description of the issue/feature this PR addresses:
Widget handle doesn't update the sequence properly

Current behavior before PR:
Sequence is not correctly updated
handle_fail

Desired behavior after PR is merged:
Sequence is correctly updated
handle

Cc @Tecnativa

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

Copy link
Member

@yajo yajo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code OK

Copy link
Member

@rafaelbn rafaelbn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested functional 👍

@OCA-git-bot
Copy link

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@Tardo
Copy link
Member Author

Tardo commented Jun 26, 2019

Changes done: files removed.

@Tardo Tardo force-pushed the 11.0-bp-fix-widget_handle branch from c65c8fe to 9a7eac0 Compare June 26, 2019 12:15
@Tardo
Copy link
Member Author

Tardo commented Jun 26, 2019

Changes done

The sequence had a static default value, but when there is an handle, it's important that new items are added at the top or the bottom of the list.

This is a rare case where the defaul_get from the server will be ignored by the view for a certain field.

This will work:
- both in editable mode (inline) and in dialog mode,
- both for X2Many and standalone list.
… set

This fixes the following bug:

Creating an Invoice, clicking on Validate (with no invoice line), and then trying to add a product.

Before this fix, this would throw an error message.

Now it works.
Before this commit, the compute sequence was relying on the fact the ID was used
as a secondary order key to get the right result.

This is necessary when adding items between pages because we don't resequence
the following elements.

However this was not necessary when adding new elements on the last page since
there are no following elements to resesquence in that case.

PR: odoo#27639
@Tardo Tardo force-pushed the 11.0-bp-fix-widget_handle branch from 9a7eac0 to b944100 Compare June 26, 2019 12:27
@Tardo
Copy link
Member Author

Tardo commented Jun 26, 2019

Changes done

@pedrobaeza
Copy link
Member

/ocabot merge

@OCA-git-bot
Copy link

What a great day to merge this nice PR. Let's do it!
Rebased to 11.0-ocabot-merge-pr-855-by-pedrobaeza-bump-no, awaiting test results.

@OCA-git-bot
Copy link

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@OCA-git-bot
Copy link

Congratulations, your PR was merged at e9d2d40. Thanks a lot for contributing to OCA. ❤️

PS: Don't worry if GitHub says there are unmerged commits: it is due to a rebase before merge. All commits of this PR have been merged into 11.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants