Merge PR #1976 into 14.0

Signed-off-by hbrunn
This commit is contained in:
OCA-git-bot
2022-08-30 07:02:12 +00:00
36 changed files with 1430 additions and 54 deletions

View File

@@ -0,0 +1 @@
../../../../support_branding

View File

@@ -0,0 +1,6 @@
import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)

View File

@@ -0,0 +1,80 @@
================
Support Branding
================
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github
:target: https://github.com/OCA/web/tree/14.0/support_branding
:alt: OCA/web
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/web-14-0/web-14-0-support_branding
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/162/14.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
If you run an Odoo support company and you support customers without an OPW,
you can brand the Odoo instance accordingly using this module. This module will
add a support company url to profile menu under, `Support`. Moreover,
it will add a button to mail exception messages to your support email address.
**Table of contents**
.. contents::
:local:
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/web/issues/new?body=module:%20support_branding%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
Credits
=======
Authors
~~~~~~~
* Therp BV
* Sunflower IT
Contributors
~~~~~~~~~~~~
* Holger Brunn <hbrunn@therp.nl>
* Stefan Rijnhart <srijnhart@therp.nl>
* Robert Rottermann <robert@redo2oo.ch>
* Kevin Kamau <kevin@sunflowerweb.nl>
Maintainers
~~~~~~~~~~~
This module is maintained by the OCA.
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
This module is part of the `OCA/web <https://github.com/OCA/web/tree/14.0/support_branding>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@@ -0,0 +1,7 @@
# Copyright 2012-2015 Therp BV (<http://therp.nl>)
# Copyright 2016 - Tecnativa - Angel Moya <odoo@tecnativa.com>
# Copyright 2017 - redO2oo - Robert Rottermann <robert@redO2oo.ch>
# Copyright 2021 Sunflower IT
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import models

View File

@@ -0,0 +1,24 @@
# Copyright 2012-2015 Therp BV (<http://therp.nl>)
# Copyright 2016 - Tecnativa - Angel Moya <odoo@tecnativa.com>
# Copyright 2017 - redO2oo - Robert Rottermann <robert@redO2oo.ch>
# Copyright 2021 Sunflower IT (<https://www.sunflowerweb.nl>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Support Branding",
"summary": "Adds your branding to an Odoo instance",
"category": "Hidden/Tools",
"version": "14.0.1.0.0",
"license": "AGPL-3",
"author": "Therp BV,Sunflower IT,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/web",
"depends": ["web", "base_setup"],
"qweb": [
"static/src/xml/base.xml",
],
"data": ["views/asset.xml", "views/res_config_settings.xml"],
"demo": [
"demo/ir_config_parameter_data.xml",
],
"installable": True,
}

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<data noupdate="0">
<record id="demo_config_parameter_company_name" model="ir.config_parameter">
<field name="key">support_company</field>
<field name="value">Odoo Community Association</field>
</record>
<record id="demo_config_parameter_company_url" model="ir.config_parameter">
<field name="key">support_company_url</field>
<field name="value">https://odoo-community.org</field>
</record>
<record id="demo_config_parameter_company_color" model="ir.config_parameter">
<field name="key">support_branding_color</field>
<field name="value">#fff</field>
</record>
<record id="demo_config_parameter_support_email" model="ir.config_parameter">
<field name="key">support_email</field>
<field name="value">oca@example.com</field>
</record>
<record id="demo_config_parameter_release" model="ir.config_parameter">
<field name="key">support_release</field>
<field name="value">14.0</field>
</record>
</data>
</odoo>

View File

@@ -0,0 +1,49 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * support_branding
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-01-30 10:05+0000\n"
"PO-Revision-Date: 2015-01-30 10:05+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: support_branding
#: model:ir.ui.view,arch_db:support_branding.menu_secondary
msgid ", supported by"
msgstr ", ondersteund door"
#. module: support_branding
#. openerp-web
#: code:addons/support_branding/static/src/js/support_branding.js:88
#, python-format
msgid "Email to %s"
msgstr "E-mail naar %s"
#. module: support_branding
#. openerp-web
#: code:addons/support_branding/static/src/xml/base.xml:12
#, python-format
msgid "Email to support company"
msgstr "E-mail naar ondersteunend bedrijf"
#. module: support_branding
#. openerp-web
#: code:addons/support_branding/static/src/xml/base.xml:10
#, python-format
msgid "Please fill in how you produced this error..."
msgstr "Beschrijft u alstublieft de stappen om deze fout te reproduceren..."
#. module: support_branding
#: model:ir.ui.view,arch_db:support_branding.menu_secondary
#, fuzzy
msgid "Version"
msgstr "Versie "

View File

@@ -0,0 +1,51 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * support_branding
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-08-02 10:23+0200\n"
"PO-Revision-Date: 2015-08-02 10:24+0200\n"
"Last-Translator: Matjaz Mozetic <m.mozetic@matmoz.si>\n"
"Language-Team: \n"
"Language: sl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n"
"%100==4 ? 2 : 3);\n"
"X-Generator: Poedit 1.8.2\n"
#. module: support_branding
#: model:ir.ui.view,arch_db:support_branding.menu_secondary
msgid ", supported by"
msgstr ", podpora"
#. module: support_branding
#. openerp-web
#: code:addons/support_branding/static/src/js/support_branding.js:88
#, python-format
msgid "Email to %s"
msgstr "E-pošta za %s"
#. module: support_branding
#. openerp-web
#: code:addons/support_branding/static/src/xml/base.xml:12
#, fuzzy, python-format
msgid "Email to support company"
msgstr "E-pošta za družbo"
#. module: support_branding
#. openerp-web
#: code:addons/support_branding/static/src/xml/base.xml:10
#, python-format
msgid "Please fill in how you produced this error..."
msgstr "Opišite, kako ste prišli do te napake..."
#. module: support_branding
#: model:ir.ui.view,arch_db:support_branding.menu_secondary
#, fuzzy
msgid "Version"
msgstr "Verzija"

View File

@@ -0,0 +1,46 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * support_branding
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: support_branding
#: model:ir.ui.view,arch_db:support_branding.menu_secondary
msgid ", supported by"
msgstr ""
#. module: support_branding
#. openerp-web
#: code:addons/support_branding/static/src/js/support_branding.js:88
#, python-format
msgid "Email to %s"
msgstr ""
#. module: support_branding
#. openerp-web
#: code:addons/support_branding/static/src/xml/base.xml:12
#, python-format
msgid "Email to support company"
msgstr ""
#. module: support_branding
#. openerp-web
#: code:addons/support_branding/static/src/xml/base.xml:10
#, python-format
msgid "Please fill in how you produced this error..."
msgstr ""
#. module: support_branding
#: model:ir.ui.view,arch_db:support_branding.menu_secondary
msgid "Version"
msgstr ""

View File

@@ -0,0 +1,4 @@
# Copyright 2021 Sunflower IT
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import res_config_settings

View File

@@ -0,0 +1,39 @@
# Copyright 2021 Sunflower IT
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import fields, models
class ResConfigSettings(models.TransientModel):
_inherit = "res.config.settings"
def get_values(self):
res = super(ResConfigSettings, self).get_values()
param_obj = self.env["ir.config_parameter"].sudo()
res.update(
support_company=param_obj.get_param("support_company"),
support_company_url=param_obj.get_param("support_company_url"),
support_email=param_obj.get_param("support_email"),
support_release=param_obj.get_param("support_release"),
support_branding_color=param_obj.get_param("support_branding_color"),
)
return res
def set_values(self):
res = super(ResConfigSettings, self).set_values()
param_obj = self.env["ir.config_parameter"].sudo()
param_obj.set_param("support_company", self.support_company)
param_obj.set_param("support_company_url", self.support_company_url)
param_obj.set_param("support_email", self.support_email)
param_obj.set_param("support_release", self.support_release)
param_obj.set_param("support_branding_color", self.support_branding_color)
return res
support_company = fields.Char(string="Company Name")
support_company_url = fields.Char(string="Company URL")
support_branding_color = fields.Char(string="Branding color")
support_email = fields.Char(string="Support email")
support_release = fields.Char(string="Support release")
def test_support_branding_error(self):
return 9 / 0

View File

@@ -0,0 +1,4 @@
* Holger Brunn <hbrunn@therp.nl>
* Stefan Rijnhart <srijnhart@therp.nl>
* Robert Rottermann <robert@redo2oo.ch>
* Kevin Kamau <kevin@sunflowerweb.nl>

View File

@@ -0,0 +1,4 @@
If you run an Odoo support company and you support customers without an OPW,
you can brand the Odoo instance accordingly using this module. This module will
add a support company url to profile menu under, `Support`. Moreover,
it will add a button to mail exception messages to your support email address.

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@@ -0,0 +1,426 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
<title>Support Branding</title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
border: 0 }
table.borderless td, table.borderless th {
/* Override padding for "table.docutils td" with "! important".
The right padding separates the table cells. */
padding: 0 0.5em 0 0 ! important }
.first {
/* Override more specific margin styles with "! important". */
margin-top: 0 ! important }
.last, .with-subtitle {
margin-bottom: 0 ! important }
.hidden {
display: none }
.subscript {
vertical-align: sub;
font-size: smaller }
.superscript {
vertical-align: super;
font-size: smaller }
a.toc-backref {
text-decoration: none ;
color: black }
blockquote.epigraph {
margin: 2em 5em ; }
dl.docutils dd {
margin-bottom: 0.5em }
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
overflow: hidden;
}
/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
font-weight: bold }
*/
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error {
color: red ;
font-weight: bold ;
font-family: sans-serif }
/* Uncomment (and remove this text!) to get reduced vertical space in
compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
margin-bottom: 0.5em }
div.compound .compound-last, div.compound .compound-middle {
margin-top: 0.5em }
*/
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em ;
margin-right: 2em }
div.footer, div.header {
clear: both;
font-size: smaller }
div.line-block {
display: block ;
margin-top: 1em ;
margin-bottom: 1em }
div.line-block div.line-block {
margin-top: 0 ;
margin-bottom: 0 ;
margin-left: 1.5em }
div.sidebar {
margin: 0 0 0.5em 1em ;
border: medium outset ;
padding: 1em ;
background-color: #ffffee ;
width: 40% ;
float: right ;
clear: right }
div.sidebar p.rubric {
font-family: sans-serif ;
font-size: medium }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
margin-top: 0.4em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr.docutils {
width: 75% }
img.align-left, .figure.align-left, object.align-left, table.align-left {
clear: left ;
float: left ;
margin-right: 1em }
img.align-right, .figure.align-right, object.align-right, table.align-right {
clear: right ;
float: right ;
margin-left: 1em }
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
table.align-center {
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left }
.align-center {
clear: both ;
text-align: center }
.align-right {
text-align: right }
/* reset inner alignment in figures */
div.align-right {
text-align: inherit }
/* div.align-center * { */
/* text-align: left } */
.align-top {
vertical-align: top }
.align-middle {
vertical-align: middle }
.align-bottom {
vertical-align: bottom }
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.attribution {
text-align: right ;
margin-left: 50% }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.rubric {
font-weight: bold ;
font-size: larger ;
color: maroon ;
text-align: center }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font: inherit }
pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: grey; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.pre {
white-space: pre }
span.problematic {
color: red }
span.section-subtitle {
/* font-size relative to parent (h1..h6 element) */
font-size: 80% }
table.citation {
border-left: solid 1px gray;
margin-left: 1px }
table.docinfo {
margin: 2em 4em }
table.docutils {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.footnote {
border-left: solid 1px black;
margin-left: 1px }
table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
table.docutils th.field-name, table.docinfo th.docinfo-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap ;
padding-left: 0 }
/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
border: 0px;
border-top: 2px solid;
border-bottom: 2px solid;
border-collapse: collapse;
}
table.docutils.booktabs * {
border: 0px;
}
table.docutils.booktabs th {
border-bottom: thin solid;
text-align: left;
}
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% }
ul.auto-toc {
list-style-type: none }
</style>
</head>
<body>
<div class="document" id="support-branding">
<h1 class="title">Support Branding</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/web/tree/14.0/support_branding"><img alt="OCA/web" src="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/web-14-0/web-14-0-support_branding"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/162/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>If you run an Odoo support company and you support customers without an OPW,
you can brand the Odoo instance accordingly using this module. This module will
add a support company url to profile menu under, <cite>Support</cite>. Moreover,
it will add a button to mail exception messages to your support email address.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#bug-tracker" id="id1">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id2">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id3">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id4">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id5">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#id1">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/web/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/web/issues/new?body=module:%20support_branding%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#id2">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#id3">Authors</a></h2>
<ul class="simple">
<li>Therp BV</li>
<li>Sunflower IT</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#id4">Contributors</a></h2>
<ul class="simple">
<li>Holger Brunn &lt;<a class="reference external" href="mailto:hbrunn&#64;therp.nl">hbrunn&#64;therp.nl</a>&gt;</li>
<li>Stefan Rijnhart &lt;<a class="reference external" href="mailto:srijnhart&#64;therp.nl">srijnhart&#64;therp.nl</a>&gt;</li>
<li>Robert Rottermann &lt;<a class="reference external" href="mailto:robert&#64;redo2oo.ch">robert&#64;redo2oo.ch</a>&gt;</li>
<li>Kevin Kamau &lt;<a class="reference external" href="mailto:kevin&#64;sunflowerweb.nl">kevin&#64;sunflowerweb.nl</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#id5">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/web/tree/14.0/support_branding">OCA/web</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,20 @@
.support-branding-submit-form {
display: inline;
margin: 0;
width: 100%;
}
.support-statement {
margin: 10px 0 10px 0;
}
.support-statement .note-editor {
height: 230px;
overflow: scroll;
}
.support-desc {
resize: block;
max-height: 139px;
box-sizing: border-box;
}

View File

@@ -0,0 +1,33 @@
odoo.define("support_branding.ResConfigEdition", function (require) {
"use strict";
var ResConfigEdition = require("base_setup.ResConfigEdition");
ResConfigEdition.include({
willStart: function () {
var self = this;
var def_1 = this._rpc({
model: "ir.config_parameter",
method: "get_param",
args: ["support_company"],
}).then(function (name) {
self.support_cp_name = name;
});
var def_2 = this._rpc({
model: "ir.config_parameter",
method: "get_param",
args: ["support_company_url"],
}).then(function (url) {
self.support_cp_url = url;
});
var def_3 = this._rpc({
model: "ir.config_parameter",
method: "get_param",
args: ["support_email"],
}).then(function (email) {
self.support_cp_email = email;
});
return $.when(this._super.apply(this, arguments), def_1, def_2, def_3);
},
});
});

View File

@@ -0,0 +1,195 @@
/* Copyright 2012-2015 Therp
* Copyright 2016 - Tecnativa - Angel Moya <odoo@tecnativa.com>
* Copyright 2017 - redO2oo - Robert Rottermann <robert@redO2oo.ch>
* Copyright 2018 - Therp BV
* Copyright 2021 - Sunflower IT
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */
odoo.define("support_branding.CrashManager", function (require) {
"use strict";
var CrashManager = require("web.CrashManager").CrashManager;
var session = require("web.session");
var core = require("web.core");
var Wysiwyg = require("web_editor.wysiwyg.root");
var _t = core._t;
CrashManager.include({
init: function () {
var self = this;
$.when(this._super.apply(this, arguments)).then(function () {
self._rpc({
model: "ir.config_parameter",
method: "get_param",
args: ["support_company"],
}).then(function (name) {
self.support_cp_name = name;
});
self._rpc({
model: "ir.config_parameter",
method: "get_param",
args: ["support_company_url"],
}).then(function (url) {
self.support_cp_url = url;
});
self._rpc({
model: "ir.config_parameter",
method: "get_param",
args: ["support_email"],
}).then(function (email) {
self.support_cp_email = email;
});
self._rpc({
model: "ir.config_parameter",
method: "get_param",
args: ["support_release"],
}).then(function (release) {
self.support_cp_release = release;
});
self._rpc({
model: "ir.config_parameter",
method: "get_param",
args: ["support_branding_color"],
}).then(function (color) {
self.support_cp_color = color;
});
});
},
show_error: function (error) {
var self = this;
this.wysiwyg = new Wysiwyg(self, {});
var subject =
session.username +
"@" +
session.db +
"[" +
session.server +
"]:" +
error.message;
var body = error.data.debug;
var inputs =
"" +
'<input type="hidden" name="subject" autocomplete="off" ' +
"value=" +
subject +
"/>\n" +
'<input type="hidden" class="sp-body" name="body" ' +
'autocomplete="off" value=\'' +
body +
"'/>";
return this._super.apply(this, arguments).opened(function () {
var $form = $(".support-branding-submit-form");
var $statement = $(".support-statement");
var $description = $(".support-desc");
var $button = $(".support-btn");
var $use_html_ck = $("#use_html_checker");
var $close_btn = $(".close");
var $body = $(".sp-body");
var $header = $form.parents(".modal-dialog").find(".modal-header");
var $footer = $form.parents(".modal-dialog").find(".modal-footer");
// Self.wysiwyg.attachTo($description);
$statement.prepend(inputs);
if (self.support_cp_email) {
if (self.support_cp_name) {
var title = "Support by " + self.support_cp_name;
$('<h3 class="text-primary">' + title + "</h3>").insertBefore(
".support-branding-submit-form"
);
$button.text(
_.str.sprintf(_t("Email to %s"), self.support_cp_name)
);
}
$form
.parents(".modal")
.find(".modal-body")
.css("max-height", "70vh");
$use_html_ck.on("change", function () {
if (this.checked) {
if (self.wysiwyg.isDestroyed()) {
self.wysiwyg = new Wysiwyg(self, {});
self.wysiwyg.attachTo($description);
} else self.wysiwyg.attachTo($description);
} else {
self.wysiwyg.destroy();
$(".support-statement").append($description);
if ($description.is(":hidden"))
$description.css({display: "block"});
}
});
$button.on("click", function (ev) {
var $btn = $(this);
if (!$description.val()) {
$description.parent().addClass("oe_form_invalid");
ev.preventDefault();
return;
}
ev.preventDefault();
var error_code = "";
var body_html = "";
var desc =
self.wysiwyg.$editor && self.wysiwyg.$editor.length
? self.wysiwyg.getValue()
: $description.val();
desc = `<div>${desc}</div>`;
error_code = `<pre>${body}</pre>`;
body_html = `<div>${desc}<br/>${error_code}</div>`;
var params = {
state: "outgoing",
auto_delete: true,
email_to: self.support_cp_email,
subject: subject,
body_html: body_html,
};
self._rpc({
model: "mail.mail",
method: "create",
args: [params],
}).then(
function (mail_id) {
if (mail_id) {
self._rpc({
model: "mail.mail",
method: "send",
args: [mail_id],
}).then(function () {
self.do_notify(
"Success",
"Support mail created!"
);
$close_btn.click();
});
}
},
function () {
$body.val(desc + "\n\n" + $body.val());
$btn.unbind("click");
$btn.click();
}
);
});
} else {
$description.css({display: "none"});
$button.css({display: "none"});
}
$form.prependTo($footer);
// Hide "Ok" button since we have close on the dialog top
// Allow send email btn to close once done.
$footer.find("button:eq(1)").css({display: "none"});
if (self.support_cp_color) {
$header.css({background: self.support_cp_color});
$footer.css({background: self.support_cp_color});
} else {
$header.css({background: ""});
$footer.css({background: ""});
}
});
},
});
});

View File

@@ -0,0 +1,27 @@
odoo.define("support_branding.UserMenu", function (require) {
"use strict";
var user_menu = require("web.UserMenu");
user_menu.include({
_onMenuSupport: function () {
var url = this.support_url || "https://www.odoo.com/buy";
window.open(url, "_blank");
},
willStart: function () {
var self = this;
var def = self
._rpc({
model: "ir.config_parameter",
method: "get_param",
args: ["support_company_url"],
})
.then(function (site) {
if (site && site !== "") {
self.support_url = site;
}
});
return $.when(this._super.apply(this, arguments), def);
},
});
});

View File

@@ -0,0 +1,80 @@
odoo.define("support_branding.crash_manager_tests", function (require) {
"use strict";
/* global QUnit*/
const CrashManager = require("web.CrashManager").CrashManager;
const testUtils = require("web.test_utils");
const createActionManager = testUtils.createActionManager;
QUnit.module("support_branding", {}, function () {
QUnit.test("Error Dialog is created", async function (assert) {
// No of assertion expected.
assert.expect(5);
// Create action manager to trigger error dialog
var actionManager = await createActionManager({
services: {
crash_manager: CrashManager,
},
});
// Check if action with crash manager service was created.
assert.notOk(
_.isEmpty(actionManager),
"Action manager with " +
"crash manager service should be created and not empty"
);
// Test custom error
const error = {
type: "Support Branding Odoo Client Error",
message: "Message",
data: {
debug: "Traceback",
},
};
// NB: This will use the saved res.config settings of support
// branding containing the support mail. It is fetched in crash
// manager init function as saved in res.config settings.
// attached is a default data xml with sample data.
actionManager.call("crash_manager", "show_error", error);
await testUtils.nextTick();
var $mail_dialog = "form.support-branding-submit-form";
// Confirm if we have a form and its required elements.
assert.containsOnce(
$,
$mail_dialog,
"Error dialog should be opened and showing mail section on footer"
);
assert.containsOnce(
$,
".support-desc",
"We should have a textarea to add our issues"
);
assert.containsOnce(
$,
"button.support-btn",
"We should have a send mail button to send support mail"
);
// Add a test text mail.
$(".support-desc").val(
"Send this as a test mail to configured support mail"
);
// Try to send mail, by default a popup will be triggered
// defaulting to form call of 'mailto'.
await testUtils.dom.click($("button.support-btn"), {allowInvisible: true});
// Close error dialog
await testUtils.dom.click($("button.close"), {allowInvisible: true});
// Confirm dialog was closed
assert.containsNone($, $mail_dialog, "Error Dialog should be closed");
actionManager.destroy();
});
});
});

View File

@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8" ?>
<templates>
<t t-extend="CrashManager.error">
<t t-jquery="div.o_error_detail" t-operation="after">
<div class="container">
<form
class="support-branding-submit-form oe_form"
enctype="text/plain"
method="get"
>
<div class="form-check">
<input
class="form-check-input"
type="checkbox"
name="use_html_checker"
id="use_html_checker"
/>
<label class="form-check-label" for="use_html_checker">
Use HTML Editor
</label>
</div>
<div class="support-statement oe_form_field_text oe_form_required">
<textarea
name="description"
autocomplete="off"
placeholder="Please fill in how you produced this error..."
class="support-desc"
/>
</div>
<button class="support-btn btn btn-primary">Email to support
company
</button>
</form>
</div>
</t>
</t>
<t t-extend="res_config_edition">
<t t-jquery="div#edition" t-operation="after">
<t
t-if="widget.support_cp_name and widget.support_cp_url and widget.support_cp_email"
>
<div class="col-12 o_setting_box" id="edition">
<div class="o_setting_right_pane">
<div class="user-heading">
<h3>
Technical Support By
<t t-esc="widget.support_cp_name" />
</h3>
</div>
<div class="tab-content">
<div
role="tabpanel"
id="settings"
class="tab-pane active text-muted o_web_settings_compact_subtitle"
>
<small>For Support visit our
<a
target="_blank"
t-attr-href="{{widget.support_cp_url}}"
style="text-decoration: underline;"
>
website
</a>
or mail us at
<a
target="_blank"
t-attr-href="mailto:{{widget.support_cp_email}}"
style="text-decoration: underline;"
>
<t t-esc="widget.support_cp_email" />
</a>
</small>
</div>
</div>
</div>
</div>
</t>
</t>
</t>
</templates>

View File

@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<template
id="assets_backend"
name="support_branding assets"
inherit_id="web.assets_backend"
>
<xpath expr="." position="inside">
<link
rel="stylesheet"
type="text/css"
href="/support_branding/static/src/css/support_branding.css"
/>
<script
type="text/javascript"
src="/support_branding/static/src/js/user_menu.js"
/>
<script
type="text/javascript"
src="/support_branding/static/src/js/res_config_edition.js"
/>
<script
type="text/javascript"
src="/support_branding/static/src/js/support_branding.js"
/>
</xpath>
</template>
<template
id="support_branding_qunit_suite_tests"
name="Support Branding tests"
inherit_id="web.qunit_suite_tests"
>
<xpath expr="//script[last()]" position="after">
<script
type="text/javascript"
src="/support_branding/static/src/tests/support_branding_tests.js"
/>
</xpath>
</template>
</odoo>

View File

@@ -0,0 +1,112 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="support_res_config_settings_view_form" model="ir.ui.view">
<field name="name">support.res.config.settings.view.form</field>
<field name="model">res.config.settings</field>
<field name="priority" eval="10" />
<field name="inherit_id" ref="base.res_config_settings_view_form" />
<field name="arch" type="xml">
<xpath expr="//div[hasclass('settings')]" position="inside">
<div
class="app_settings_block"
data-string="Support Settings"
string="Support Settings"
data-key="support_branding"
>
<h2>Support Company Settings</h2>
<div
class="row mt16 o_settings_container"
id="support_company_settings"
>
<div class="col-12 col-lg-6 o_setting_box">
<div class="content-group">
<div class="row mt16">
<div class="o_setting_right_pane">
<!-- Support Details -->
<!-- Name -->
<label for="support_company" />
<div class="text-muted">
Add the support company name
e.g Odoo Community Association (OCA)
</div>
<div class="content-group">
<div class="mt16">
<field name="support_company" />
</div>
</div>
<br />
<!-- URL -->
<label for="support_company_url" />
<div class="text-muted">
Add the support company URL
e.g https://odoo-community.org
</div>
<div class="content-group">
<div class="mt16">
<field name="support_company_url" />
</div>
</div>
<br />
<!-- Branding Color -->
<label for="support_branding_color" />
<div class="text-muted">
Add a branding color
e.g #b163a3
</div>
<div class="content-group">
<div class="mt16">
<field name="support_branding_color" />
</div>
</div>
<br />
<!-- Email -->
<label for="support_email" />
<div class="text-muted">
Add the support email to send issues
e.g info@helpdesksupport.com
</div>
<div class="content-group">
<div class="mt16">
<field name="support_email" />
</div>
</div>
<br />
<!-- Release -->
<label for="support_release" />
<div class="text-muted">
Add the support release
</div>
<div class="content-group">
<div class="mt16">
<field name="support_release" />
</div>
</div>
<br /> <br />
<div class="text-muted">
The below button generates a
division by zero python error which
allows a user to test the modules
functionality.
</div>
<br />
<button
name="test_support_branding_error"
string="Test Support Branding"
class="oe_highlight"
type="object"
data-toggle="tooltip"
title="Creates an error (i.e ZeroDivisionError) to test support branding"
/>
<br /> <br />
</div>
</div>
</div>
</div>
</div>
</div>
</xpath>
</field>
</record>
</odoo>

View File

@@ -8,7 +8,6 @@ odoo.define("web_advanced_search.RelationalOwl", function (require) {
const FieldMany2One = relationalFields.FieldMany2One;
const FieldManagerMixin = require("web.FieldManagerMixin");
const {useListener} = require("web.custom_hooks");
/* global owl */
const {Component} = owl;
const {xml} = owl.tags;

View File

@@ -15,6 +15,10 @@ odoo.define("web_calendar_color_field.CalendarModel", function (require) {
*
* If the field is also added to filters, and a color field is defined,
* we use that color field as colorIndex.
*
* @param {Object} element: ''
* @param {Array} events: ''
* @returns {Promise}
*/
_loadColors: function (element, events) {
var self = this;

View File

@@ -11,7 +11,7 @@ odoo.define("web_calendar_slot_duration.CalendarModel", function (require) {
* @override
*/
_getFullCalendarOptions: function () {
var result = this._super.call(this, arguments);
var result = this._super.apply(this, arguments);
result.slotDuration =
this.data.context.calendar_slot_duration ||
result.slotDuration ||

View File

@@ -1,4 +1,4 @@
/* global Uint8Array, base64js */
/* global base64js */
// Copyright 2018 Therp BV <https://therp.nl>
// Copyright 2021 Tecnativa - Alexandre D. Díaz
// License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
@@ -24,7 +24,8 @@ odoo.define("web_drop_target", function (require) {
*/
start: function () {
const $body = $("body");
this._dropZoneNS = _.uniqueId("o_dz_"); // For event namespace used when multiple chat window is open
// For event namespace used when multiple chat window is open
this._dropZoneNS = _.uniqueId("o_dz_");
$body.on(
"dragleave." + this._dropZoneNS,
this._onBodyFileDragLeave.bind(this)
@@ -159,7 +160,7 @@ odoo.define("web_drop_target", function (require) {
if (
_.isEmpty(this._get_drop_items(ev)) &&
this._checkDragOver() &&
(controller == undefined || controller.jsID === this.controllerID)
(controller === undefined || controller.jsID === this.controllerID)
) {
const drop_zone_offset = this.$drop_zone.offset();
const overlay_css = {
@@ -212,6 +213,7 @@ odoo.define("web_drop_target", function (require) {
*
* @private
* @param {MouseEvent} ev
* @returns {Object} drop items
*/
_get_drop_items: function (ev) {
let drop_items = [];
@@ -250,6 +252,7 @@ odoo.define("web_drop_target", function (require) {
* @param {String} res_model
* @param {Number} res_id
* @param {Object} extra_data
* @returns {Void}
*/
_create_attachment: function (file, reader, res_model, res_id, extra_data) {
// Helper to upload an attachment and update the sidebar

View File

@@ -134,7 +134,7 @@ odoo.define("web_m2x_options.web_m2x_options", function (require) {
if (blacklisted_ids.length > 0) {
domain.push(["id", "not in", blacklisted_ids]);
}
/* eslint-disable complexity */
self._rpc({
model: self.field.relation,
method: "name_search",
@@ -201,16 +201,15 @@ odoo.define("web_m2x_options.web_m2x_options", function (require) {
// 3- if not set locally, check if it's set globally via ir.config_parameter
// 4- if set globally, apply its value
// 5- if not set globally either, check if returned values are more than node's limit
var search_more = values.length > self.limit;
if (!_.isUndefined(self.nodeOptions.search_more)) {
var search_more = is_option_set(self.nodeOptions.search_more);
search_more = is_option_set(self.nodeOptions.search_more);
} else if (
!_.isUndefined(ir_options["web_m2x_options.search_more"])
) {
var search_more = is_option_set(
search_more = is_option_set(
ir_options["web_m2x_options.search_more"]
);
} else {
var search_more = values.length > self.limit;
}
if (search_more) {
@@ -349,6 +348,7 @@ odoo.define("web_m2x_options.web_m2x_options", function (require) {
resolve(values);
}
});
/* eslint-enable complexity */
});
this.orderer.add(def);
@@ -483,7 +483,7 @@ odoo.define("web_m2x_options.web_m2x_options", function (require) {
this._super(attrs);
var limit = ir_options["web_m2x_options.field_limit_entries"];
if (!_.isUndefined(limit)) {
attrs.limit = parseInt(limit);
attrs.limit = parseInt(limit, 10);
}
},
});

View File

@@ -21,7 +21,8 @@ odoo.define("web_pwa_oca.PWAManager", function (require) {
"Service workers are not supported! Maybe you are not using HTTPS or you work in private mode."
)
);
} else {
}
if ("serviceWorker" in navigator) {
this._service_worker = navigator.serviceWorker;
this.registerServiceWorker("/service-worker.js");
}

View File

@@ -61,13 +61,15 @@
"click .o_kanban_mobile_tab": "_onMobileTabClicked",
"click .o_kanban_mobile_add_column": "_onMobileQuickCreateClicked",
}),
ANIMATE: true, // Allows to disable animations for the tests
// Allows to disable animations for the tests
ANIMATE: true,
/**
* @override
*/
init: function () {
this._super.apply(this, arguments);
this.activeColumnIndex = 0; // Index of the currently displayed column
// Index of the currently displayed column
this.activeColumnIndex = 0;
this._scrollPosition = null;
},
/**
@@ -377,7 +379,8 @@
db_id: column.db_id,
onSuccess: () => self._layoutUpdate(animate),
});
} else {
}
if (column.data.isOpen) {
this._layoutUpdate(animate);
}
return Promise.resolve();
@@ -396,16 +399,19 @@
_renderGrouped: function (fragment) {
var self = this;
var newFragment = document.createDocumentFragment();
this._super.apply(this, [newFragment]);
var fragment_change = [newFragment];
this._super.apply(this, fragment_change);
this.defs.push(
Promise.all(this.defs).then(function () {
var data = [];
_.each(self.state.data, function (group) {
if (!group.value) {
group = _.extend({}, group, {value: _t("Undefined")});
data.unshift(group);
} else {
data.push(group);
var grp = group;
if (!grp.value) {
grp = _.extend({}, grp, {value: _t("Undefined")});
data.unshift(grp);
}
if (grp.value) {
data.push(grp);
}
});
@@ -445,7 +451,7 @@
* Retrieve the Jquery node (.o_kanban_group) for a list of a given widgets
*
* @private
* @param widgets
* @param {Object} widgets: ''
* @returns {jQuery} the matching .o_kanban_group widgets
*/
_toNode: function (widgets) {
@@ -462,8 +468,8 @@
* Update the given column to the updated positions
*
* @private
* @param $column The jquery column
* @param cssProperties Use to update column
* @param {Object} $column The jquery column
* @param {Object} cssProperties Use to update column
* @param {Boolean} [animate=false] set to true to animate
* @returns {Promise}
*/
@@ -493,6 +499,7 @@
/**
* @private
* @param {MouseEvent} event
*/
_onMobileQuickCreateClicked: function (event) {
if (event) {

View File

@@ -21,7 +21,6 @@ odoo.define("web_responsive", function (require) {
const PatchableAttachmentViewer = patchMixin(AttachmentViewer);
const ControlPanel = require("web.ControlPanel");
const SearchPanel = require("web/static/src/js/views/search_panel.js");
/* global owl */
const {QWeb, Context} = owl;
const {useState, useContext} = owl.hooks;

View File

@@ -20,32 +20,32 @@ odoo.define(
isShiftKey,
}) {
const queryElem = this.state.query.find(
(queryElem) =>
queryElem.filterId === filterId &&
queryElem.value === value &&
queryElem.operator === operator
(queryElem_val) =>
queryElem_val.filterId === filterId &&
queryElem_val.value === value &&
queryElem_val.operator === operator
);
if (!queryElem) {
const {groupId} = this.state.filters[filterId];
this.state.query.push({
filterId,
groupId,
label,
value,
operator,
});
if (isShiftKey) {
const groupId = Math.random();
const group_id = Math.random();
this.state.query.push({
filterId,
groupId,
label,
value,
operator,
});
} else {
const {groupId} = this.state.filters[filterId];
this.state.query.push({
filterId,
groupId,
group_id,
label,
value,
operator,
});
}
} else {
}
if (queryElem) {
queryElem.label = label;
}
},

View File

@@ -36,6 +36,8 @@ odoo.define("web_search_with_and/static/src/js/search_bar.js", function (require
this._closeAutoComplete();
},
/* eslint-disable complexity */
/**
* @private
* @param {KeyboardEvent} ev
@@ -100,7 +102,7 @@ odoo.define("web_search_with_and/static/src/js/search_bar.js", function (require
}
}
break;
case "ArrowUp":
case "ArrowUp": {
ev.preventDefault();
let previousIndex = this.state.focusedItem - 1;
if (previousIndex < 0) {
@@ -108,6 +110,7 @@ odoo.define("web_search_with_and/static/src/js/search_bar.js", function (require
}
this.state.focusedItem = previousIndex;
break;
}
case "Backspace":
if (!this.state.inputValue.length) {
const facets = this.model.get("facets");
@@ -124,7 +127,8 @@ odoo.define("web_search_with_and/static/src/js/search_bar.js", function (require
/* Falls through */
case "Tab":
if (this.state.inputValue.length) {
ev.preventDefault(); // Keep the focus inside the search bar
// Keep the focus inside the search bar
ev.preventDefault();
this._selectSource(currentItem);
}
break;
@@ -135,5 +139,6 @@ odoo.define("web_search_with_and/static/src/js/search_bar.js", function (require
break;
}
},
/* eslint-enable complexity */
});
});

View File

@@ -1,8 +1,8 @@
// Show a big banner in the top of the page if the context has been
// Changed in another tab or window (in the same browser)
var con = [];
var lastCtx = null;
window.con = [];
window.lastCtx = null;
addEventListener(
"connect",
@@ -10,21 +10,21 @@ addEventListener(
"use strict";
var port = ee.ports[0];
con.push(port);
window.con.push(port);
port.onmessage = function (e) {
var newCtx = e.data;
if (lastCtx && newCtx !== lastCtx) {
con.forEach(function (eport) {
if (window.lastCtx && newCtx !== window.lastCtx) {
window.con.forEach(function (eport) {
eport.postMessage({
type: "newCtx",
newCtx: newCtx,
lastCtx: lastCtx,
lastCtx: window.lastCtx,
});
});
}
lastCtx = newCtx;
window.lastCtx = newCtx;
};
},
false

View File

@@ -159,21 +159,23 @@ odoo.define("web_widget_numeric_step.field", function (require) {
* @param {String} mode can be "plus" or "minus"
*/
_doStep: function (mode) {
let mode_val = mode;
let cval = 0;
try {
const field = this.record.fields[this.name];
cval = field_utils.parse[field.type](this.$input.val());
} catch (e) {
cval = this.value;
mode = false; // Only set the value in this case
// Only set the value in this case
mode_val = false;
}
if (mode === "plus") {
if (mode_val === "plus") {
cval += this._config.step;
} else if (mode === "minus") {
} else if (mode_val === "minus") {
cval -= this._config.step;
}
const nval = this._sanitizeNumberValue(cval);
if (nval !== this.lastSetValue || !mode) {
if (nval !== this.lastSetValue || !mode_val) {
this.$input.val(nval);
// Every time that user update the value we must trigger an
// onchange method.

View File

@@ -176,6 +176,9 @@ odoo.define("web_widget_x2many_2d_matrix.widget", function (require) {
/**
* Determine if a field represented by field_def can be aggregated
*
* @param {Object} field_def: field def
* @returns {Boolean} if field def is aggregatable
*/
is_aggregatable: function (field_def) {
return field_def.type in {float: 1, monetary: 1, integer: 1};