mirror of https://github.com/OCA/web.git
[MIG] web_chatter_position: Migration to 13.0
parent
a71ba65d19
commit
8c067155ae
|
@ -4,22 +4,15 @@
|
||||||
{
|
{
|
||||||
"name": "Chatter Position",
|
"name": "Chatter Position",
|
||||||
"summary": "Add an option to change the chatter position",
|
"summary": "Add an option to change the chatter position",
|
||||||
"version": "15.0.1.0.0",
|
"version": "13.0.1.0.0",
|
||||||
"author": "Hynsys Technologies, Camptocamp, Odoo Community Association (OCA)",
|
"author": "Hynsys Technologies, Camptocamp, Odoo Community Association (OCA)",
|
||||||
"website": "https://github.com/OCA/web",
|
"website": "https://github.com/OCA/web",
|
||||||
"license": "LGPL-3",
|
"license": "LGPL-3",
|
||||||
"category": "Extra Tools",
|
"category": "Extra Tools",
|
||||||
"images": ["static/description/images/web_chatter_position.png"],
|
"images": ["static/description/images/web_chatter_position.png"],
|
||||||
"depends": ["web", "mail"],
|
"depends": ["web", "mail"],
|
||||||
"data": ["views/res_users.xml", "views/web.xml"],
|
"data": ["views/res_users.xml", "views/web.xml", "views/assets.xml"],
|
||||||
"assets": {
|
"qweb": ["static/src/xml/form_buttons.xml"],
|
||||||
"web.assets_backend": [
|
|
||||||
"/web_chatter_position/static/src/scss/chatter_position.scss",
|
|
||||||
"/web_chatter_position/static/src/scss/attachment_viewer.scss",
|
|
||||||
"/web_chatter_position/static/src/js/form_chatter_position.js",
|
|
||||||
],
|
|
||||||
"web.assets_qweb": ["/web_chatter_position/static/src/xml/form_buttons.xml"],
|
|
||||||
},
|
|
||||||
"installable": True,
|
"installable": True,
|
||||||
"auto_install": False,
|
"auto_install": False,
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,15 +8,20 @@ class ResUsers(models.Model):
|
||||||
_inherit = "res.users"
|
_inherit = "res.users"
|
||||||
|
|
||||||
chatter_position = fields.Selection(
|
chatter_position = fields.Selection(
|
||||||
[("bottom", "Bottom"), ("sided", "Sided")], default="sided",
|
[("bottom", "Bottom"), ("sided", "Sided")],
|
||||||
|
default="sided",
|
||||||
|
string="Chatter Position",
|
||||||
)
|
)
|
||||||
|
|
||||||
# Override so that the user can change the chatter_position field
|
def __init__(self, pool, cr):
|
||||||
|
""" Override of __init__ to add access rights.
|
||||||
@property
|
Access rights are disabled by default, but allowed on some specific
|
||||||
def SELF_READABLE_FIELDS(self):
|
fields defined in self.SELF_{READ/WRITE}ABLE_FIELDS.
|
||||||
return super().SELF_READABLE_FIELDS + ["chatter_position"]
|
"""
|
||||||
|
super(ResUsers, self).__init__(pool, cr)
|
||||||
@property
|
# duplicate list to avoid modifying the original reference
|
||||||
def SELF_WRITEABLE_FIELDS(self):
|
type(self).SELF_WRITEABLE_FIELDS = list(self.SELF_WRITEABLE_FIELDS)
|
||||||
return super().SELF_WRITEABLE_FIELDS + ["chatter_position"]
|
type(self).SELF_WRITEABLE_FIELDS.extend(["chatter_position"])
|
||||||
|
# duplicate list to avoid modifying the original reference
|
||||||
|
type(self).SELF_READABLE_FIELDS = list(self.SELF_READABLE_FIELDS)
|
||||||
|
type(self).SELF_READABLE_FIELDS.extend(["chatter_position"])
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
$chatter_zone_width: 35%;
|
$chatter_zone_width: 35%;
|
||||||
|
$o-form-view-sheet-max-width: 1140px !default;
|
||||||
// Size of labels
|
// Size of labels
|
||||||
.o_web_client {
|
.o_web_client {
|
||||||
&.o_chatter_position_sided {
|
&.o_chatter_position_sided {
|
||||||
|
@ -262,9 +262,26 @@ $chatter_zone_width: 35%;
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.o_chatter_position_bottom & {
|
||||||
|
.o_form_view {
|
||||||
|
flex-flow: column;
|
||||||
|
height: auto;
|
||||||
|
.o_form_sheet_bg {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.oe_chatter {
|
||||||
|
width: 100%;
|
||||||
|
padding: 16px 16px 48px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
// Sided chatter, if user wants
|
// Sided chatter, if user wants
|
||||||
.o_chatter_position_sided & {
|
.o_chatter_position_sided & {
|
||||||
|
.o_chatter {
|
||||||
|
flex: 0 0 35%;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
@include media-breakpoint-up(lg) {
|
@include media-breakpoint-up(lg) {
|
||||||
.o_form_view:not(.o_form_nosheet) {
|
.o_form_view:not(.o_form_nosheet) {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<odoo>
|
||||||
|
<template
|
||||||
|
id="assets_backend"
|
||||||
|
name="Open Mobile Assets"
|
||||||
|
inherit_id="web.assets_backend"
|
||||||
|
>
|
||||||
|
<xpath expr=".">
|
||||||
|
<link
|
||||||
|
type="text/css"
|
||||||
|
rel="stylesheet"
|
||||||
|
href="/web_chatter_position/static/src/scss/chatter_position.scss"
|
||||||
|
/>
|
||||||
|
<link
|
||||||
|
type="text/css"
|
||||||
|
rel="stylesheet"
|
||||||
|
href="/web_chatter_position/static/src/scss/attachment_viewer.scss"
|
||||||
|
/>
|
||||||
|
<script
|
||||||
|
type="application/javascript"
|
||||||
|
src="/web_chatter_position/static/src/js/form_chatter_position.js"
|
||||||
|
/>
|
||||||
|
</xpath>
|
||||||
|
</template>
|
||||||
|
</odoo>
|
|
@ -9,12 +9,4 @@
|
||||||
/>
|
/>
|
||||||
</xpath>
|
</xpath>
|
||||||
</template>
|
</template>
|
||||||
<template id="view_web_layout" inherit_id="web.layout" name="View Layout">
|
|
||||||
<xpath expr="//meta[last()]" position="after">
|
|
||||||
<meta
|
|
||||||
name="viewport"
|
|
||||||
content="width=device-width, initial-scale=1, user-scalable=no"
|
|
||||||
/>
|
|
||||||
</xpath>
|
|
||||||
</template>
|
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|
Loading…
Reference in New Issue