mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
0
web_company_title/__init__.py
Normal file
0
web_company_title/__init__.py
Normal file
18
web_company_title/__manifest__.py
Normal file
18
web_company_title/__manifest__.py
Normal 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,
|
||||
}
|
||||
1
web_company_title/readme/DESCRIPTION.rst
Normal file
1
web_company_title/readme/DESCRIPTION.rst
Normal file
@@ -0,0 +1 @@
|
||||
This module show the company name in the browser title-bar.
|
||||
21
web_company_title/static/src/js/web_company_title.js
Normal file
21
web_company_title/static/src/js/web_company_title.js
Normal 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);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
8
web_company_title/views/assets.xml
Normal file
8
web_company_title/views/assets.xml
Normal 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>
|
||||
Reference in New Issue
Block a user