Files
tryton/src/plugins.js
T
Cédric Krier edf211b25f Check ir.translation access for translate plugin
issue10862
review373901002
(grafted from 2d70702c1424d83cdaf430d780098764b046b714)

--HG--
branch : 6.0
2021-10-21 00:15:16 +02:00

30 lines
872 B
JavaScript

/* This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. */
(function() {
'use strict';
var Translate = {};
Translate.translate_view = function(data) {
var model = data.model;
Sao.Tab.create({
model: 'ir.translation',
domain: [['model', '=', model]],
mode: ['tree', 'form'],
name: Sao.i18n.gettext('Translate view'),
});
};
Translate.get_plugins = function(model) {
var access = Sao.common.MODELACCESS.get('ir.translation');
if (access.read && access.write) {
return [
[Sao.i18n.gettext('Translate view'), Translate.translate_view],
];
} else {
return [];
}
};
Sao.Plugins.push(Translate);
}());