Alexandre Díaz
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with
48 additions and
0 deletions
-
web_company_title/__init__.py
-
web_company_title/__manifest__.py
-
web_company_title/readme/DESCRIPTION.rst
-
web_company_title/static/src/js/web_company_title.js
-
web_company_title/views/assets.xml
|
|
@ -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, |
|
|
|
} |
|
|
@ -0,0 +1 @@ |
|
|
|
This module show the company name in the browser title-bar. |
|
|
@ -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); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
@ -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> |