Browse Source

Merge d6a815c163 into d736ee4460

pull/1255/merge
Alexandre Díaz 5 years ago
committed by GitHub
parent
commit
c6ad16d272
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 0
      web_company_title/__init__.py
  2. 18
      web_company_title/__manifest__.py
  3. 1
      web_company_title/readme/DESCRIPTION.rst
  4. 21
      web_company_title/static/src/js/web_company_title.js
  5. 8
      web_company_title/views/assets.xml

0
web_company_title/__init__.py

18
web_company_title/__manifest__.py

@ -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

@ -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

@ -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

@ -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>
Loading…
Cancel
Save