3
0
Fork 0

[IMP] pre-commit run after update

Includes some manual fixes to silent ESLint warnings.
13.0
Jairo Llopis 2020-01-24 13:45:39 +00:00
parent 6d971237af
commit 77b09d555c
No known key found for this signature in database
GPG Key ID: 0CFC348F9B242B08
37 changed files with 662 additions and 532 deletions

View File

@ -37,7 +37,8 @@ env:
- VERSION="13.0" TESTS="0" LINT_CHECK="0" MAKEPOT="0" - VERSION="13.0" TESTS="0" LINT_CHECK="0" MAKEPOT="0"
install: install:
- git clone --depth=1 https://github.com/OCA/maintainer-quality-tools.git ${HOME}/maintainer-quality-tools - git clone --depth=1 https://github.com/OCA/maintainer-quality-tools.git
${HOME}/maintainer-quality-tools
- export PATH=${HOME}/maintainer-quality-tools/travis:${PATH} - export PATH=${HOME}/maintainer-quality-tools/travis:${PATH}
- travis_install_nightly - travis_install_nightly

View File

@ -9,12 +9,12 @@ odoo.define("web_decimal_numpad_dot.FieldFloat", function (require) {
var NumpadDotReplaceMixin = { var NumpadDotReplaceMixin = {
l10n_decimal_point: function() { l10n_decimal_point: function() {
return this.formatType === "float_time" return this.formatType === "float_time"
? ":" : translation._t.database.parameters.decimal_point; ? ":"
: translation._t.database.parameters.decimal_point;
}, },
_replaceAt: function(cur_val, from, to, replacement) { _replaceAt: function(cur_val, from, to, replacement) {
return cur_val.substring(0, from) + replacement + return cur_val.substring(0, from) + replacement + cur_val.substring(to);
cur_val.substring(to);
}, },
_onKeydown: function(event) { _onKeydown: function(event) {

View File

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

View File

@ -1,25 +1,24 @@
odoo.define('web_dialog_size.web_dialog_size', function (require) { odoo.define("web_dialog_size.web_dialog_size", function(require) {
'use strict'; "use strict";
var rpc = require('web.rpc'); var rpc = require("web.rpc");
var Dialog = require('web.Dialog'); var Dialog = require("web.Dialog");
var config = rpc.query({ var config = rpc.query({
model: 'ir.config_parameter', model: "ir.config_parameter",
method: 'get_web_dialog_size_config', method: "get_web_dialog_size_config",
}); });
Dialog.include({ Dialog.include({
willStart: function() { willStart: function() {
var self = this; var self = this;
return this._super.apply(this, arguments).then(function() { return this._super.apply(this, arguments).then(function() {
self.$modal.find('.dialog_button_extend').on('click', self.$modal
self.proxy('_extending') .find(".dialog_button_extend")
); .on("click", self.proxy("_extending"));
self.$modal.find('.dialog_button_restore').on('click', self.$modal
self.proxy('_restore') .find(".dialog_button_restore")
); .on("click", self.proxy("_restore"));
return config.then(function(r) { return config.then(function(r) {
if (r.default_maximize) { if (r.default_maximize) {
self._extending(); self._extending();
@ -31,14 +30,16 @@ odoo.define('web_dialog_size.web_dialog_size', function (require) {
}, },
opened: function() { opened: function() {
return this._super.apply(this, arguments).then(function () { return this._super.apply(this, arguments).then(
function() {
if (this.$modal) { if (this.$modal) {
this.$modal.draggable({ this.$modal.draggable({
handle: '.modal-header', handle: ".modal-header",
helper: false, helper: false,
}); });
} }
}.bind(this)); }.bind(this)
);
}, },
close: function() { close: function() {
@ -52,19 +53,17 @@ odoo.define('web_dialog_size.web_dialog_size', function (require) {
}, },
_extending: function() { _extending: function() {
var dialog = this.$modal.find('.modal-dialog'); var dialog = this.$modal.find(".modal-dialog");
dialog.addClass('dialog_full_screen'); dialog.addClass("dialog_full_screen");
dialog.find('.dialog_button_extend').hide(); dialog.find(".dialog_button_extend").hide();
dialog.find('.dialog_button_restore').show(); dialog.find(".dialog_button_restore").show();
}, },
_restore: function() { _restore: function() {
var dialog = this.$modal.find('.modal-dialog'); var dialog = this.$modal.find(".modal-dialog");
dialog.removeClass('dialog_full_screen'); dialog.removeClass("dialog_full_screen");
dialog.find('.dialog_button_restore').hide(); dialog.find(".dialog_button_restore").hide();
dialog.find('.dialog_button_extend').show(); dialog.find(".dialog_button_extend").show();
}, },
}); });
}); });

View File

@ -1,4 +1,3 @@
.modal { .modal {
.dialog_full_screen { .dialog_full_screen {
@include media-breakpoint-up(sm) { @include media-breakpoint-up(sm) {
@ -15,7 +14,8 @@
} }
} }
&.dialog_button_extend, .dialog_button_restore { &.dialog_button_extend,
.dialog_button_restore {
@include media-breakpoint-down(sm) { @include media-breakpoint-down(sm) {
display: none !important; display: none !important;
} }

View File

@ -5,8 +5,12 @@
<i class="fa fa-close" /> <i class="fa fa-close" />
</t> </t>
<t t-jquery="button.close" t-operation="before"> <t t-jquery="button.close" t-operation="before">
<button type="button" class="dialog_button_extend close"><i class="fa fa-expand" /></button> <button type="button" class="dialog_button_extend close"><i
<button type="button" class="dialog_button_restore close"><i class="fa fa-compress" /></button> class="fa fa-expand"
/></button>
<button type="button" class="dialog_button_restore close"><i
class="fa fa-compress"
/></button>
</t> </t>
</t> </t>
</templates> </templates>

View File

@ -1,9 +1,19 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<odoo> <odoo>
<template id="assets_backend" name="web_dialog_size assets" inherit_id="web.assets_backend"> <template
id="assets_backend"
name="web_dialog_size assets"
inherit_id="web.assets_backend"
>
<xpath expr="." position="inside"> <xpath expr="." position="inside">
<link rel="stylesheet" href="/web_dialog_size/static/src/scss/web_dialog_size.scss"/> <link
<script type="text/javascript" src="/web_dialog_size/static/src/js/web_dialog_size.js"></script> rel="stylesheet"
href="/web_dialog_size/static/src/scss/web_dialog_size.scss"
/>
<script
type="text/javascript"
src="/web_dialog_size/static/src/js/web_dialog_size.js"
/>
</xpath> </xpath>
</template> </template>
</odoo> </odoo>

View File

@ -1,8 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<odoo> <odoo>
<template id="assets_backend" name="web_domain_field assets" inherit_id="web.assets_backend"> <template
id="assets_backend"
name="web_domain_field assets"
inherit_id="web.assets_backend"
>
<xpath expr="script[last()]" position="after"> <xpath expr="script[last()]" position="after">
<script type="text/javascript" src="/web_domain_field/static/src/js/pyeval.js" /> <script
type="text/javascript"
src="/web_domain_field/static/src/js/pyeval.js"
/>
</xpath> </xpath>
</template> </template>
</odoo> </odoo>

View File

@ -18,8 +18,8 @@
transform: rotate(-45deg); transform: rotate(-45deg);
z-index: 9999; z-index: 9999;
position: fixed; position: fixed;
box-shadow: 0 0 3px rgba(0,0,0,.3); box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
background: rgba(255,0,0,.6); background: rgba(255, 0, 0, 0.6);
pointer-events: none; pointer-events: none;
} }

View File

@ -5,11 +5,11 @@
Copyright 2017 Xavier Jiménez <xavier.jimenez@qubiq.es> Copyright 2017 Xavier Jiménez <xavier.jimenez@qubiq.es>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */
odoo.define('web_environment_ribbon.ribbon', function (require) { odoo.define("web_environment_ribbon.ribbon", function(require) {
"use strict"; "use strict";
var rpc = require('web.rpc'); var rpc = require("web.rpc");
var core = require('web.core'); var core = require("web.core");
// Code from: http://jsfiddle.net/WK_of_Angmar/xgA5C/ // Code from: http://jsfiddle.net/WK_of_Angmar/xgA5C/
function validStrColour(strToTest) { function validStrColour(strToTest) {
@ -33,31 +33,31 @@ odoo.define('web_environment_ribbon.ribbon', function (require) {
return image.style.color !== "rgb(255, 255, 255)"; return image.style.color !== "rgb(255, 255, 255)";
} }
core.bus.on('web_client_ready', null, function () { core.bus.on("web_client_ready", null, function() {
var ribbon = $('<div class="test-ribbon hidden"/>'); var ribbon = $('<div class="test-ribbon hidden"/>');
$('body').append(ribbon); $("body").append(ribbon);
ribbon.hide(); ribbon.hide();
// Get ribbon data from backend // Get ribbon data from backend
rpc.query({ rpc.query({
model: 'web.environment.ribbon.backend', model: "web.environment.ribbon.backend",
method: 'get_environment_ribbon', method: "get_environment_ribbon",
}).then( }).then(function(ribbon_data) {
function (ribbon_data) {
// Ribbon name // Ribbon name
if (ribbon_data.name && ribbon_data.name !== 'False') { if (ribbon_data.name && ribbon_data.name !== "False") {
ribbon.html(ribbon_data.name); ribbon.html(ribbon_data.name);
ribbon.show(); ribbon.show();
} }
// Ribbon color // Ribbon color
if (ribbon_data.color && validStrColour(ribbon_data.color)) { if (ribbon_data.color && validStrColour(ribbon_data.color)) {
ribbon.css('color', ribbon_data.color); ribbon.css("color", ribbon_data.color);
} }
// Ribbon background color // Ribbon background color
if (ribbon_data.background_color && if (
validStrColour(ribbon_data.background_color)) { ribbon_data.background_color &&
ribbon.css('background-color', ribbon_data.background_color); validStrColour(ribbon_data.background_color)
) {
ribbon.css("background-color", ribbon_data.background_color);
} }
} });
);
}); });
}); });

View File

@ -5,13 +5,16 @@
<odoo> <odoo>
<!-- Load css for ribbons --> <!-- Load css for ribbons -->
<template id="assets_backend" name="ribbon_test assets" <template id="assets_backend" name="ribbon_test assets" inherit_id="web.assets_backend">
inherit_id="web.assets_backend">
<xpath expr="." position="inside"> <xpath expr="." position="inside">
<link rel="stylesheet" <link
href="/web_environment_ribbon/static/src/css/ribbon.css"/> rel="stylesheet"
<script type="text/javascript" href="/web_environment_ribbon/static/src/css/ribbon.css"
src="/web_environment_ribbon/static/src/js/ribbon.js"/> />
<script
type="text/javascript"
src="/web_environment_ribbon/static/src/js/ribbon.js"
/>
</xpath> </xpath>
</template> </template>

View File

@ -1,19 +1,20 @@
// Copyright 2017 - 2018 Modoolar <info@modoolar.com> // Copyright 2017 - 2018 Modoolar <info@modoolar.com>
// Copyright 2018 Modoolar <info@modoolar.com> // Copyright 2018 Modoolar <info@modoolar.com>
// License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). // License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
odoo.define('web_ir_actions_act_view_reload.ir_actions_act_view_reload', function (require) { odoo.define("web_ir_actions_act_view_reload.ir_actions_act_view_reload", function(
require
) {
"use strict"; "use strict";
var ActionManager = require('web.ActionManager'); var ActionManager = require("web.ActionManager");
ActionManager.include({ ActionManager.include({
/** /**
* Intercept action handling to detect extra action type * Intercept action handling to detect extra action type
* @override * @override
*/ */
_handleAction: function(action, options) { _handleAction: function(action, options) {
if (action.type === 'ir.actions.act_view_reload') { if (action.type === "ir.actions.act_view_reload") {
return this._executeReloadAction(action, options); return this._executeReloadAction(action, options);
} }
@ -32,7 +33,5 @@ odoo.define('web_ir_actions_act_view_reload.ir_actions_act_view_reload', functio
return Promise.resolve(); return Promise.resolve();
}, },
}); });
}); });

View File

@ -5,10 +5,16 @@ Copyright 2018 Brainbean Apps
License LGPLv3.0 or later (https://www.gnu.org/licenses/lgpl-3.0.en.html). License LGPLv3.0 or later (https://www.gnu.org/licenses/lgpl-3.0.en.html).
--> -->
<odoo> <odoo>
<template id="assets_backend" name="web_ir_actions_act_view_reload assets" inherit_id="web.assets_backend"> <template
id="assets_backend"
name="web_ir_actions_act_view_reload assets"
inherit_id="web.assets_backend"
>
<xpath expr="." position="inside"> <xpath expr="." position="inside">
<script type="text/javascript" <script
src="/web_ir_actions_act_view_reload/static/src/js/web_ir_actions_act_view_reload.js"/> type="text/javascript"
src="/web_ir_actions_act_view_reload/static/src/js/web_ir_actions_act_view_reload.js"
/>
</xpath> </xpath>
</template> </template>
</odoo> </odoo>

View File

@ -1,9 +1,16 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<odoo> <odoo>
<data> <data>
<template id="assets_backend" name="web_no_bubble_assets" inherit_id="web.assets_backend"> <template
id="assets_backend"
name="web_no_bubble_assets"
inherit_id="web.assets_backend"
>
<xpath expr="." position="inside"> <xpath expr="." position="inside">
<link rel="stylesheet" href="/web_no_bubble/static/src/css/web_no_bubble.scss"/> <link
rel="stylesheet"
href="/web_no_bubble/static/src/css/web_no_bubble.scss"
/>
</xpath> </xpath>
</template> </template>
</data> </data>

View File

@ -1,11 +1,9 @@
odoo.define('web_notify.WebClient', function (require) { odoo.define("web_notify.WebClient", function(require) {
"use strict"; "use strict";
var WebClient = require('web.WebClient'); var WebClient = require("web.WebClient");
var base_bus = require('bus.Longpolling'); var session = require("web.session");
var session = require('web.session'); require("bus.BusService");
require('bus.BusService');
WebClient.include({ WebClient.include({
show_application: function() { show_application: function() {
@ -14,11 +12,11 @@ odoo.define('web_notify.WebClient', function (require) {
return res; return res;
}, },
start_polling: function() { start_polling: function() {
this.channel_success = 'notify_success_' + session.uid; this.channel_success = "notify_success_" + session.uid;
this.channel_danger = 'notify_danger_' + session.uid; this.channel_danger = "notify_danger_" + session.uid;
this.channel_warning = 'notify_warning_' + session.uid; this.channel_warning = "notify_warning_" + session.uid;
this.channel_info = 'notify_info_' + session.uid; this.channel_info = "notify_info_" + session.uid;
this.channel_default = 'notify_default_' + session.uid; this.channel_default = "notify_default_" + session.uid;
this.all_channels = [ this.all_channels = [
this.channel_success, this.channel_success,
this.channel_danger, this.channel_danger,
@ -26,15 +24,13 @@ odoo.define('web_notify.WebClient', function (require) {
this.channel_info, this.channel_info,
this.channel_default, this.channel_default,
]; ];
this.call('bus_service', 'addChannel', this.channel_success); this.call("bus_service", "addChannel", this.channel_success);
this.call('bus_service', 'addChannel', this.channel_danger); this.call("bus_service", "addChannel", this.channel_danger);
this.call('bus_service', 'addChannel', this.channel_warning); this.call("bus_service", "addChannel", this.channel_warning);
this.call('bus_service', 'addChannel', this.channel_info); this.call("bus_service", "addChannel", this.channel_info);
this.call('bus_service', 'addChannel', this.channel_default); this.call("bus_service", "addChannel", this.channel_default);
this.call( this.call("bus_service", "on", "notification", this, this.bus_notification);
'bus_service', 'on', 'notification', this.call("bus_service", "startPolling");
this, this.bus_notification);
this.call('bus_service', 'startPolling');
}, },
bus_notification: function(notifications) { bus_notification: function(notifications) {
var self = this; var self = this;
@ -42,7 +38,7 @@ odoo.define('web_notify.WebClient', function (require) {
var channel = notification[0]; var channel = notification[0];
var message = notification[1]; var message = notification[1];
if ( if (
self.all_channels != null && self.all_channels !== null &&
self.all_channels.indexOf(channel) > -1 self.all_channels.indexOf(channel) > -1
) { ) {
self.on_message(message); self.on_message(message);
@ -50,16 +46,13 @@ odoo.define('web_notify.WebClient', function (require) {
}); });
}, },
on_message: function(message) { on_message: function(message) {
return this.call( return this.call("notification", "notify", {
'notification', 'notify', {
type: message.type, type: message.type,
title: message.title, title: message.title,
message: message.message, message: message.message,
sticky: message.sticky, sticky: message.sticky,
className: message.className, className: message.className,
} });
);
}, },
}); });
}); });

View File

@ -1,26 +1,26 @@
odoo.define('web_notify.Notification', function (require) { odoo.define("web_notify.Notification", function(require) {
"use strict"; "use strict";
var Notification = require('web.Notification'); var Notification = require("web.Notification");
Notification.include({ Notification.include({
icon_mapping: { icon_mapping: {
'success': 'fa-thumbs-up', success: "fa-thumbs-up",
'danger': 'fa-exclamation-triangle', danger: "fa-exclamation-triangle",
'warning': 'fa-exclamation', warning: "fa-exclamation",
'info': 'fa-info', info: "fa-info",
'default': 'fa-lightbulb-o', default: "fa-lightbulb-o",
}, },
init: function() { init: function() {
this._super.apply(this, arguments); this._super.apply(this, arguments);
// Delete default classes // Delete default classes
this.className = this.className.replace(' o_error', ''); this.className = this.className.replace(" o_error", "");
// Add custom icon and custom class // Add custom icon and custom class
this.icon = (this.type in this.icon_mapping) ? this.icon =
this.icon_mapping[this.type] : this.type in this.icon_mapping
this.icon_mapping['default']; ? this.icon_mapping[this.type]
this.className += ' o_' + this.type; : this.icon_mapping.default;
this.className += " o_" + this.type;
}, },
}); });
}); });

View File

@ -2,23 +2,23 @@
.o_notification { .o_notification {
&.o_success { &.o_success {
color: white; color: white;
background-color: theme-color('success'); background-color: theme-color("success");
} }
&.o_danger { &.o_danger {
color: white; color: white;
background-color: theme-color('danger'); background-color: theme-color("danger");
} }
&.o_warning { &.o_warning {
color: white; color: white;
background-color: theme-color('warning'); background-color: theme-color("warning");
} }
&.o_info { &.o_info {
color: white; color: white;
background-color: theme-color('info'); background-color: theme-color("info");
} }
&.o_default { &.o_default {
color: black; color: black;
background-color: theme-color('default'); background-color: theme-color("default");
} }
} }
} }

View File

@ -11,34 +11,44 @@
<page string="Test web notify" name="test_web_notify"> <page string="Test web notify" name="test_web_notify">
<group> <group>
<group> <group>
<button name="notify_success" <button
name="notify_success"
type="object" type="object"
string="Test success notification" string="Test success notification"
class="oe_highlight"/> class="oe_highlight"
/>
</group> </group>
<group> <group>
<button name="notify_danger" <button
name="notify_danger"
type="object" type="object"
string="Test danger notification" string="Test danger notification"
class="oe_highlight"/> class="oe_highlight"
/>
</group> </group>
<group> <group>
<button name="notify_warning" <button
name="notify_warning"
type="object" type="object"
string="Test warning notification" string="Test warning notification"
class="oe_highlight"/> class="oe_highlight"
/>
</group> </group>
<group> <group>
<button name="notify_info" <button
name="notify_info"
type="object" type="object"
string="Test info notification" string="Test info notification"
class="oe_highlight"/> class="oe_highlight"
/>
</group> </group>
<group> <group>
<button name="notify_default" <button
name="notify_default"
type="object" type="object"
string="Test default notification" string="Test default notification"
class="oe_highlight"/> class="oe_highlight"
/>
</group> </group>
</group> </group>
</page> </page>

View File

@ -1,12 +1,31 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<odoo> <odoo>
<template id="assets_backend" name="web_notify assets" inherit_id="web.assets_backend"> <template
<link rel="stylesheet" type="text/scss" href="/web/static/src/scss/webclient.scss" position="after"> id="assets_backend"
<link rel="stylesheet" type="text/scss" href="/web_notify/static/src/scss/webclient.scss"/> name="web_notify assets"
inherit_id="web.assets_backend"
>
<link
rel="stylesheet"
type="text/scss"
href="/web/static/src/scss/webclient.scss"
position="after"
>
<link
rel="stylesheet"
type="text/scss"
href="/web_notify/static/src/scss/webclient.scss"
/>
</link> </link>
<xpath expr="." position="inside"> <xpath expr="." position="inside">
<script type="text/javascript" src="/web_notify/static/src/js/web_client.js"/> <script
<script type="text/javascript" src="/web_notify/static/src/js/widgets/notification.js"/> type="text/javascript"
src="/web_notify/static/src/js/web_client.js"
/>
<script
type="text/javascript"
src="/web_notify/static/src/js/widgets/notification.js"
/>
</xpath> </xpath>
</template> </template>
</odoo> </odoo>

View File

@ -42,8 +42,7 @@ $chatter_zone_width: 35%;
} }
.o_menu_sections, .o_menu_sections,
.o_menu_systray, .o_menu_systray {
{
padding: 0; padding: 0;
} }
} }
@ -56,8 +55,7 @@ $chatter_zone_width: 35%;
// Hide big things // Hide big things
.o_menu_brand, .o_menu_brand,
.o_menu_sections, .o_menu_sections,
.oe_topbar_name, .oe_topbar_name {
{
display: none; display: none;
} }
@ -85,8 +83,7 @@ $chatter_zone_width: 35%;
> li, > li,
.o_menu_entry_lvl_1, .o_menu_entry_lvl_1,
.o_menu_header_lvl_1, .o_menu_header_lvl_1 {
{
// Homogeneous background color // Homogeneous background color
background-color: $dropdown-bg; background-color: $dropdown-bg;
color: $dropdown-link-color; color: $dropdown-link-color;
@ -137,7 +134,6 @@ $chatter_zone_width: 35%;
// Iconized full screen apps menu // Iconized full screen apps menu
.o_menu_apps { .o_menu_apps {
.search-input:focus { .search-input:focus {
border-color: $o-brand-primary; border-color: $o-brand-primary;
} }
@ -238,8 +234,7 @@ html .o_web_client .o_action_manager .o_action {
.o_cp_buttons, .o_cp_buttons,
.o_cp_left, .o_cp_left,
.o_cp_right, .o_cp_right,
.o_cp_searchview, .o_cp_searchview {
{
flex: 1 1 100%; flex: 1 1 100%;
@include media-breakpoint-up(md) { @include media-breakpoint-up(md) {
flex-basis: 50%; flex-basis: 50%;
@ -251,8 +246,7 @@ html .o_web_client .o_action_manager .o_action {
} }
.o_cp_searchview, .o_cp_searchview,
.o_cp_right, .o_cp_right {
{
flex-basis: 10%; flex-basis: 10%;
} }
@ -333,7 +327,8 @@ html .o_web_client .o_action_manager .o_action {
} }
// Normal views // Normal views
.o_content, .modal-content { .o_content,
.modal-content {
max-width: 100%; max-width: 100%;
// Form views // Form views
@ -380,14 +375,13 @@ html .o_web_client .o_action_manager .o_action {
.oe_button_box { .oe_button_box {
.o_dropdown_more { .o_dropdown_more {
button:last-child { button:last-child {
border-right: 1px solid gray('400'); border-right: 1px solid gray("400");
} }
} }
} }
// Avoid overflow on forms with title and/or button box // Avoid overflow on forms with title and/or button box
.oe_title, .oe_title {
{
max-width: 100%; max-width: 100%;
} }
@ -442,8 +436,7 @@ html .o_web_client .o_action_manager .o_action {
// Full width in form sheets // Full width in form sheets
.o_form_sheet, .o_form_sheet,
.oe_chatter, .oe_chatter {
{
min-width: auto; min-width: auto;
max-width: 98%; max-width: 98%;
} }
@ -508,7 +501,7 @@ html .o_web_client .o_action_manager .o_action {
} }
.o_chatter { .o_chatter {
border-left: 1px solid gray('400'); border-left: 1px solid gray("400");
flex: 0 0 $chatter_zone_width; flex: 0 0 $chatter_zone_width;
max-width: initial; max-width: initial;
min-width: initial; min-width: initial;
@ -547,7 +540,8 @@ html .o_web_client .o_action_manager .o_action {
.table-responsive { .table-responsive {
.o_list_table { .o_list_table {
// th & td are here for compatibility with chrome // th & td are here for compatibility with chrome
thead, thead tr:nth-child(1) th { thead,
thead tr:nth-child(1) th {
position: sticky; position: sticky;
top: 0; top: 0;
z-index: 1; z-index: 1;
@ -555,7 +549,8 @@ html .o_web_client .o_action_manager .o_action {
thead tr:nth-child(1) th { thead tr:nth-child(1) th {
background-color: $o-list-footer-bg-color; background-color: $o-list-footer-bg-color;
} }
tfoot, tfoot tr:nth-child(1) td { tfoot,
tfoot tr:nth-child(1) td {
position: sticky; position: sticky;
bottom: 0; bottom: 0;
} }
@ -585,10 +580,12 @@ html .o_web_client .o_action_manager .o_action {
right: 0; right: 0;
/* Show/Hide control buttons (next, prev, etc..) */ /* Show/Hide control buttons (next, prev, etc..) */
&:hover .arrow, &:hover .o_viewer_toolbar { &:hover .arrow,
&:hover .o_viewer_toolbar {
display: flex; display: flex;
} }
.arrow, .o_viewer_toolbar { .arrow,
.o_viewer_toolbar {
display: none; display: none;
} }
@ -611,7 +608,8 @@ html .o_web_client .o_action_manager .o_action {
} }
} }
@include media-breakpoint-down(lg) { @include media-breakpoint-down(lg) {
.o_minimize_btn, .o_maximize_btn { .o_minimize_btn,
.o_maximize_btn {
display: none; display: none;
} }
} }
@ -619,7 +617,8 @@ html .o_web_client .o_action_manager .o_action {
} }
/* Max/Min buttons only are usefull in sided mode */ /* Max/Min buttons only are usefull in sided mode */
.o_web_client:not(.o_chatter_position_sided) { .o_web_client:not(.o_chatter_position_sided) {
.o_minimize_btn, .o_maximize_btn { .o_minimize_btn,
.o_maximize_btn {
display: none; display: none;
} }
} }

View File

@ -1,28 +1,28 @@
/* Copyright 2018 Tecnativa - Jairo Llopis /* Copyright 2018 Tecnativa - Jairo Llopis
* License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */ * License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */
odoo.define('web_responsive', function (require) { odoo.define("web_responsive", function(require) {
'use strict'; "use strict";
const ActionManager = require('web.ActionManager'); const ActionManager = require("web.ActionManager");
const AbstractWebClient = require("web.AbstractWebClient"); const AbstractWebClient = require("web.AbstractWebClient");
const AppsMenu = require("web.AppsMenu"); const AppsMenu = require("web.AppsMenu");
const BasicController = require('web.BasicController'); const BasicController = require("web.BasicController");
const config = require("web.config"); const config = require("web.config");
const core = require("web.core"); const core = require("web.core");
const FormRenderer = require('web.FormRenderer'); const FormRenderer = require("web.FormRenderer");
const Menu = require("web.Menu"); const Menu = require("web.Menu");
const RelationalFields = require('web.relational_fields'); const RelationalFields = require("web.relational_fields");
const Chatter = require('mail.Chatter'); const Chatter = require("mail.Chatter");
const ListRenderer = require('web.ListRenderer'); const ListRenderer = require("web.ListRenderer");
const DocumentViewer = require('mail.DocumentViewer'); const DocumentViewer = require("mail.DocumentViewer");
/* /*
* Helper function to know if are waiting * Helper function to know if are waiting
* *
*/ */
function isWaiting() { function isWaiting() {
return $('.oe_wait').length !== 0; return $(".oe_wait").length !== 0;
} }
/** /**
@ -82,14 +82,17 @@ odoo.define('web_responsive', function (require) {
} }
AppsMenu.include({ AppsMenu.include({
events: _.extend({ events: _.extend(
{
"keydown .search-input input": "_searchResultsNavigate", "keydown .search-input input": "_searchResultsNavigate",
"input .search-input input": "_searchMenusSchedule", "input .search-input input": "_searchMenusSchedule",
"click .o-menu-search-result": "_searchResultChosen", "click .o-menu-search-result": "_searchResultChosen",
"shown.bs.dropdown": "_searchFocus", "shown.bs.dropdown": "_searchFocus",
"hidden.bs.dropdown": "_searchReset", "hidden.bs.dropdown": "_searchReset",
"hide.bs.dropdown": "_hideAppsMenu", "hide.bs.dropdown": "_hideAppsMenu",
}, AppsMenu.prototype.events), },
AppsMenu.prototype.events
),
/** /**
* Rescue some menu data stripped out in original method. * Rescue some menu data stripped out in original method.
@ -99,16 +102,11 @@ odoo.define('web_responsive', function (require) {
init: function(parent, menuData) { init: function(parent, menuData) {
this._super.apply(this, arguments); this._super.apply(this, arguments);
// Keep base64 icon for main menus // Keep base64 icon for main menus
for (let n in this._apps) { for (const n in this._apps) {
this._apps[n].web_icon_data = this._apps[n].web_icon_data = menuData.children[n].web_icon_data;
menuData.children[n].web_icon_data;
} }
// Store menu data in a format searchable by fuzzy.js // Store menu data in a format searchable by fuzzy.js
this._searchableMenus = _.reduce( this._searchableMenus = _.reduce(menuData.children, findNames, {});
menuData.children,
findNames,
{}
);
// Search only after timeout, for fast typers // Search only after timeout, for fast typers
this._search_def = false; this._search_def = false;
}, },
@ -144,9 +142,12 @@ odoo.define('web_responsive', function (require) {
*/ */
_menuInfo: function(key) { _menuInfo: function(key) {
const original = this._searchableMenus[key]; const original = this._searchableMenus[key];
return _.extend({ return _.extend(
action_id: parseInt(original.action.split(',')[1], 10), {
}, original); action_id: parseInt(original.action.split(",")[1], 10),
},
original
);
}, },
/** /**
@ -171,7 +172,7 @@ odoo.define('web_responsive', function (require) {
* Schedule a search on current menu items. * Schedule a search on current menu items.
*/ */
_searchMenusSchedule: function() { _searchMenusSchedule: function() {
this._search_def = new Promise((resolve) => { this._search_def = new Promise(resolve => {
setTimeout(resolve, 50); setTimeout(resolve, 50);
}); });
this._search_def.then(this._searchMenus.bind(this)); this._search_def.then(this._searchMenus.bind(this));
@ -187,26 +188,16 @@ odoo.define('web_responsive', function (require) {
this.$search_results.empty(); this.$search_results.empty();
return; return;
} }
var results = fuzzy.filter( var results = fuzzy.filter(query, _.keys(this._searchableMenus), {
query,
_.keys(this._searchableMenus),
{
pre: "<b>", pre: "<b>",
post: "</b>", post: "</b>",
} });
); this.$search_container.toggleClass("has-results", Boolean(results.length));
this.$search_container.toggleClass(
"has-results",
Boolean(results.length)
);
this.$search_results.html( this.$search_results.html(
core.qweb.render( core.qweb.render("web_responsive.MenuSearchResults", {
"web_responsive.MenuSearchResults",
{
results: results, results: results,
widget: this, widget: this,
} })
)
); );
}, },
@ -293,12 +284,11 @@ odoo.define('web_responsive', function (require) {
* Control if AppDrawer can be closed * Control if AppDrawer can be closed
*/ */
_hideAppsMenu: function() { _hideAppsMenu: function() {
return !isWaiting() && !this.$('input').is(':focus'); return !isWaiting() && !this.$("input").is(":focus");
}, },
}); });
BasicController.include({ BasicController.include({
/** /**
* Close the AppDrawer if the data set is dirty and a discard dialog * Close the AppDrawer if the data set is dirty and a discard dialog
* is opened * is opened
@ -307,25 +297,27 @@ odoo.define('web_responsive', function (require) {
*/ */
canBeDiscarded: function(recordID) { canBeDiscarded: function(recordID) {
if (this.model.isDirty(recordID || this.handle)) { if (this.model.isDirty(recordID || this.handle)) {
$('.o_menu_apps .dropdown:has(.dropdown-menu.show) > a') $(".o_menu_apps .dropdown:has(.dropdown-menu.show) > a").dropdown(
.dropdown('toggle'); "toggle"
$('.o_menu_sections li.show .dropdown-toggle') );
.dropdown('toggle'); $(".o_menu_sections li.show .dropdown-toggle").dropdown("toggle");
} }
return this._super.apply(this, arguments); return this._super.apply(this, arguments);
}, },
}); });
Menu.include({ Menu.include({
events: _.extend({ events: _.extend(
{
// Clicking a hamburger menu item should close the hamburger // Clicking a hamburger menu item should close the hamburger
"click .o_menu_sections [role=menuitem]": "_hideMobileSubmenus", "click .o_menu_sections [role=menuitem]": "_hideMobileSubmenus",
// Opening any dropdown in the navbar should hide the hamburger // Opening any dropdown in the navbar should hide the hamburger
"show.bs.dropdown .o_menu_systray, .o_menu_apps": "show.bs.dropdown .o_menu_systray, .o_menu_apps": "_hideMobileSubmenus",
"_hideMobileSubmenus",
// Prevent close section menu // Prevent close section menu
"hide.bs.dropdown .o_menu_sections": "_hideMenuSection", "hide.bs.dropdown .o_menu_sections": "_hideMenuSection",
}, Menu.prototype.events), },
Menu.prototype.events
),
start: function() { start: function() {
this.$menu_toggle = this.$(".o-menu-toggle"); this.$menu_toggle = this.$(".o-menu-toggle");
@ -378,7 +370,6 @@ odoo.define('web_responsive', function (require) {
}); });
RelationalFields.FieldStatus.include({ RelationalFields.FieldStatus.include({
/** /**
* Fold all on mobiles. * Fold all on mobiles.
* *
@ -387,7 +378,7 @@ odoo.define('web_responsive', function (require) {
_setState: function() { _setState: function() {
this._super.apply(this, arguments); this._super.apply(this, arguments);
if (config.device.isMobile) { if (config.device.isMobile) {
_.map(this.status_information, (value) => { _.map(this.status_information, value => {
value.fold = true; value.fold = true;
}); });
} }
@ -400,9 +391,10 @@ odoo.define('web_responsive', function (require) {
const self = this; const self = this;
return this._super.apply(this, arguments).then(() => { return this._super.apply(this, arguments).then(() => {
const $col_selector = self.$el.find( const $col_selector = self.$el.find(
'.o_optional_columns_dropdown_toggle'); ".o_optional_columns_dropdown_toggle"
);
if ($col_selector.length !== 0) { if ($col_selector.length !== 0) {
const $th = self.$el.find('thead>tr:first>th:last'); const $th = self.$el.find("thead>tr:first>th:last");
$col_selector.appendTo($th); $col_selector.appendTo($th);
} }
}); });
@ -421,7 +413,6 @@ odoo.define('web_responsive', function (require) {
// Responsive view "action" buttons // Responsive view "action" buttons
FormRenderer.include({ FormRenderer.include({
/** /**
* In mobiles, put all statusbar buttons in a dropdown. * In mobiles, put all statusbar buttons in a dropdown.
* *
@ -438,9 +429,9 @@ odoo.define('web_responsive', function (require) {
// $buttons must be appended by JS because all events are bound // $buttons must be appended by JS because all events are bound
$buttons.addClass("dropdown-menu"); $buttons.addClass("dropdown-menu");
const $dropdown = $(core.qweb.render( const $dropdown = $(
'web_responsive.MenuStatusbarButtons' core.qweb.render("web_responsive.MenuStatusbarButtons")
)); );
$buttons.addClass("dropdown-menu").appendTo($dropdown); $buttons.addClass("dropdown-menu").appendTo($dropdown);
return $dropdown; return $dropdown;
}, },
@ -449,9 +440,11 @@ odoo.define('web_responsive', function (require) {
// Chatter Hide Composer // Chatter Hide Composer
Chatter.include({ Chatter.include({
_openComposer: function(options) { _openComposer: function(options) {
if (this._composer && if (
this._composer &&
options.isLog === this._composer.options.isLog && options.isLog === this._composer.options.isLog &&
this._composer.$el.is(':visible')) { this._composer.$el.is(":visible")
) {
this._closeComposer(false); this._closeComposer(false);
} else { } else {
this._super.apply(this, arguments); this._super.apply(this, arguments);
@ -461,7 +454,6 @@ odoo.define('web_responsive', function (require) {
// Hide AppDrawer or Menu when the action has been completed // Hide AppDrawer or Menu when the action has been completed
ActionManager.include({ ActionManager.include({
/** /**
* Because the menu aren't closed when click, this method * Because the menu aren't closed when click, this method
* searchs for the menu with the action executed to close it. * searchs for the menu with the action executed to close it.
@ -472,26 +464,33 @@ odoo.define('web_responsive', function (require) {
* The executed action * The executed action
*/ */
_hideMenusByAction: function(action) { _hideMenusByAction: function(action) {
const uniq_sel = '[data-action-id='+action.id+']'; const uniq_sel = "[data-action-id=" + action.id + "]";
// Need close AppDrawer? // Need close AppDrawer?
const menu_apps_dropdown = document.querySelector( const menu_apps_dropdown = document.querySelector(".o_menu_apps .dropdown");
'.o_menu_apps .dropdown'); $(menu_apps_dropdown)
$(menu_apps_dropdown).has('.dropdown-menu.show') .has(".dropdown-menu.show")
.has(uniq_sel).find('> a').dropdown('toggle'); .has(uniq_sel)
.find("> a")
.dropdown("toggle");
// Need close Sections Menu? // Need close Sections Menu?
const menu_sections = document.querySelector( const menu_sections = document.querySelector(".o_menu_sections li.show");
'.o_menu_sections li.show'); $(menu_sections)
$(menu_sections).has(uniq_sel).find('.dropdown-toggle') .has(uniq_sel)
.dropdown('toggle'); .find(".dropdown-toggle")
.dropdown("toggle");
// Need close Mobile? // Need close Mobile?
const menu_sections_mobile = document.querySelector( const menu_sections_mobile = document.querySelector(
'.o_menu_sections.show'); ".o_menu_sections.show"
$(menu_sections_mobile).has(uniq_sel).hide(); );
$(menu_sections_mobile)
.has(uniq_sel)
.hide();
}, },
_handleAction: function(action) { _handleAction: function(action) {
return this._super.apply(this, arguments).finally( return this._super
$.proxy(this, '_hideMenusByAction', action)); .apply(this, arguments)
.finally($.proxy(this, "_hideMenusByAction", action));
}, },
}); });
@ -508,7 +507,6 @@ odoo.define('web_responsive', function (require) {
* enable this behavior. * enable this behavior.
*/ */
var KeyboardNavigationShiftAltMixin = { var KeyboardNavigationShiftAltMixin = {
/** /**
* Alter the key event to require pressing Shift. * Alter the key event to require pressing Shift.
* *
@ -559,24 +557,24 @@ odoo.define('web_responsive', function (require) {
// this.$el is active, but now the modal have buttons that can obtain // this.$el is active, but now the modal have buttons that can obtain
// the focus. For this reason we now listen core events, that are // the focus. For this reason we now listen core events, that are
// dispatched every time. // dispatched every time.
events: _.extend(_.omit(DocumentViewer.prototype.events, [ events: _.extend(
'keydown', _.omit(DocumentViewer.prototype.events, ["keydown", "keyup"]),
'keyup', {
]), { "click .o_maximize_btn": "_onClickMaximize",
'click .o_maximize_btn': '_onClickMaximize', "click .o_minimize_btn": "_onClickMinimize",
'click .o_minimize_btn': '_onClickMinimize', "shown.bs.modal": "_onShownModal",
'shown.bs.modal': '_onShownModal', }
}), ),
start: function() { start: function() {
core.bus.on('keydown', this, this._onKeydown); core.bus.on("keydown", this, this._onKeydown);
core.bus.on('keyup', this, this._onKeyUp); core.bus.on("keyup", this, this._onKeyUp);
return this._super.apply(this, arguments); return this._super.apply(this, arguments);
}, },
destroy: function() { destroy: function() {
core.bus.off('keydown', this, this._onKeydown); core.bus.off("keydown", this, this._onKeydown);
core.bus.off('keyup', this, this._onKeyUp); core.bus.off("keyup", this, this._onKeyUp);
this._super.apply(this, arguments); this._super.apply(this, arguments);
}, },
@ -584,13 +582,13 @@ odoo.define('web_responsive', function (require) {
// Disable auto-focus to allow to use controls in edit mode. // Disable auto-focus to allow to use controls in edit mode.
// This only affects the active modal. // This only affects the active modal.
// More info: https://stackoverflow.com/a/14795256 // More info: https://stackoverflow.com/a/14795256
$(document).off('focusin.modal'); $(document).off("focusin.modal");
}, },
_onClickMaximize: function() { _onClickMaximize: function() {
this.$el.removeClass('o_responsive_document_viewer'); this.$el.removeClass("o_responsive_document_viewer");
}, },
_onClickMinimize: function() { _onClickMinimize: function() {
this.$el.addClass('o_responsive_document_viewer'); this.$el.addClass("o_responsive_document_viewer");
}, },
}); });
}); });

View File

@ -1,12 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!-- Copyright 2018 Tecnativa - Jairo Llopis <!-- Copyright 2018 Tecnativa - Jairo Llopis
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). --> License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). -->
<template> <template>
<t t-extend="AppsMenu"> <t t-extend="AppsMenu">
<!-- App icons must be clickable --> <!-- App icons must be clickable -->
<t t-jquery=".o_app" t-operation="attributes"> <t t-jquery=".o_app" t-operation="attributes">
<attribute name="t-attf-href">#menu_id=#{app.menuID}&amp;action_id=#{app.actionID}</attribute> <attribute
name="t-attf-href"
>#menu_id=#{app.menuID}&amp;action_id=#{app.actionID}</attribute>
</t> </t>
<!-- App icons should be more than a text --> <!-- App icons should be more than a text -->
@ -29,10 +30,12 @@
<i class="fa fa-search" /> <i class="fa fa-search" />
</div> </div>
</div> </div>
<input type="search" <input
type="search"
autocomplete="off" autocomplete="off"
placeholder="Search menus..." placeholder="Search menus..."
class="form-control"/> class="form-control"
/>
</div> </div>
</div> </div>
<div class="search-results col-md-10 ml-auto mr-auto" /> <div class="search-results col-md-10 ml-auto mr-auto" />
@ -42,8 +45,10 @@
<!-- Separate app icon template, for easier inheritance --> <!-- Separate app icon template, for easier inheritance -->
<t t-name="web_responsive.AppIcon"> <t t-name="web_responsive.AppIcon">
<img class="o-app-icon" <img
t-attf-src="data:image/png;base64,#{app.web_icon_data}"/> class="o-app-icon"
t-attf-src="data:image/png;base64,#{app.web_icon_data}"
/>
<span class="o-app-name"> <span class="o-app-name">
<t t-esc="app.name" /> <t t-esc="app.name" />
</span> </span>
@ -53,13 +58,15 @@
<t t-name="web_responsive.MenuSearchResults"> <t t-name="web_responsive.MenuSearchResults">
<t t-foreach="results" t-as="result"> <t t-foreach="results" t-as="result">
<t t-set="menu" t-value="widget._menuInfo(result.original)" /> <t t-set="menu" t-value="widget._menuInfo(result.original)" />
<a t-attf-class="o-menu-search-result dropdown-item col-12 ml-auto mr-auto #{result_first ? 'active' : ''}" <a
t-attf-class="o-menu-search-result dropdown-item col-12 ml-auto mr-auto #{result_first ? 'active' : ''}"
t-attf-style="background-image:url('data:image/png;base64,#{menu.web_icon_data}')" t-attf-style="background-image:url('data:image/png;base64,#{menu.web_icon_data}')"
t-attf-href="#menu_id=#{menu.id}&amp;action_id=#{menu.action_id}" t-attf-href="#menu_id=#{menu.id}&amp;action_id=#{menu.action_id}"
t-att-data-menu-id="menu.id" t-att-data-menu-id="menu.id"
t-att-data-action-id="menu.action_id" t-att-data-action-id="menu.action_id"
t-att-data-parent-id="menu.parent_id[0]" t-att-data-parent-id="menu.parent_id[0]"
t-raw="result.string"/> t-raw="result.string"
/>
</t> </t>
</t> </t>
</template> </template>

View File

@ -1,11 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!-- Copyright 2019 Tecnativa - Alexandre Díaz <!-- Copyright 2019 Tecnativa - Alexandre Díaz
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). --> License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). -->
<template> <template>
<t t-extend="DocumentViewer"> <t t-extend="DocumentViewer">
<t t-jquery=".o_modal_fullscreen" t-operation="attributes"> <t t-jquery=".o_modal_fullscreen" t-operation="attributes">
<attribute name="class">modal o_modal_fullscreen o_document_viewer o_responsive_document_viewer</attribute> <attribute
name="class"
>modal o_modal_fullscreen o_document_viewer o_responsive_document_viewer</attribute>
<attribute name="data-backdrop">false</attribute> <attribute name="data-backdrop">false</attribute>
</t> </t>
</t> </t>
@ -13,9 +14,27 @@
<t t-extend="DocumentViewer.Content"> <t t-extend="DocumentViewer.Content">
<t t-jquery=".o_close_btn" t-operation="replace"> <t t-jquery=".o_close_btn" t-operation="replace">
<div class="o_buttons float-right mr8"> <div class="o_buttons float-right mr8">
<a role="button" class="mr8 o_maximize_btn" tabindex="0" aria-label="Maximize" title="Maximize"><i class="fa fa-window-maximize"></i></a> <a
<a role="button" class="mr8 o_minimize_btn" tabindex="0" aria-label="Minimize" title="Minimize"><i class="fa fa-window-minimize"></i></a> role="button"
<a role="button" class="o_close_btn" tabindex="0" aria-label="Close" title="Close"><i class="fa fa-close"></i></a> class="mr8 o_maximize_btn"
tabindex="0"
aria-label="Maximize"
title="Maximize"
><i class="fa fa-window-maximize" /></a>
<a
role="button"
class="mr8 o_minimize_btn"
tabindex="0"
aria-label="Minimize"
title="Minimize"
><i class="fa fa-window-minimize" /></a>
<a
role="button"
class="o_close_btn"
tabindex="0"
aria-label="Close"
title="Close"
><i class="fa fa-close" /></a>
</div> </div>
</t> </t>
</t> </t>

View File

@ -5,23 +5,23 @@
Copyright 2018 Tecnativa - Jairo Llopis Copyright 2018 Tecnativa - Jairo Llopis
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
--> -->
<templates id="form_view" xml:space="preserve"> <templates id="form_view" xml:space="preserve">
<!-- Template for buttons that display only the icon in xs --> <!-- Template for buttons that display only the icon in xs -->
<t t-name="web_responsive.icon_button"> <t t-name="web_responsive.icon_button">
<i t-attf-class="fa fa-#{icon}" <i t-attf-class="fa fa-#{icon}" t-att-title="label" />
t-att-title="label"/>
<span class="d-none d-sm-inline" t-esc="label" /> <span class="d-none d-sm-inline" t-esc="label" />
</t> </t>
<t t-name="web_responsive.MenuStatusbarButtons"> <t t-name="web_responsive.MenuStatusbarButtons">
<div class="dropdown"> <div class="dropdown">
<button class="o_statusbar_buttons_dropdown btn btn-secondary dropdown-toggle" <button
class="o_statusbar_buttons_dropdown btn btn-secondary dropdown-toggle"
type="button" type="button"
data-toggle="dropdown" data-toggle="dropdown"
aria-haspopup="true" aria-haspopup="true"
aria-expanded="false"> aria-expanded="false"
>
<t t-call="web_responsive.icon_button"> <t t-call="web_responsive.icon_button">
<t t-set="icon" t-value="'cogs'" /> <t t-set="icon" t-value="'cogs'" />
<t t-set="label">Quick actions</t> <t t-set="label">Quick actions</t>
@ -114,8 +114,10 @@
<t t-extend="Sidebar"> <t t-extend="Sidebar">
<!-- Replace some common sections by icons in mobile --> <!-- Replace some common sections by icons in mobile -->
<t t-jquery=".o_dropdown_toggler_btn t[t-esc='section.label']" <t
t-operation="replace"> t-jquery=".o_dropdown_toggler_btn t[t-esc='section.label']"
t-operation="replace"
>
<t t-set="label" t-value="section.label" /> <t t-set="label" t-value="section.label" />
<t t-if="section.name == 'files'"> <t t-if="section.name == 'files'">
<t t-call="web_responsive.icon_button"> <t t-call="web_responsive.icon_button">

View File

@ -1,14 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!-- Copyright 2017-2018 Tecnativa - Jairo Llopis <!-- Copyright 2017-2018 Tecnativa - Jairo Llopis
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). --> License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). -->
<template> <template>
<t t-extend="Menu"> <t t-extend="Menu">
<t t-jquery=".o_menu_apps" t-operation="after"> <t t-jquery=".o_menu_apps" t-operation="after">
<!-- Hamburger button to show submenus in sm screens --> <!-- Hamburger button to show submenus in sm screens -->
<button class="o-menu-toggle d-md-none" <button
class="o-menu-toggle d-md-none"
data-toggle="collapse" data-toggle="collapse"
data-target=".o_main_navbar .o_menu_sections"> data-target=".o_main_navbar .o_menu_sections"
>
<i class="fa fa-bars" /> <i class="fa fa-bars" />
</button> </button>
</t> </t>

View File

@ -1,18 +1,22 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<!-- <!--
Copyright 2016 LasLabs Inc. Copyright 2016 LasLabs Inc.
@author Dave Lasley <dave@laslabs.com> @author Dave Lasley <dave@laslabs.com>
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
--> -->
<odoo> <odoo>
<template id="assets_backend" name="Open Mobile Assets" inherit_id="web.assets_backend"> <template
id="assets_backend"
name="Open Mobile Assets"
inherit_id="web.assets_backend"
>
<xpath expr="."> <xpath expr=".">
<link rel="stylesheet" <link
rel="stylesheet"
href="/web_responsive/static/src/css/web_responsive.scss" href="/web_responsive/static/src/css/web_responsive.scss"
/> />
<script type="application/javascript" <script
type="application/javascript"
src="/web_responsive/static/src/js/web_responsive.js" src="/web_responsive/static/src/js/web_responsive.js"
/> />
</xpath> </xpath>

View File

@ -1,11 +1,9 @@
<?xml version="1.0" ?> <?xml version="1.0" ?>
<!-- <!--
Copyright 2018 Copyright 2018
@author Alexanre Díaz <dev@redneboa.es> @author Alexanre Díaz <dev@redneboa.es>
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
--> -->
<odoo> <odoo>
<record id="view_users_form_simple_modif" model="ir.ui.view"> <record id="view_users_form_simple_modif" model="ir.ui.view">

View File

@ -1,18 +1,21 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<!-- <!--
Copyright 2018 Alexandre Díaz Copyright 2018 Alexandre Díaz
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
--> -->
<odoo> <odoo>
<template id="webclient_bootstrap" <template
id="webclient_bootstrap"
inherit_id="web.webclient_bootstrap" inherit_id="web.webclient_bootstrap"
name="App Drawer - Web Client" name="App Drawer - Web Client"
> >
<xpath expr="//t[@t-set='body_classname']" position="attributes"> <xpath expr="//t[@t-set='body_classname']" position="attributes">
<attribute name="t-value" add="+ ' o_chatter_position_' + (request.env.user.chatter_position or 'normal')" separator=" " /> <attribute
name="t-value"
add="+ ' o_chatter_position_' + (request.env.user.chatter_position or 'normal')"
separator=" "
/>
</xpath> </xpath>
</template> </template>

View File

@ -6,20 +6,23 @@
* Copyright 2019 Alexandre Díaz <alexandre.diaz@tecnativa.com> * Copyright 2019 Alexandre Díaz <alexandre.diaz@tecnativa.com>
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */ * License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */
odoo.define('web_tree_many2one_clickable.many2one_clickable', function (require) { odoo.define("web_tree_many2one_clickable.many2one_clickable", function(require) {
'use strict'; "use strict";
var ListRenderer = require('web.ListRenderer'); var ListRenderer = require("web.ListRenderer");
var ListFieldMany2One = require('web.relational_fields').ListFieldMany2One; var ListFieldMany2One = require("web.relational_fields").ListFieldMany2One;
ListRenderer.include({ ListRenderer.include({
_renderBodyCell: function(record, node, colIndex, options) { _renderBodyCell: function(record, node, colIndex, options) {
if (!node.attrs.widget && node.attrs.name && if (
!node.attrs.widget &&
node.attrs.name &&
this.state.fields[node.attrs.name] && this.state.fields[node.attrs.name] &&
this.state.fields[node.attrs.name].type === 'many2one') { this.state.fields[node.attrs.name].type === "many2one"
) {
// No explicit widget provided on a many2one field, // No explicit widget provided on a many2one field,
// force `many2one` widget // force `many2one` widget
node.attrs.widget = 'many2one'; node.attrs.widget = "many2one";
} }
return this._super(record, node, colIndex, options); return this._super(record, node, colIndex, options);
}, },
@ -32,28 +35,29 @@ odoo.define('web_tree_many2one_clickable.many2one_clickable', function (require)
if (!this.noOpen && this.value) { if (!this.noOpen && this.value) {
// Replace '<a>' element // Replace '<a>' element
this.$el.removeClass('o_form_uri'); this.$el.removeClass("o_form_uri");
this.$el = $('<span/>', { this.$el = $("<span/>", {
html: this.$el.html(), html: this.$el.html(),
class: this.$el.attr('class') + ' o_field_text', class: this.$el.attr("class") + " o_field_text",
name: this.$el.attr('name'), name: this.$el.attr("name"),
}); });
// Append button // Append button
var $a = $('<a/>', { var $a = $("<a/>", {
href: '#', href: "#",
class: 'o_form_uri btn btn-sm btn-secondary' + class:
' fa fa-angle-double-right', "o_form_uri btn btn-sm btn-secondary" +
}).on('click', function (ev) { " fa fa-angle-double-right",
}).on("click", function(ev) {
ev.preventDefault(); ev.preventDefault();
ev.stopPropagation(); ev.stopPropagation();
self.do_action({ self.do_action({
type: 'ir.actions.act_window', type: "ir.actions.act_window",
res_model: self.field.relation, res_model: self.field.relation,
res_id: self.value.res_id, res_id: self.value.res_id,
views: [[false, 'form']], views: [[false, "form"]],
target: 'target', target: "target",
}); });
}); });
this.$el.append($a); this.$el.append($a);

View File

@ -4,13 +4,20 @@
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo> <odoo>
<template id="assets_backend" name="web_tree_many2one_clickable assets" <template
inherit_id="web.assets_backend"> id="assets_backend"
name="web_tree_many2one_clickable assets"
inherit_id="web.assets_backend"
>
<xpath expr="." position="inside"> <xpath expr="." position="inside">
<link rel="stylesheet" <link
href="/web_tree_many2one_clickable/static/src/css/web_tree_many2one_clickable.scss" /> rel="stylesheet"
<script type="text/javascript" href="/web_tree_many2one_clickable/static/src/css/web_tree_many2one_clickable.scss"
src="/web_tree_many2one_clickable/static/src/js/web_tree_many2one_clickable.js"/> />
<script
type="text/javascript"
src="/web_tree_many2one_clickable/static/src/js/web_tree_many2one_clickable.js"
/>
</xpath> </xpath>
</template> </template>

View File

@ -1,17 +1,17 @@
odoo.define('web_widget_bokeh_chart', function (require) { odoo.define("web_widget_bokeh_chart", function(require) {
"use strict"; "use strict";
var fieldRegistry = require('web.field_registry'); var fieldRegistry = require("web.field_registry");
var AbstractField = require('web.AbstractField'); var AbstractField = require("web.AbstractField");
var BokehChartWidget = AbstractField.extend({ var BokehChartWidget = AbstractField.extend({
_renderReadonly: function() { _renderReadonly: function() {
var val = this.value; var val = this.value;
this.$el.html(val); this.$el.html(val);
} },
}); });
fieldRegistry.add('bokeh_chart', BokehChartWidget); fieldRegistry.add("bokeh_chart", BokehChartWidget);
return { return {
BokehChartWidget: BokehChartWidget BokehChartWidget: BokehChartWidget,
}; };
}); });

View File

@ -6,15 +6,12 @@
/* Overriding this styling option Odoo menu is now displayed on top of bokeh graphs */ /* Overriding this styling option Odoo menu is now displayed on top of bokeh graphs */
z-index: 0; z-index: 0;
height: inherit !important; height: inherit !important;
} }
.bk-root > .bk { .bk-root > .bk {
height: inherit !important; height: inherit !important;
} }
.bk-root > .bk > .bk { .bk-root > .bk > .bk {
height: inherit !important; height: inherit !important;
} }
.bk-root > .bk > .bk > .bk-canvas { .bk-root > .bk > .bk > .bk-canvas {
height: inherit !important; height: inherit !important;

View File

@ -1,16 +1,43 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<odoo> <odoo>
<template id="assets_backend" name="web_widget_bokeh_chart assets" <template
inherit_id="web.assets_backend"> id="assets_backend"
name="web_widget_bokeh_chart assets"
inherit_id="web.assets_backend"
>
<xpath expr="." position="inside"> <xpath expr="." position="inside">
<link rel="stylesheet" type="text/css" href="/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-1.1.0.css"/> <link
<link rel="stylesheet" type="text/css" href="/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-widgets-1.1.0.css"/> rel="stylesheet"
<link rel="stylesheet" type="text/scss" href="/web_widget_bokeh_chart/static/src/scss/custom-bokeh.scss"/> type="text/css"
<script type="text/javascript" src="/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-1.1.0.js"/> href="/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-1.1.0.css"
<script type="text/javascript" src="/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-widgets-1.1.0.js"/> />
<script type="text/javascript" src="/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-api-1.1.0.js"/> <link
<script type="text/javascript" src="/web_widget_bokeh_chart/static/src/js/web_widget_bokeh_chart.js"/> rel="stylesheet"
type="text/css"
href="/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-widgets-1.1.0.css"
/>
<link
rel="stylesheet"
type="text/scss"
href="/web_widget_bokeh_chart/static/src/scss/custom-bokeh.scss"
/>
<script
type="text/javascript"
src="/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-1.1.0.js"
/>
<script
type="text/javascript"
src="/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-widgets-1.1.0.js"
/>
<script
type="text/javascript"
src="/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-api-1.1.0.js"
/>
<script
type="text/javascript"
src="/web_widget_bokeh_chart/static/src/js/web_widget_bokeh_chart.js"
/>
</xpath> </xpath>
</template> </template>