Merge PR #1255 into 11.0

Signed-off-by legalsylvain
This commit is contained in:
OCA-git-bot
2020-07-17 11:38:22 +00:00
5 changed files with 48 additions and 0 deletions

View File

View File

@@ -0,0 +1,18 @@
# Odoo, Open Source Web Company Title
# Copyright (C) 2019 Alexandre Díaz <dev@redneboa.es>
#
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).#
{
'name': "Web Company Title",
'category': "web",
'version': "11.0.1.0.0",
"author": "Alexandre Díaz, "
"Odoo Community Association (OCA)",
'depends': ['web'],
'data': [
'views/assets.xml',
],
'license': 'AGPL-3',
'auto_install': False,
'installable': True,
}

View File

@@ -0,0 +1 @@
This module show the company name in the browser title-bar.

View File

@@ -0,0 +1,21 @@
/* Copyright 2019 Alexandre Díaz <dev@redneboa.es>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */
odoo.define('web_company_title.TitleChanger', function (require) {
"use strict";
var rpc = require('web.rpc');
var core = require('web.core');
var session = require('web.session');
var web_client = require('web.web_client');
core.bus.on('web_client_ready', null, function () {
rpc.query({
model: 'res.company',
method: 'search_read',
args: [[['id', '=', session.company_id]], ['name']],
}).then(function (companies) {
web_client.set_title_part('company', companies[0].name);
});
});
});

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<template id="assets_backend" name="web_company_title assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript" src="/web_company_title/static/src/js/web_company_title.js"></script>
</xpath>
</template>
</odoo>