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

remove boolean widget on signature binary field #72276

Closed

Conversation

msh-odoo
Copy link
Contributor

PURPOSE
When writing something in signture field in stock.picking and enable signature field in listview throws traceback.

SPEC
Remove boolean widget on signature field.

TASK 2570929

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

Before this commit: when writing something in signture field in stock.picking
and enable signature field in listview throws traceback.

After this commit: when signature field is set and enabling it in list view
will not throw traceback, traceback was generated because boolean field
was applied on Image field, to fix it simply remove boolean widget on
signature field.

task-2570929
@msh-odoo msh-odoo requested a review from a team as a code owner June 17, 2021 11:03
@robodoo
Copy link
Contributor

robodoo commented Jun 17, 2021

@C3POdoo C3POdoo added the RD research & development, internal work label Jun 17, 2021
@amoyaux
Copy link
Contributor

amoyaux commented Jun 17, 2021

I would rather completely remove it from the view or fix the boolean widget for this case. It's a bit useless to have the size of the image in the list view

@mcm-odoo
Copy link
Contributor

mcm-odoo commented Jun 17, 2021

@msh-odoo @amoyaux Hello, I was checking it and I don't think having size of the image for a column "Signed" is great
and also the fix should'nt be in the boolean widget/component.
Boolean widget must support only boolean fields so we should better have a computed field is_signed and use it instead of the binary field.

@amoyaux
Copy link
Contributor

amoyaux commented Jun 17, 2021

@mcm-odoo Yep seems a good solution

@llacroix
Copy link

@amoyaux yes, the widget should be likely fixed by using a special validation check instead of the constructor. You can see the comments in my issue.

Boolean widget must support only boolean fields so we should better have a computed field is_signed and use it instead of the binary field.

That's pretty much how we fixed it in for our client. I kinda agree that the Boolean widget should only work with booleans... but in reality odoo used to have the boolean as True for non false values. So undefined/false/null would be False while anything else would be considered True. It obviously work for any readonly field and can be used for any field. That's why it worked with the binary field in the past as an empty datas would return null/false while a saved data would return a size which is not false.

But to make it clear, we needed it in the view as a boolean so removing the widget is worthless. is_signed is fine while in my opinion it will require more computation for a boolean field... Seems a bit overkill when the widget can be more flexible.

@msh-odoo
Copy link
Contributor Author

@mcm-odoo @amoyaux Should I add computed field is_signed in 14.0 as issue is available in 14.0?

@amoyaux
Copy link
Contributor

amoyaux commented Jun 21, 2021

@msh-odoo You can do a PR for master, I will merge this one like that. It's not otimal but it will avoid the traceback and the diff is safe for a stable.

@amoyaux
Copy link
Contributor

amoyaux commented Jun 21, 2021

robodoo r+

@robodoo robodoo closed this in 2679b67 Jun 21, 2021
@robodoo robodoo temporarily deployed to merge June 21, 2021 15:23 Inactive
msh-odoo added a commit to odoo-dev/odoo that referenced this pull request Jun 23, 2021
signaature field was used in listview and it was displaying size of the
signature file, it has been done in commit: 4bdbb9b
but as discussed on PR: odoo#72276
we added is_signed computed boolean field to display it like boolean as boolean
widget is supported only on boolean type field.

task-2580117
robodoo pushed a commit that referenced this pull request Jun 24, 2021
signaature field was used in listview and it was displaying size of the
signature file, it has been done in commit: 4bdbb9b
but as discussed on PR: #72276
we added is_signed computed boolean field to display it like boolean as boolean
widget is supported only on boolean type field.

task-2580117

closes #72592

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
@fw-bot fw-bot deleted the 14.0-stock-picking-signature-msh branch July 5, 2021 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants