3
0
Fork 0

Merge PR #2829 into 12.0

Signed-off-by dreispt
12.0
OCA-git-bot 2024-05-18 17:56:26 +00:00
commit 6c3f453a0f
9 changed files with 23 additions and 23 deletions

View File

@ -1,6 +1,8 @@
# Copyright (C) 2023-Today: GRAP (<http://www.grap.coop/>)
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
# pylint: disable=C7902
import logging
from openupgradelib import openupgrade

View File

@ -10,7 +10,7 @@ from dateutil.relativedelta import relativedelta
from collections import OrderedDict
from odoo import api, fields, models
from odoo.tools.safe_eval import safe_eval as eval
from odoo.tools.safe_eval import safe_eval
from odoo.tools.translate import _
from odoo.exceptions import ValidationError, except_orm
@ -202,7 +202,7 @@ class TileTile(models.Model):
eval_context = self._get_eval_context()
domain = tile.domain or "[]"
try:
count = model.search_count(eval(domain, eval_context))
count = model.search_count(safe_eval(domain, eval_context))
except Exception as e:
tile.primary_value = 0.0
tile.primary_formated_value =\
@ -216,7 +216,7 @@ class TileTile(models.Model):
]
read_vals = (
fields
and model.search_read(eval(domain, eval_context), fields)
and model.search_read(safe_eval(domain, eval_context), fields)
or []
)
for f in ["primary_", "secondary_"]:
@ -261,13 +261,13 @@ class TileTile(models.Model):
f_helper = f + "helper"
tile[f_helper] = ""
field_func = FIELD_FUNCTIONS.get(tile[f_function], {})
help = field_func.get("help", False)
if help:
help_text = field_func.get("help", False)
if help_text:
if tile[f_function] != "count" and tile[f_field_id]:
desc = tile[f_field_id].field_description
tile[f_helper] = help % desc
tile[f_helper] = help_text % desc
else:
tile[f_helper] = help
tile[f_helper] = help_text
def _compute_active(self):
ima = self.env["ir.model.access"]

View File

@ -11,4 +11,5 @@ you can write the following code to reduce the load duration of the tree view.
.. code:: xml
<field name="image_small" widget="image" options="{'tooltip_image': 'image'}"/>
<field name="image_small" widget="image" options="{'tooltip_image': 'image'}"/>

View File

@ -4,5 +4,3 @@
* Meet Dholakia <m.dholakia.serpentcs@gmail.com>
* Nikul Chaudhary <nikul.chaudhary.serpentcs@gmail.com>
* Sylvain LE GAL (https://www.twitter.com/legalsylvain)

View File

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

View File

@ -1,4 +1,4 @@
This module defines a images and icons in tree view via Tooltip.
Additionally, Default width with 30px.
.. image:: ../static/description/tree_view_image.png
.. image:: ../static/description/tree_view_image.png

View File

@ -1,3 +1,3 @@
Mouse Hover in tree view image that time Tooltip effect.
.. image:: ../static/description/tree_view_image_tooltip.png
.. image:: ../static/description/tree_view_image_tooltip.png

View File

@ -44,14 +44,14 @@ odoo.define('web_view_calendar_column.CalendarModel', function (require) {
_getFullCalendarOptions: function () {
var result = this._super.apply(this, arguments);
if (this.fieldColumn)
result.resources = [];
return result;
},
calendarEventToRecord: function (event) {
var result = this._super.apply(this, arguments);
if (event.resourceId)
result[this.fieldColumn] = event.resourceId;
return result;
},
result.resources = [];
return result;
},
calendarEventToRecord: function (event) {
var result = this._super.apply(this, arguments);
if (event.resourceId)
result[this.fieldColumn] = event.resourceId;
return result;
},
});
});

View File

@ -1,2 +1,2 @@
* Mathias Markl <mathias.markl@mukit.at>
* Enric Tobella <etobella@creublanca.es>
* Enric Tobella <etobella@creublanca.es>