Update tryton-sao.js

This commit is contained in:
2026-02-08 16:32:52 +00:00
parent ce1be14602
commit e710262c94

View File

@@ -472,21 +472,12 @@ var Sao = {
var title = [name, Sao.config.title]; var title = [name, Sao.config.title];
document.title = title.filter(function(e) {return e;}).join(' - '); document.title = title.filter(function(e) {return e;}).join(' - ');
var version = 'v1.0.1'; // Remplacer le texte par une image avec le bon style
jQuery('#title').replaceWith( jQuery('#title').replaceWith(
'<div id="title-container" style="display:flex; align-items:center;">' + '<img id="title-logo" src="dist/tradon.png" alt="Logo" style="height: 24px; display: inline-block; vertical-align: middle; margin-left: 8px;">'
'<div style="display:flex; flex-direction:column; line-height:1;">' +
'<img id="title-logo" src="dist/tradon.png" alt="Logo" ' +
'style="height:24px; display:block;">' +
'<span id="title-version" ' +
'style="font-size:11px; color:#333; text-align:center;">' +
version +
'</span>' +
'</div>' +
'</div>'
); );
// Ajouter un style au conteneur parent si nécessaire
jQuery('.navbar-brand').css({ jQuery('.navbar-brand').css({
'display': 'flex', 'display': 'flex',
'align-items': 'center' 'align-items': 'center'
@@ -11456,11 +11447,9 @@ var Sao = {
.on('dragover', false) .on('dragover', false)
.on('drop', this.attach_drop.bind(this)); .on('drop', this.attach_drop.bind(this));
console.log('title',this.title) // if (this.screen.model_name === 'purchase.dashboard') {
console.log('name',this.name) // toolbar.hide();
if (this.title === 'Bought') { // }
toolbar.hide();
}
return toolbar; return toolbar;
}, },
create_tabcontent: function() { create_tabcontent: function() {
@@ -18284,7 +18273,12 @@ function eval_pyson(value){
//this.menu.hide(); //this.menu.hide();
} }
if (this.title.text() === 'Bought' || this.title.text() === 'Sold'){
this.menu.find('.' + this.class_ + '-toolbar').hide();
}
// if (this.screen.model_name === 'back.to.back' ) {
// }
}, },
get_access: function(type) { get_access: function(type) {
var model = this.attributes.relation; var model = this.attributes.relation;
@@ -20706,6 +20700,22 @@ function eval_pyson(value){
Sao.Action.exec_action(action, { ids: [] }, {}); Sao.Action.exec_action(action, { ids: [] }, {});
} }
}); });
// window.addEventListener("message", function (event) {
// // ⚠️ Sécurité : vérifier l'origine
// // if (event.origin !== "https://ton-react.example.com") return;
// if (event.data?.type === "open_tab") {
// const { model, res_id, view_mode, domain } = event.data.payload || {};
// Sao.Tab.create({
// model: model,
// res_id: res_id,
// mode: [view_mode],
// domain: domain,
// target: "new",
// });
// }
// });
Sao.renderHTMLViewerContent = function(container, value, height, width, record) { Sao.renderHTMLViewerContent = function(container, value, height, width, record) {
function decodeHtmlEntities(str) { function decodeHtmlEntities(str) {