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

[FIX] calendar view `write_model` + `write_field` mechanism doesn't w… #31858

Closed
wants to merge 2 commits into
base: 12.0
from

Conversation

Projects
None yet
6 participants
@iledarn
Copy link
Contributor

iledarn commented Mar 14, 2019

…ork as expected since we always have hardcoded 'partner_id' instead of value of write_field

Description of the issue/feature this PR addresses: this fix is related to user's filter mechanism in calendar views

Current behavior before PR: No matter what is in write_field the partner_id is used when creating a record in write_model

Desired behavior after PR is merged: the field defined in write_field should be used instead of using hard coded partner_id

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

@robodoo robodoo added the seen 🙂 label Mar 14, 2019

@yelizariev
Copy link
Contributor

yelizariev left a comment

Makes sense, though I didn't test

@iledarn

This comment has been minimized.

Copy link
Contributor Author

iledarn commented Mar 15, 2019

It seems that nobody ever used this sidebar filter feature of a calendar view. The only place in Odoo that facilitates it - is in the standard calendar addon. But there is write_field="partner_id" and no error occurs

@robodoo robodoo added the CI 🤖 label Mar 15, 2019

@iledarn

This comment has been minimized.

Copy link
Contributor Author

iledarn commented Mar 15, 2019

It was fixed already in the master branch (but slightly another way), here
#30110

@mreficent

This comment has been minimized.

Copy link
Contributor

mreficent commented Mar 15, 2019

Then, shouldn't be better if you adapt this PR with the changes in master? Maybe by doing a pure backport of 70c6d3b?

@iledarn

This comment has been minimized.

Copy link
Contributor Author

iledarn commented Mar 15, 2019

Yes, I'd better cherry-pick this - 70c6d3b

@iledarn iledarn force-pushed the iledarn:12.0-fix-web-calendar-view-sidebarfilter branch from e137a4d Mar 15, 2019

@robodoo robodoo removed the CI 🤖 label Mar 15, 2019

@iledarn

This comment has been minimized.

Copy link
Contributor Author

iledarn commented Mar 15, 2019

Ok, I've cherry-picked. Do I need Lucas Lefèvre's Odoo CLA signature now?

@mreficent

This comment has been minimized.

Copy link
Contributor

mreficent commented Mar 15, 2019

I don't think so, because @LucasLefevre is an Odoo worker, right @tivisse? cc: @mart-e

iledarn and others added some commits Mar 15, 2019

[FIX] web: backport of 70c6d3b to 12.0
make sidebar filter generic

Adding `res_model` and `res_fields` attributes on a field of
a calendar view adds a filter in the sidebar.
It saves the result as the defined model and should save it
in the defined field.
However `partner_id` has been hardcoded in the rpc call that creates
the record. This breaks genericity, it cannot be used with another
field than `partner_id`.

This commit makes this generic by correctly setting the field name
in the rpc call.

Co-authored-by: Ildar Nasyrov <iledarn@gmail.com>

@mart-e mart-e force-pushed the iledarn:12.0-fix-web-calendar-view-sidebarfilter branch to 5724a09 Mar 15, 2019

@mart-e

This comment has been minimized.

Copy link
Contributor

mart-e commented Mar 15, 2019

No he is but he did not configured correctly his git 😉
I amended the commit to use the correct email address.

@mart-e mart-e requested a review from tivisse Mar 15, 2019

@LucasLefevre

This comment has been minimized.

Copy link
Contributor

LucasLefevre commented Mar 15, 2019

@mart-e Thanks. My git settings have been fixed since.

@mart-e

This comment has been minimized.

Copy link
Contributor

mart-e commented Mar 15, 2019

@LucasLefevre thanks, any objection to backport this commit in 12.0 ?

@LucasLefevre

This comment has been minimized.

Copy link
Contributor

LucasLefevre commented Mar 15, 2019

@mart-e No objection 😉

@robodoo robodoo added the CI 🤖 label Mar 15, 2019

@mart-e

This comment has been minimized.

Copy link
Contributor

mart-e commented Mar 20, 2019

Thanks

@robodoo rebase-ff r+

@robodoo robodoo added the r+ 👌 label Mar 20, 2019

@robodoo

This comment has been minimized.

Copy link
Contributor

robodoo commented Mar 20, 2019

Merge method set to rebase and fast-forward

@robodoo robodoo closed this in 4b8e0d8 Mar 20, 2019

@robodoo robodoo added merged 🎉 and removed merging 👷 labels Mar 20, 2019

@robodoo

This comment has been minimized.

Copy link
Contributor

robodoo commented Mar 20, 2019

Merged, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.