diff --git a/tryton-sao.js b/tryton-sao.js index dcb0f39..4c61d28 100644 --- a/tryton-sao.js +++ b/tryton-sao.js @@ -471,22 +471,13 @@ var Sao = { Sao.set_title = function(name) { var title = [name, Sao.config.title]; 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( - '
' + - '
' + - '' + - '' + - version + - '' + - '
' + - '
' + '' ); - + + // Ajouter un style au conteneur parent si nécessaire jQuery('.navbar-brand').css({ 'display': 'flex', 'align-items': 'center' @@ -11456,11 +11447,9 @@ var Sao = { .on('dragover', false) .on('drop', this.attach_drop.bind(this)); - console.log('title',this.title) - console.log('name',this.name) - if (this.title === 'Bought') { - toolbar.hide(); - } + // if (this.screen.model_name === 'purchase.dashboard') { + // toolbar.hide(); + // } return toolbar; }, create_tabcontent: function() { @@ -18284,7 +18273,12 @@ function eval_pyson(value){ //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) { var model = this.attributes.relation; @@ -20706,6 +20700,22 @@ function eval_pyson(value){ 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) { function decodeHtmlEntities(str) {