Swapnesh-SerpentCS
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with
89 additions and
0 deletions
-
web_widget_prefixed_url/README.rst
-
web_widget_prefixed_url/__init__.py
-
web_widget_prefixed_url/__manifest__.py
-
BIN
web_widget_prefixed_url/static/description/icon.png
-
web_widget_prefixed_url/static/src/js/widget_prefixed_url.js
-
web_widget_prefixed_url/views/template.xml
|
|
@ -0,0 +1,37 @@ |
|
|
|
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.png |
|
|
|
:alt: License: AGPL-3 |
|
|
|
|
|
|
|
======================================================== |
|
|
|
Module for adding 'prefixed_url:' widget to your fields. |
|
|
|
======================================================== |
|
|
|
|
|
|
|
Using this widget user can add any hyperlink action using field option. |
|
|
|
|
|
|
|
Usage |
|
|
|
===== |
|
|
|
|
|
|
|
<field name="skype_name" widget="prefixed_url" options="{'prefix_name': 'skype'}"/> |
|
|
|
|
|
|
|
Credits |
|
|
|
======= |
|
|
|
|
|
|
|
Contributors |
|
|
|
------------ |
|
|
|
|
|
|
|
* Jay Vora <jay.vora@serpentcs.com> |
|
|
|
* Swapnesh Shah <s.shah.serpentcs@gmail.com> |
|
|
|
|
|
|
|
Maintainer |
|
|
|
---------- |
|
|
|
|
|
|
|
.. image:: https://odoo-community.org/logo.png |
|
|
|
:alt: Odoo Community Association |
|
|
|
:target: https://odoo-community.org |
|
|
|
|
|
|
|
This module is maintained by the OCA. |
|
|
|
|
|
|
|
OCA, or the Odoo Community Association, is a nonprofit organization whose |
|
|
|
mission is to support the collaborative development of Odoo features and |
|
|
|
promote its widespread use. |
|
|
|
|
|
|
|
To contribute to this module, please visit https://odoo-community.org. |
|
|
@ -0,0 +1,18 @@ |
|
|
|
# Copyright 2019 - TODAY Serpent Consulting Services Pvt. Ltd. |
|
|
|
# (<http://www.serpentcs.com>) |
|
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|
|
|
{ |
|
|
|
'name': "Web Widget Prefixed URL", |
|
|
|
'version': "11.0.1.0.0", |
|
|
|
'author': "Serpent Consulting Services Pvt. Ltd., " |
|
|
|
"Odoo Community Association (OCA)", |
|
|
|
'category': 'Web', |
|
|
|
'website': "https://github.com/OCA/Web", |
|
|
|
'license': 'AGPL-3', |
|
|
|
'depends': [ |
|
|
|
'web' |
|
|
|
], |
|
|
|
'data': [ |
|
|
|
'views/template.xml', |
|
|
|
], |
|
|
|
} |
Width: 128
|
Height: 128
|
Size: 9.2 KiB
|
|
|
@ -0,0 +1,23 @@ |
|
|
|
odoo.define('web_widget_prefixed_url.WidgetPrefixedUrlCustom', function(require) { |
|
|
|
"use strict"; |
|
|
|
|
|
|
|
var field_registry = require('web.field_registry'); |
|
|
|
var basic_fields = require('web.basic_fields'); |
|
|
|
|
|
|
|
var WidgetPrefixedUrlCustom = basic_fields.FieldEmail.extend({ |
|
|
|
_renderReadonly: function() { |
|
|
|
if (this.attrs.options.prefix_name !== undefined) { |
|
|
|
var prefix = this.attrs.options.prefix_name; |
|
|
|
this.$el.text(this.value) |
|
|
|
.addClass('o_form_uri o_text_overflow') |
|
|
|
.attr('href', prefix + ':' + this.value); |
|
|
|
} else { |
|
|
|
this.$el.text(this.value); |
|
|
|
} |
|
|
|
}, |
|
|
|
}); |
|
|
|
|
|
|
|
field_registry.add('prefixed_url', WidgetPrefixedUrlCustom); |
|
|
|
|
|
|
|
return WidgetPrefixedUrlCustom; |
|
|
|
}); |
|
|
@ -0,0 +1,11 @@ |
|
|
|
<odoo> |
|
|
|
<!-- Prefixed Widget Asset--> |
|
|
|
<template id="assets_widget_prefixed_url" inherit_id="web.assets_backend" |
|
|
|
name="Widget Prefixed URL assets"> |
|
|
|
<xpath expr="." position="inside"> |
|
|
|
<script type="text/javascript" |
|
|
|
src="/web_widget_prefixed_url/static/src/js/widget_prefixed_url.js"/> |
|
|
|
</xpath> |
|
|
|
</template> |
|
|
|
|
|
|
|
</odoo> |