diff --git a/web_widget_url_check/static/src/js/web_widget_url_check.js b/web_widget_url_check/static/src/js/web_widget_url_check.js index 1ec0881..cfd2564 100644 --- a/web_widget_url_check/static/src/js/web_widget_url_check.js +++ b/web_widget_url_check/static/src/js/web_widget_url_check.js @@ -21,14 +21,14 @@ odoo.define('web.web_widget_url_check', function(require) { 'use strict'; var core = require('web.core'); - var widget = require('web.form_widgets'); + var FieldUrl = core.form_widget_registry.get('url'); var reUrl = /(?:https?:\/\/)?(?:[\w]+\.)([a-zA-Z\.]{2,6})([\/\w\.-]*)*\/?/; - widget.FieldUrl.include({ + FieldUrl.include({ is_syntax_valid: function () { var val = this.$('input').val() || ''; return ((val.length === 0) || reUrl.test(val)); } }); -}; +});