Skip to content
Snippets Groups Projects
Commit 1d0c80b8baa3 authored by arthur.mayer's avatar arthur.mayer
Browse files

Migrated to 16.0

parent e2623afff2ec
No related branches found
No related tags found
1 merge request!3[WIP] Migrate to 16.0
Pipeline #74378 passed with warnings
Showing with 435 additions and 74 deletions
<?xml version="1.0" encoding="UTF-8" ?>
<svg xmlns="http://www.w3.org/2000/svg" width="114" height="20">
<linearGradient id="b" x2="0" y2="100%">
<stop offset="0" stop-color="#bbb" stop-opacity=".1" />
<stop offset="1" stop-opacity=".1" />
</linearGradient>
<mask id="anybadge_1">
<rect width="114" height="20" rx="3" fill="#fff" />
</mask>
<g mask="url(#anybadge_1)">
<path fill="#555" d="M0 0h72v20H0z" />
<path fill="#000000" d="M72 0h42v20H72z" />
<path fill="url(#b)" d="M0 0h114v20H0z" />
</g>
<g
fill="#fff"
text-anchor="middle"
font-family="DejaVu Sans,Verdana,Geneva,sans-serif"
font-size="11"
>
<text x="37.0" y="15" fill="#010101" fill-opacity=".3">code style</text>
<text x="36.0" y="14">code style</text>
</g>
<g
fill="#fff"
text-anchor="middle"
font-family="DejaVu Sans,Verdana,Geneva,sans-serif"
font-size="11"
>
<text x="94.0" y="15" fill="#010101" fill-opacity=".3">black</text>
<text x="93.0" y="14">black</text>
</g>
</svg>
<?xml version="1.0" encoding="UTF-8" ?>
<svg xmlns="http://www.w3.org/2000/svg" width="129" height="20">
<linearGradient id="b" x2="0" y2="100%">
<stop offset="0" stop-color="#bbb" stop-opacity=".1" />
<stop offset="1" stop-opacity=".1" />
</linearGradient>
<mask id="anybadge_1">
<rect width="129" height="20" rx="3" fill="#fff" />
</mask>
<g mask="url(#anybadge_1)">
<path fill="#555" d="M0 0h72v20H0z" />
<path fill="#ff69b4" d="M72 0h57v20H72z" />
<path fill="url(#b)" d="M0 0h129v20H0z" />
</g>
<g
fill="#fff"
text-anchor="middle"
font-family="DejaVu Sans,Verdana,Geneva,sans-serif"
font-size="11"
>
<text x="37.0" y="15" fill="#010101" fill-opacity=".3">code style</text>
<text x="36.0" y="14">code style</text>
</g>
<g
fill="#fff"
text-anchor="middle"
font-family="DejaVu Sans,Verdana,Geneva,sans-serif"
font-size="11"
>
<text x="101.5" y="15" fill="#010101" fill-opacity=".3">prettier</text>
<text x="100.5" y="14">prettier</text>
</g>
</svg>
<?xml version="1.0" encoding="UTF-8" ?>
<svg xmlns="http://www.w3.org/2000/svg" width="107" height="20">
<linearGradient id="b" x2="0" y2="100%">
<stop offset="0" stop-color="#bbb" stop-opacity=".1" />
<stop offset="1" stop-opacity=".1" />
</linearGradient>
<mask id="anybadge_1">
<rect width="107" height="20" rx="3" fill="#fff" />
</mask>
<g mask="url(#anybadge_1)">
<path fill="#555" d="M0 0h53v20H0z" />
<path fill="#0000FF" d="M53 0h54v20H53z" />
<path fill="url(#b)" d="M0 0h107v20H0z" />
</g>
<g
fill="#fff"
text-anchor="middle"
font-family="DejaVu Sans,Verdana,Geneva,sans-serif"
font-size="11"
>
<text x="27.5" y="15" fill="#010101" fill-opacity=".3">licence</text>
<text x="26.5" y="14">licence</text>
</g>
<g
fill="#fff"
text-anchor="middle"
font-family="DejaVu Sans,Verdana,Geneva,sans-serif"
font-size="11"
>
<text x="81.0" y="15" fill="#010101" fill-opacity=".3">AGPL-3</text>
<text x="80.0" y="14">AGPL-3</text>
</g>
</svg>
<?xml version="1.0" encoding="UTF-8" ?>
<svg xmlns="http://www.w3.org/2000/svg" width="103" height="20">
<linearGradient id="b" x2="0" y2="100%">
<stop offset="0" stop-color="#bbb" stop-opacity=".1" />
<stop offset="1" stop-opacity=".1" />
</linearGradient>
<mask id="anybadge_1">
<rect width="103" height="20" rx="3" fill="#fff" />
</mask>
<g mask="url(#anybadge_1)">
<path fill="#555" d="M0 0h61v20H0z" />
<path fill="#e05d44" d="M61 0h42v20H61z" />
<path fill="url(#b)" d="M0 0h103v20H0z" />
</g>
<g
fill="#fff"
text-anchor="middle"
font-family="DejaVu Sans,Verdana,Geneva,sans-serif"
font-size="11"
>
<text x="31.5" y="15" fill="#010101" fill-opacity=".3">maturity</text>
<text x="30.5" y="14">maturity</text>
</g>
<g
fill="#fff"
text-anchor="middle"
font-family="DejaVu Sans,Verdana,Geneva,sans-serif"
font-size="11"
>
<text x="83.0" y="15" fill="#010101" fill-opacity=".3">Alpha</text>
<text x="82.0" y="14">Alpha</text>
</g>
</svg>
# Configuration for known file extensions
[*.{css,htm,html,js,json,jsx,less,markdown,md,py,rst,sass,scss,toml,xml,yaml,yml}]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
[*.{json,yml,yaml,rst,markdown,md,toml}]
indent_size = 2
# Do not configure editor for libs
[*/static/{lib,src/lib}/**]
charset = unset
end_of_line = unset
indent_size = unset
indent_style = unset
insert_final_newline = false
trim_trailing_whitespace = false
env:
browser: true
es6: true
# See https://github.com/OCA/odoo-community.org/issues/37#issuecomment-470686449
parserOptions:
ecmaVersion: 2019
overrides:
- files:
- "**/*.esm.js"
parserOptions:
sourceType: module
# Globals available in Odoo that shouldn't produce errorings
globals:
_: readonly
$: readonly
fuzzy: readonly
jQuery: readonly
moment: readonly
odoo: readonly
openerp: readonly
owl: readonly
# Styling is handled by Prettier, so we only need to enable AST rules;
# see https://github.com/OCA/maintainer-quality-tools/pull/618#issuecomment-558576890
rules:
accessor-pairs: warn
array-callback-return: warn
callback-return: warn
capitalized-comments:
- warn
- always
- ignoreConsecutiveComments: true
ignoreInlineComments: true
complexity:
- warn
- 15
constructor-super: warn
dot-notation: warn
eqeqeq: warn
global-require: warn
handle-callback-err: warn
id-blacklist: warn
id-match: warn
init-declarations: error
max-depth: warn
max-nested-callbacks: warn
max-statements-per-line: warn
no-alert: warn
no-array-constructor: warn
no-caller: warn
no-case-declarations: warn
no-class-assign: warn
no-cond-assign: error
no-const-assign: error
no-constant-condition: warn
no-control-regex: warn
no-debugger: error
no-delete-var: warn
no-div-regex: warn
no-dupe-args: error
no-dupe-class-members: error
no-dupe-keys: error
no-duplicate-case: error
no-duplicate-imports: error
no-else-return: warn
no-empty-character-class: warn
no-empty-function: error
no-empty-pattern: error
no-empty: warn
no-eq-null: error
no-eval: error
no-ex-assign: error
no-extend-native: warn
no-extra-bind: warn
no-extra-boolean-cast: warn
no-extra-label: warn
no-fallthrough: warn
no-func-assign: error
no-global-assign: error
no-implicit-coercion:
- warn
- allow: ["~"]
no-implicit-globals: warn
no-implied-eval: warn
no-inline-comments: warn
no-inner-declarations: warn
no-invalid-regexp: warn
no-irregular-whitespace: warn
no-iterator: warn
no-label-var: warn
no-labels: warn
no-lone-blocks: warn
no-lonely-if: error
no-mixed-requires: error
no-multi-str: warn
no-native-reassign: error
no-negated-condition: warn
no-negated-in-lhs: error
no-new-func: warn
no-new-object: warn
no-new-require: warn
no-new-symbol: warn
no-new-wrappers: warn
no-new: warn
no-obj-calls: warn
no-octal-escape: warn
no-octal: warn
no-param-reassign: warn
no-path-concat: warn
no-process-env: warn
no-process-exit: warn
no-proto: warn
no-prototype-builtins: warn
no-redeclare: warn
no-regex-spaces: warn
no-restricted-globals: warn
no-restricted-imports: warn
no-restricted-modules: warn
no-restricted-syntax: warn
no-return-assign: error
no-script-url: warn
no-self-assign: warn
no-self-compare: warn
no-sequences: warn
no-shadow-restricted-names: warn
no-shadow: warn
no-sparse-arrays: warn
no-sync: warn
no-this-before-super: warn
no-throw-literal: warn
no-undef-init: warn
no-undef: error
no-unmodified-loop-condition: warn
no-unneeded-ternary: error
no-unreachable: error
no-unsafe-finally: error
no-unused-expressions: error
no-unused-labels: error
no-unused-vars: error
no-use-before-define: error
no-useless-call: warn
no-useless-computed-key: warn
no-useless-concat: warn
no-useless-constructor: warn
no-useless-escape: warn
no-useless-rename: warn
no-void: warn
no-with: warn
operator-assignment: [error, always]
prefer-const: warn
radix: warn
require-yield: warn
sort-imports: warn
spaced-comment: [error, always]
strict: [error, function]
use-isnan: error
valid-jsdoc:
- warn
- prefer:
arg: param
argument: param
augments: extends
constructor: class
exception: throws
func: function
method: function
prop: property
return: returns
virtual: abstract
yield: yields
preferType:
array: Array
bool: Boolean
boolean: Boolean
number: Number
object: Object
str: String
string: String
requireParamDescription: false
requireReturn: false
requireReturnDescription: false
requireReturnType: false
valid-typeof: warn
yoda: warn
[flake8]
max-line-length = 88
per-file-ignores=
__init__.py:F401
__manifest__.py:B018
include:
- project: xcg/ci-templates
file: /odoo/16.0/gitlab-ci.yaml
syntax: glob
**/*.pyc
*.pyc
*.pyo
*.swp
.tmp*
*~
*.egg-info
dist/*
build/*
lib/*
output/*
*.orig
*.log
.settings/*
storage/*
.project
.idea
.pydevproject
*.db
.ropeproject/*
.mob
./doc/_build
./doc/autotodo
......@@ -23,5 +2,2 @@
./doc/_build
./doc/autotodo
./doc/manifest
pyproject.toml
.isort.cfg
# Defaults for all prettier-supported languages.
# Prettier will complete this with settings from .editorconfig file.
bracketSpacing: false
printWidth: 88
proseWrap: always
semi: true
trailingComma: "es5"
xmlWhitespaceSensitivity: "ignore"
rules:
document-start: disable
indentation:
indent-sequences: true
=======
History
=======
Changelog
=========
16.0.1.0.0
----------
* Migrate to Odoo 16.0
13.0.1.0.0
----------
......
============
Board Alerts
============
......@@ -1,6 +2,21 @@
Board Alerts
============
.. |maturity| image:: .badges/maturity.svg
:target: https://odoo-community.org/page/development-status
:alt: Alpha
.. |license| image:: .badges/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |black| image:: .badges/code_style-black-000000.svg
:target: https://github.com/psf/black
:alt: Black
.. |prettier| image:: .badges/code_style-prettier-ff69b4.svg
:target: https://github.com/prettier/prettier
:alt: Prettier
|maturity| |license| |black| |prettier|
Send emails at regular intervals to summarize the contents of a dashboard.
......@@ -13,6 +29,9 @@
* The administrator can adjust the email frequency.
Usage
=====
Example use
-----------
......@@ -34,3 +53,14 @@
- The administrator can adjust the email frequency:
.. image:: doc_images/board_alerts_example_4.png
Credits
=======
Authors
-------
- XCG Consulting, part of `Orbeet <https://orbeet.io>`_
- `Arthur Mayer <arthur.mayer@xcg-consulting.fr>`_
\ No newline at end of file
# flake8: noqa
from . import controllers, models, wizard
# -*- coding: utf-8 -*-
##############################################################################
#
......@@ -2,7 +1,7 @@
##############################################################################
#
# Board Alerts, for Odoo
# Copyright (C) 2013 XCG Consulting (http://odoo.consulting)
# Board alerts, for Odoo
# Copyright © 2021, 2022, 2023 XCG Consulting <https://xcg-consulting.fr>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
......@@ -20,21 +19,11 @@
##############################################################################
{
"name": "Board alerts",
"description": """
Board alerts
============
Send emails at regular intervals to summarize the contents of a dashboard.
Create your own Odoo notifications
----------------------------------
* Create your own notifications based on the contents of your activity.
* See your alerts in your dasboard.
* Receive them automatically by email at regular intervals.
* The administrator can adjust the email frequency.
""",
"version": "13.0.1.0",
"summary": """
Send emails at regular intervals"
to summarize the contents of a dashboard.
""",
"license": "AGPL-3",
"version": "16.0.1.0.0",
"category": "Tools",
"author": "XCG Consulting",
......@@ -39,5 +28,5 @@
"category": "Tools",
"author": "XCG Consulting",
"website": "http://odoo.consulting/",
"depends": ["board", "mail", "web"],
"website": "https://orbeet.io/",
"depends": ["web", "board", "mail", "spreadsheet_dashboard"],
"data": [
......@@ -43,4 +32,5 @@
"data": [
"security/ir.model.access.csv",
"data/alert_board.xml",
"data/board_alerts_email_template.xml",
"data/board_alerts_cron_task.xml",
......@@ -44,6 +34,5 @@
"data/alert_board.xml",
"data/board_alerts_email_template.xml",
"data/board_alerts_cron_task.xml",
"views/board_alerts_assets.xml",
"wizard/board_alerts_dlg.xml",
],
......@@ -48,5 +37,11 @@
"wizard/board_alerts_dlg.xml",
],
"qweb": ["static/src/xml/alert_board.xml"],
"assets": {
"web.assets_backend": [
"/board_alerts/static/src/xml/alert_board.xml",
# "/board_alerts/static/src/scss/alert_board.scss",
"/board_alerts/static/src/js/alert_board.js",
],
},
"installable": True,
}
......@@ -13,11 +13,8 @@
"""
@route(route="/board/add_to_alert_dashboard", type="json", auth="user")
def add_to_dashboard(
self, action_id, context_to_save, domain, view_mode, name=""
):
"""Called when adding to the alert dashboard from the Odoo web client.
"""
def add_to_dashboard(self, action_id, context_to_save, domain, view_mode, name=""):
"""Called when adding to the alert dashboard from the Odoo web client."""
action = request.env.ref("board_alerts.action_alert_board")
if (
......@@ -28,7 +25,7 @@
):
# Maybe should check the content instead of model board.board ?
view_id = action["views"][0][0]
board = request.env["board.board"].fields_view_get(view_id, "form")
board = request.env["board.board"].get_view(view_id, "form")
if board and "arch" in board:
xml = ElementTree.fromstring(board["arch"])
column = xml.find("./board/column")
......
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<data noupdate="1">
......@@ -2,6 +2,5 @@
<odoo>
<data noupdate="1">
<!-- Define the board the user can drag views into that will be used to send
emails. Imitated from the definition of the "My Dashboard" board in odoo/addons/board/views/board_views.xml. -->
......@@ -25,8 +24,11 @@
<field name="view_id" ref="alert_board" />
</record>
<menuitem id="menu_alert_board" parent="base.menu_board_root"
action="action_alert_board" sequence="6" />
<menuitem
id="menu_alert_board"
parent="spreadsheet_dashboard.spreadsheet_dashboard_menu_root"
action="action_alert_board"
sequence="126"
/>
</data>
</odoo>
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<data noupdate="1">
......@@ -2,6 +2,5 @@
<odoo>
<data noupdate="1">
<!-- Cron task to send board alert emails every morning at 07H00. -->
<record id="board_alerts_cron_task" model="ir.cron">
......@@ -10,5 +9,5 @@
<field name="code">model.send_board_alerts()</field>
<field name="interval_number">1</field>
<field name="interval_type">days</field>
<field name="model_id" ref="model_res_users"/>
<field name="model_id" ref="model_res_users" />
<field name="name">Board alerts - Daily emails</field>
......@@ -14,5 +13,4 @@
<field name="name">Board alerts - Daily emails</field>
<field name="nextcall"
eval="time.strftime('%Y-%m-%d 07:00:00', time.localtime(time.time() + 24 * 3600))" />
<field name="nextcall" eval="time.strftime('%Y-%m-%d 07:00:00')" />
<field name="numbercall">-1</field>
</record>
......@@ -17,5 +15,4 @@
<field name="numbercall">-1</field>
</record>
</data>
</odoo>
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<data noupdate="1">
......@@ -2,6 +2,5 @@
<odoo>
<data noupdate="1">
<!-- Default email template for board alert emails. -->
<record id="board_alerts_mail_template" model="mail.template">
......@@ -5,8 +4,10 @@
<!-- Default email template for board alert emails. -->
<record id="board_alerts_mail_template" model="mail.template">
<field name="body_html"><![CDATA[
<field
name="body_html"
><![CDATA[
<p>Hello ${ object.name },</p>
<p>Here follow your alerts for today.</p>
<div>${ object.get_board_alert_contents() | safe }</div>
]]></field>
......@@ -9,8 +10,10 @@
<p>Hello ${ object.name },</p>
<p>Here follow your alerts for today.</p>
<div>${ object.get_board_alert_contents() | safe }</div>
]]></field>
<field name="email_from">${ object.company_id.name or '' } &lt;${ object.company_id.email or '' }&gt;</field>
<field
name="email_from"
>${ object.company_id.name or '' } &lt;${ object.company_id.email or '' }&gt;</field>
<field name="partner_to">${ object.partner_id.id }</field>
<field name="email_to">${ object.email }</field>
<field name="lang">${object.partner_id.lang}</field>
......@@ -18,6 +21,5 @@
<field name="name">Board alert email</field>
<field name="subject">Today's alerts</field>
</record>
</data>
</odoo>
../.badges
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment