3
0
Fork 0

[IMP] web_tree_image_tooltip: black, isort, prettier

13.0
Tran Thanh Phuc 2021-01-31 12:18:45 +07:00
parent e36f1ee392
commit 48297b86a2
10 changed files with 53 additions and 44 deletions

View File

@ -0,0 +1 @@
../../../../web_tree_image_tooltip

View File

@ -0,0 +1,6 @@
import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)

View File

@ -6,20 +6,16 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Show images in tree views via tooltip',
'version': '12.0.1.0.0',
'author': "Therp BV, "
"name": "Show images in tree views via tooltip",
"version": "12.0.1.0.0",
"author": "Therp BV, "
"MONK Software, "
"Odoo Community Association (OCA), "
"Serpent Consulting Services Pvt. Ltd.",
'website': 'https://github.com/OCA/web',
'license': 'AGPL-3',
'category': 'Web',
'depends': [
'web',
],
'data': [
'view/assets.xml',
],
'installable': True,
"website": "https://github.com/OCA/web",
"license": "AGPL-3",
"category": "Web",
"depends": ["web",],
"data": ["view/assets.xml",],
"installable": True,
}

View File

@ -3,4 +3,3 @@
* Jay Vora <jay.vora@serpentcs.com>
* Meet Dholakia <m.dholakia.serpentcs@gmail.com>
* Nikul Chaudhary <nikul.chaudhary.serpentcs@gmail.com>

View File

@ -1,2 +1 @@
* Serpent Consulting Services Pvt. Ltd. <support@serpentcs.com>

View File

@ -1,3 +1,2 @@
This module defines a images and icons in tree view via Tooltip.
Additionally, Default width with 30px.

View File

@ -1,2 +1 @@
Mouse Hover in tree view image that time Tooltip effect.

View File

@ -1,19 +1,21 @@
odoo.define('web_tree_image_tooltip.web_tree_image_tooltip',
function (require) {
odoo.define("web_tree_image_tooltip.web_tree_image_tooltip", function(require) {
"use strict";
var ListRenderer = require('web.ListRenderer');
var ListRenderer = require("web.ListRenderer");
ListRenderer.include({
events: _.extend({}, ListRenderer.prototype.events, {
'mouseover tbody tr td .o_field_image': '_onHoverRecord_img',
"mouseover tbody tr td .o_field_image": "_onHoverRecord_img",
}),
_onHoverRecord_img: function(event) {
var img_src =
$(event.currentTarget).children('.img-fluid').attr('src')
$(event.currentTarget).tooltip({
var img_src = $(event.currentTarget)
.children(".img-fluid")
.attr("src");
$(event.currentTarget)
.tooltip({
title: "<img src=" + img_src + " class='tooltip_image' />",
delay: 0,
}).tooltip('show');
}
});
})
.tooltip("show");
},
});
});

View File

@ -1,11 +1,19 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<template id="assets_backend" name="tree icon assets" inherit_id="web.assets_backend">
<template
id="assets_backend"
name="tree icon assets"
inherit_id="web.assets_backend"
>
<xpath expr="." position="inside">
<link rel='stylesheet' href='/web_tree_image_tooltip/static/src/scss/common.scss'/>
<script type="text/javascript" src="/web_tree_image_tooltip/static/src/js/tooltip.js"/>
<link
rel='stylesheet'
href='/web_tree_image_tooltip/static/src/scss/common.scss'
/>
<script
type="text/javascript"
src="/web_tree_image_tooltip/static/src/js/tooltip.js"
/>
</xpath>
</template>
</odoo>