-
-
Notifications
You must be signed in to change notification settings - Fork 726
[14.0] [MIG] website_field_autocomplete: Migration to 14.0 #870
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
[14.0] [MIG] website_field_autocomplete: Migration to 14.0 #870
Conversation
|
already implemented in v11 |
|
@pedrobaeza I realized that this module is implemented in v11 but it is not merged beacuse an error in the manifest (odoo version 10.0.1.0.0 instead of 11.0.1.0.0) and the pull request is still open since 2017, I migrated it to v14 whithout knowing that because I needed this behavior, is this module still necessary or is there another that has the same behavior? Thanks in advance. |
|
No problem if your commit history contains till them and you have made directly the code adaptation from 10.0 to 14.0 |
|
Please don't include merge commits. |
|
|
Well, that's a question of git, you should rebase instead of pulling or merging. |
d66e288 to
cc1dcd6
Compare
Tardo
left a comment
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 for the work! Can you update the source to use ES6?
| * @param response function Callback for response, accepts array of str | ||
| */ | ||
| autocomplete: function (request, response) { | ||
| var self = this; |
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.
Can avoid 'self' usage if use arrow functions to preserve the context.
|
|
||
| var snippet_animation = require("website.content.snippets.animation"); | ||
|
|
||
| snippet_animation.registry.field_autocomplete = snippet_animation.Animation.extend({ |
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.
Since you are not using effects you can use 'web.public.widget'
|
|
||
|
|
||
| class Website(Website): | ||
| @http.route( |
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.
Why not use type="json" and POST?
|
|
||
| /* Return arguments that are used to initialize autocomplete */ | ||
| autocompleteArgs: function () { | ||
| var self = this; |
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.
Use 'arrow functions' to avoid 'self' usage.
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.
@Tardo I tried to change as little as possible the original code of the module, I modified it with your suggestions please check when you have time, thanks.
|
@racielperdomo1993 thanks for the work! With these changes I intend that the end user always visualizes the field indicated in |
|
@miguel-S73 great, added you as collaborator. |
* Return parsed records from promise * Add `data-value-field` to allow for other value attributes * Fix appearance of demo data (container)
* Break controller getters into two methods to allow for easier inheritance manipulation * Add method in JS to return autocomplete initialization args * Add self.record_ids to represent searched RecordSet * Update request type to JSON in AJAX
* Switch model to website.menu to allow for anonymous access
* Use search_read in controller data getter, instead of custom implementation
* Bump version * Change openerp namespace to odoo * Add OCA icon * Remove jQuery require
ff1664f to
9d76720
Compare
Show Input with `displayField` value and generate hide field with `valueField` value
9d76720 to
fa3d023
Compare
|
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
|
@pedrobaeza @Tardo How do you see this PR? |
|
Sorry, I don't know this module. |
|
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
Migration from 10.0 to 14.0