-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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] web_widget_x2many_2d_matrix: _renderBodyCell #1124
[FIX] web_widget_x2many_2d_matrix: _renderBodyCell #1124
Conversation
@simahawk @yajo @pedrobaeza @tarteo please review this fix, and sorry for introducing an issue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. For the options parameter in the function I would rather use _.defaults once instead of checking every time (also on line 286) it options
is something.
web_widget_x2many_2d_matrix/static/src/js/2d_matrix_renderer.js
Outdated
Show resolved
Hide resolved
@bjeficent @mreficent can you review plz? |
30bfaa3
to
388e11c
Compare
this is an example why open source is so super cool: I introduced this widget a while ago, others picked it up, extended, and now I'm at a state where I don't understand the diff without reading all of what people did during the v11 and v12 migration. Looks great! But I'm still reading, so can't put a review currently |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexey-pelykh LG. I'd like to see a version upgrade and a line in the changelog. Can you do that?
@tarteo checking that format thingy and how it changed... on abstract field they do this: // formatType is used to determine which format (and parse) functions
// to call to format the field's value to insert into the DOM (typically
// put into a span or an input), and to parse the value from the input
// to send it to the server. These functions are chosen according to
// the 'widget' attrs if is is given, and if it is a valid key, with a
// fallback on the field type, ensuring that the value is formatted and
// displayed according to the choosen widget, if any.
this.formatType = this.attrs.widget in field_utils.format ?
this.attrs.widget :
this.field.type; so, yes, there could be also a specific formatting by widget if found in the registry, However, in the list renderer is ignored and I think it's because you already try to render via widget (which is going to handle it using Seems legit, no? |
388e11c
to
4ddc16c
Compare
@simahawk done, also please check:
|
@simahawk Ah yes, thanks. @alexey-pelykh Can you add some comments in the code on what's happening. |
web_widget_x2many_2d_matrix/static/src/js/2d_matrix_renderer.js
Outdated
Show resolved
Hide resolved
web_widget_x2many_2d_matrix/static/src/js/2d_matrix_renderer.js
Outdated
Show resolved
Hide resolved
4ddc16c
to
5645621
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yikes, this is really hard to review. Please, could you add some details on what are you fixing and how, and remove all the clutter introduced with all that commented code, to keep a smaller diff, easier to review?
Please abstain from opening big PRs without description. Thanks!
web_widget_x2many_2d_matrix/static/src/js/2d_matrix_renderer.js
Outdated
Show resolved
Hide resolved
6f893a9
to
d923931
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will only say that this makes OCA/timesheet#140 to work with hr_timesheet_sheet. So It'd be great if all comments here are attended and we can move on with that.
d923931
to
6d4729d
Compare
All changes made as of now |
@tarteo can you please update your review? |
Significant note: for some reason, editable mode is not working.
worth checking |
|
6d4729d
to
043cfc1
Compare
/me dumb - now fields can be editable properly |
Several questions about this (some might be out of the scope of this PR):
|
@pedrobaeza unfortunately I'm unable to address any of these questions properly, this PR is related to migration, so I don't think it would fix anything by magic. Yet, it may have introduced support for widgets (question 1.), and right now the editable state is propagated from parent (question 2.) |
Well, maybe 3 might be introduced in your migration, so that's why I asked... @tarteo please confirm the review for merging this. |
043cfc1
to
ed6f1f8
Compare
ed6f1f8
to
343d056
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
No description provided.