{"id":153208,"date":"2019-01-23T11:01:47","date_gmt":"2019-01-23T11:01:47","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=153208"},"modified":"2021-07-16T14:08:24","modified_gmt":"2021-07-16T14:08:24","slug":"odoo-datalist-creation-with-dynamic-data","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/odoo-datalist-creation-with-dynamic-data\/","title":{"rendered":"Create Datalist in Odoo"},"content":{"rendered":"\n<p>In this tutorial, I am going to show how we can create a &lt;datalist&gt; with dynamic data.&nbsp; I will show this with reference to Odoo. We will see how we can add dynamic data in the &lt;datalist&gt; in Odoo.<br>The HTML &lt;datalist&gt; tag is used to provide an auto-complete feature on HTML elements. It provides a list of predefined options to the users to select data.&nbsp;&nbsp;It can be used with &lt;input&gt; tag so that users can easily fill the data in the forms using select the data. The &lt;datalist&gt; tag should be used with an &lt;input&gt; element that contains a &#8220;list&#8221; attribute. The value of &#8220;list&#8221; attribute is linked with the &#8220;id&#8221; of the &lt;datalist&gt;.<\/p>\n\n\n\n<p>First, let us consider&nbsp; how a &lt;datalist&gt; can be created with static data in simple HTML.<\/p>\n\n\n\n<p>Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;datalist&gt; ... &lt;\/datalist&gt;\n<\/pre>\n\n\n\n<p>Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted brush:xml\">&lt;input type=\"text\" id=\"my_datalist_id\" list=\"my_datalist_list\"&gt;  \n &lt;datalist id=\"my_datalist_list\"&gt;  \n    &lt;option value=\"Value 1\"&gt;  \n    &lt;option value=\"Value 2\"&gt;  \n    &lt;option value=\"Value 3\"&gt;   \n    &lt;option value=\"Value 4\"&gt;   \n    &lt;option value=\"Value 5\"&gt;   \n    &lt;option value=\"Value 4\"&gt;   \n&lt;\/datalist&gt;\n<\/pre>\n\n\n\n<p>Now we will consider an example in Odoo. We will consider that we are having a list of Orderlines and we will display the data of the Orderlines in the options of the &lt;datalist&gt;.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted brush:xml\">&lt;input list=\"order_lines_datalist\" name=\"rma_order_line_search\" placeholder=\"Search for Order line data\"\/&gt;\n   &lt;datalist id=\"order_lines_datalist\"&gt;\n      &lt;span t-set=\"order_lines\" t-value=\"website.get_orderlines()\"\/&gt;\n      &lt;span t-foreach=\"order_lines\" t-as=\"orderline_id\"&gt;\n           &lt;option t-att-value=\"orderline_id.name\"&gt;&lt;\/option&gt;\n\t&lt;\/span&gt;\n   &lt;\/datalist&gt;\n<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted brush:py\">class Website(models.Model):\n    _inherit = \"website\"\n\n    @api.model\n    def get_orderline_rma_string(self):\n       order_ids = self.env['sale.order.line].search([])\n       return order_ids<\/pre>\n\n\n\n<p class=\"brush:py\">That is it.!!!<br><span style=\"color: #666699;\">If you liked&nbsp;this post, It would be very grateful if you write your opinions, comments and suggestions to keep the post updated and interesting.<\/span><br><strong><span style=\"color: #666699;\">Thank you!<\/span><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&nbsp;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, I am going to show how we can create a &lt;datalist&gt; with dynamic data.&nbsp; I will show this with reference to Odoo. We will see how we can add dynamic data in the &lt;datalist&gt; in Odoo.The HTML &lt;datalist&gt; tag is used to provide an auto-complete feature on HTML elements. It provides a <a href=\"https:\/\/webkul.com\/blog\/odoo-datalist-creation-with-dynamic-data\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":88,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[251,2007,7512],"tags":[8084,8085,8086,8083],"class_list":["post-153208","post","type-post","status-publish","format-standard","hentry","category-html5","category-odoo","category-optimization-techniques-html5","tag-datalist","tag-dynamic-data-in-datlist","tag-html-datalist","tag-odoo-datalist"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Create Datalist in Odoo - Webkul Blog Odoo datalist with dynamic data<\/title>\n<meta name=\"description\" content=\"The HTML datalist tag is used to provide an auto-complete feature on HTML elements. It provides a list of predefined options to the users to select data\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/odoo-datalist-creation-with-dynamic-data\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Create Datalist in Odoo - Webkul Blog Odoo datalist with dynamic data\" \/>\n<meta property=\"og:description\" content=\"The HTML datalist tag is used to provide an auto-complete feature on HTML elements. It provides a list of predefined options to the users to select data\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/odoo-datalist-creation-with-dynamic-data\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2019-01-23T11:01:47+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-07-16T14:08:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Jahangir Naik\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jahangir Naik\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/odoo-datalist-creation-with-dynamic-data\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/odoo-datalist-creation-with-dynamic-data\/\"},\"author\":{\"name\":\"Jahangir Naik\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/d3efd6f1d02c2713752e7cba0b626ca6\"},\"headline\":\"Create Datalist in Odoo\",\"datePublished\":\"2019-01-23T11:01:47+00:00\",\"dateModified\":\"2021-07-16T14:08:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/odoo-datalist-creation-with-dynamic-data\/\"},\"wordCount\":225,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"keywords\":[\"datalist\",\"Dynamic data in datlist\",\"HTML datalist\",\"Odoo Datalist\"],\"articleSection\":[\"html5\",\"Odoo\",\"Optimization Techniques\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/odoo-datalist-creation-with-dynamic-data\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/odoo-datalist-creation-with-dynamic-data\/\",\"url\":\"https:\/\/webkul.com\/blog\/odoo-datalist-creation-with-dynamic-data\/\",\"name\":\"Create Datalist in Odoo - Webkul Blog Odoo datalist with dynamic data\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"datePublished\":\"2019-01-23T11:01:47+00:00\",\"dateModified\":\"2021-07-16T14:08:24+00:00\",\"description\":\"The HTML datalist tag is used to provide an auto-complete feature on HTML elements. It provides a list of predefined options to the users to select data\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/odoo-datalist-creation-with-dynamic-data\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/odoo-datalist-creation-with-dynamic-data\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/odoo-datalist-creation-with-dynamic-data\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create Datalist in Odoo\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/d3efd6f1d02c2713752e7cba0b626ca6\",\"name\":\"Jahangir Naik\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/20021fdcdb324166dd5aef0f183ffb391facf8853dd58f9fcabc0950f4118c01?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/20021fdcdb324166dd5aef0f183ffb391facf8853dd58f9fcabc0950f4118c01?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Jahangir Naik\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/jahangir260\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Create Datalist in Odoo - Webkul Blog Odoo datalist with dynamic data","description":"The HTML datalist tag is used to provide an auto-complete feature on HTML elements. It provides a list of predefined options to the users to select data","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/odoo-datalist-creation-with-dynamic-data\/","og_locale":"en_US","og_type":"article","og_title":"Create Datalist in Odoo - Webkul Blog Odoo datalist with dynamic data","og_description":"The HTML datalist tag is used to provide an auto-complete feature on HTML elements. It provides a list of predefined options to the users to select data","og_url":"https:\/\/webkul.com\/blog\/odoo-datalist-creation-with-dynamic-data\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2019-01-23T11:01:47+00:00","article_modified_time":"2021-07-16T14:08:24+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png","type":"image\/png"}],"author":"Jahangir Naik","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Jahangir Naik","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/odoo-datalist-creation-with-dynamic-data\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/odoo-datalist-creation-with-dynamic-data\/"},"author":{"name":"Jahangir Naik","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/d3efd6f1d02c2713752e7cba0b626ca6"},"headline":"Create Datalist in Odoo","datePublished":"2019-01-23T11:01:47+00:00","dateModified":"2021-07-16T14:08:24+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/odoo-datalist-creation-with-dynamic-data\/"},"wordCount":225,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"keywords":["datalist","Dynamic data in datlist","HTML datalist","Odoo Datalist"],"articleSection":["html5","Odoo","Optimization Techniques"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/odoo-datalist-creation-with-dynamic-data\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/odoo-datalist-creation-with-dynamic-data\/","url":"https:\/\/webkul.com\/blog\/odoo-datalist-creation-with-dynamic-data\/","name":"Create Datalist in Odoo - Webkul Blog Odoo datalist with dynamic data","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"datePublished":"2019-01-23T11:01:47+00:00","dateModified":"2021-07-16T14:08:24+00:00","description":"The HTML datalist tag is used to provide an auto-complete feature on HTML elements. It provides a list of predefined options to the users to select data","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/odoo-datalist-creation-with-dynamic-data\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/odoo-datalist-creation-with-dynamic-data\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/odoo-datalist-creation-with-dynamic-data\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Create Datalist in Odoo"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/d3efd6f1d02c2713752e7cba0b626ca6","name":"Jahangir Naik","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/20021fdcdb324166dd5aef0f183ffb391facf8853dd58f9fcabc0950f4118c01?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/20021fdcdb324166dd5aef0f183ffb391facf8853dd58f9fcabc0950f4118c01?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Jahangir Naik"},"url":"https:\/\/webkul.com\/blog\/author\/jahangir260\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/153208","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/88"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=153208"}],"version-history":[{"count":24,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/153208\/revisions"}],"predecessor-version":[{"id":296704,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/153208\/revisions\/296704"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=153208"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=153208"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=153208"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}