forked from Techsystech/web
[IMP] web_chatter_position: black, isort, prettier
parent
b7e65be2f8
commit
a71ba65d19
|
@ -0,0 +1 @@
|
||||||
|
../../../../web_chatter_position
|
|
@ -0,0 +1,6 @@
|
||||||
|
import setuptools
|
||||||
|
|
||||||
|
setuptools.setup(
|
||||||
|
setup_requires=['setuptools-odoo'],
|
||||||
|
odoo_addon=True,
|
||||||
|
)
|
|
@ -18,9 +18,7 @@
|
||||||
"/web_chatter_position/static/src/scss/attachment_viewer.scss",
|
"/web_chatter_position/static/src/scss/attachment_viewer.scss",
|
||||||
"/web_chatter_position/static/src/js/form_chatter_position.js",
|
"/web_chatter_position/static/src/js/form_chatter_position.js",
|
||||||
],
|
],
|
||||||
"web.assets_qweb": [
|
"web.assets_qweb": ["/web_chatter_position/static/src/xml/form_buttons.xml"],
|
||||||
"/web_chatter_position/static/src/xml/form_buttons.xml",
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
"installable": True,
|
"installable": True,
|
||||||
"auto_install": False,
|
"auto_install": False,
|
||||||
|
|
|
@ -8,8 +8,7 @@ class ResUsers(models.Model):
|
||||||
_inherit = "res.users"
|
_inherit = "res.users"
|
||||||
|
|
||||||
chatter_position = fields.Selection(
|
chatter_position = fields.Selection(
|
||||||
[("bottom", "Bottom"), ("sided", "Sided")],
|
[("bottom", "Bottom"), ("sided", "Sided")], default="sided",
|
||||||
default="sided",
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Override so that the user can change the chatter_position field
|
# Override so that the user can change the chatter_position field
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright 2022 Hynsys Technologies
|
// Copyright 2022 Hynsys Technologies
|
||||||
// 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_chatter_position.ChatterPositionFormController", function (require) {
|
odoo.define("web_chatter_position.ChatterPositionFormController", function(require) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var config = require("web.config");
|
var config = require("web.config");
|
||||||
|
@ -9,7 +9,7 @@ odoo.define("web_chatter_position.ChatterPositionFormController", function (requ
|
||||||
var FormRenderer = require("web.FormRenderer");
|
var FormRenderer = require("web.FormRenderer");
|
||||||
|
|
||||||
var ChatterPositionFormController = FormController.include({
|
var ChatterPositionFormController = FormController.include({
|
||||||
renderButtons: function () {
|
renderButtons: function() {
|
||||||
this._super.apply(this, arguments);
|
this._super.apply(this, arguments);
|
||||||
if (this.$buttons) {
|
if (this.$buttons) {
|
||||||
this.$buttons.on(
|
this.$buttons.on(
|
||||||
|
@ -20,7 +20,7 @@ odoo.define("web_chatter_position.ChatterPositionFormController", function (requ
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_onChatterPosition: function () {
|
_onChatterPosition: function() {
|
||||||
if (this.$el.offsetParent().hasClass("o_chatter_position_bottom")) {
|
if (this.$el.offsetParent().hasClass("o_chatter_position_bottom")) {
|
||||||
this.$el
|
this.$el
|
||||||
.offsetParent()
|
.offsetParent()
|
||||||
|
@ -34,7 +34,7 @@ odoo.define("web_chatter_position.ChatterPositionFormController", function (requ
|
||||||
});
|
});
|
||||||
|
|
||||||
FormRenderer.include({
|
FormRenderer.include({
|
||||||
_applyFormSizeClass: function () {
|
_applyFormSizeClass: function() {
|
||||||
const formEl = this.$el[0];
|
const formEl = this.$el[0];
|
||||||
if (config.device.size_class <= config.device.SIZES.XS) {
|
if (config.device.size_class <= config.device.SIZES.XS) {
|
||||||
formEl.classList.add("o_xxs_form_view");
|
formEl.classList.add("o_xxs_form_view");
|
||||||
|
|
Loading…
Reference in New Issue