Compare commits
No commits in common. '14.0' and '8.0' have entirely different histories.
-
1.DINAR/build-date.txt
-
15.DINAR/config.yaml
-
4.DINAR/image/README.md
-
2.DINAR/image/dependencies/pip.txt
-
1.DINAR/image/src/addons.yaml
-
12.DINAR/image/src/repos.yaml
-
20.editorconfig
-
184.eslintrc.yml
-
11.flake8
-
2.github/FUNDING.yml
-
145.github/workflows/DINAR-PORT.yml
-
264.github/workflows/DINAR-pr.yml
-
2.github/workflows/DINAR-readme.yml
-
116.github/workflows/DINAR.yml
-
19.github/workflows/main.yml
-
58.gitignore
-
13.isort.cfg
-
111.pre-commit-config.yaml
-
8.prettierrc.yml
-
86.pylintrc
-
65.pylintrc-mandatory
-
38.travis.yml
-
166LICENSE
-
31README.md
-
17im_notif/README.rst
-
9im_notif/__init__.py
-
17im_notif/__openerp__.py
-
4im_notif/doc/changelog.rst
-
19im_notif/im_notif_data.xml
-
160im_notif/im_notif_models.py
-
12im_notif/im_notif_views.xml
-
BINim_notif/images/my-pref.png
-
BINim_notif/static/description/icon.png
-
BINim_notif/static/description/im-chat.png
-
69im_notif/static/description/index.html
-
BINim_notif/static/description/my-pref-button.png
-
44im_notif/static/src/js/im_notif.js
-
17mail_all/README.rst
-
3mail_all/__init__.py
-
26mail_all/__openerp__.py
-
7mail_all/doc/changelog.rst
-
9mail_all/doc/index.rst
-
BINmail_all/images/1.png
-
1mail_all/models/__init__.py
-
BINmail_all/static/description/1.png
-
BINmail_all/static/description/icon.png
-
32mail_all/static/description/index.html
-
32mail_all/views/templates.xml
-
26mail_attachment_popup/README.rst
-
0mail_attachment_popup/__init__.py
-
26mail_attachment_popup/__openerp__.py
-
4mail_attachment_popup/doc/changelog.rst
-
16mail_attachment_popup/doc/index.rst
-
BINmail_attachment_popup/images/popup_image.png
-
BINmail_attachment_popup/static/description/attach_image.png
-
BINmail_attachment_popup/static/description/download.png
-
BINmail_attachment_popup/static/description/icon.png
-
84mail_attachment_popup/static/description/index.html
-
BINmail_attachment_popup/static/description/popup.png
-
429mail_attachment_popup/static/lib/js/jquery.arcticmodal.js
-
8mail_attachment_popup/static/src/css/jquery.arcticmodal.css
-
11mail_attachment_popup/static/src/css/simple.css
-
10mail_attachment_popup/static/src/css/styles.css
-
BINmail_attachment_popup/static/src/img/loading.gif
-
19mail_attachment_popup/static/src/xml/mail_attachment_popup.xml
-
13mail_attachment_popup/views/mail_attachment_popup_template.xml
-
9mail_check_immediately/README.rst
-
2mail_check_immediately/__init__.py
-
17mail_check_immediately/__openerp__.py
-
4mail_check_immediately/doc/changelog.rst
-
BINmail_check_immediately/images/mail_check_immediately.jpg
-
66mail_check_immediately/models.py
-
BINmail_check_immediately/static/description/icon.png
-
47mail_check_immediately/static/description/index.html
-
BINmail_check_immediately/static/description/issue.png
-
BINmail_check_immediately/static/description/screenshot.png
-
55mail_check_immediately/static/src/js/main.js
-
25mail_check_immediately/static/src/xml/main.xml
-
9mail_check_immediately/views.xml
-
8mail_delete_access_link/README.rst
-
2mail_delete_access_link/__init__.py
-
12mail_delete_access_link/__openerp__.py
-
9mail_delete_access_link/mail_delete_access_link.py
-
BINmail_delete_access_link/static/description/icon.png
-
27mail_delete_odoo_footer/README.rst
-
0mail_delete_odoo_footer/__init__.py
-
13mail_delete_odoo_footer/__openerp__.py
-
4mail_delete_odoo_footer/doc/changelog.rst
-
13mail_delete_odoo_footer/doc/index.rst
-
BINmail_delete_odoo_footer/static/description/icon.png
-
8mail_delete_sent_by_footer/README.rst
-
2mail_delete_sent_by_footer/__init__.py
-
13mail_delete_sent_by_footer/__openerp__.py
-
23mail_delete_sent_by_footer/mail_delete_sent_by_footer.py
-
BINmail_delete_sent_by_footer/static/description/icon.png
-
48mail_fix_553/README.rst
-
2mail_fix_553/__init__.py
-
12mail_fix_553/__openerp__.py
-
15mail_fix_553/data.xml
-
165mail_fix_553/mail_fix_553.py
@ -1 +0,0 @@ |
|||
new repo readme files |
@ -1,15 +0,0 @@ |
|||
addons: |
|||
# modules to install before running tests |
|||
include: |
|||
- contacts |
|||
# "contacts" already has mail in dependencies, |
|||
# but without the following line DINAR may run odoo odoo with --init=mail,.... |
|||
# which leads to error on loading mail's demo data |
|||
- mail |
|||
|
|||
# modules to exclude from installation/testing |
|||
exclude: |
|||
- hw_proxy |
|||
|
|||
server_wide_modules: |
|||
- web |
@ -1,4 +0,0 @@ |
|||
This folder is attached on image building as `custom/` folder in |
|||
[doobba](https://github.com/Tecnativa/doodba#image-usage). Few additional |
|||
[files](https://github.com/itpp-labs/DINAR/tree/master/embedded-files/.DINAR/image) are |
|||
attached temporary on image building. |
@ -1,2 +0,0 @@ |
|||
# Python dependencies |
|||
pycryptodome |
@ -1 +0,0 @@ |
|||
# see https://github.com/Tecnativa/doodba#optodoocustomsrcaddonsyaml |
@ -1,12 +0,0 @@ |
|||
# Documentation: https://github.com/Tecnativa/doodba#optodoocustomsrcreposyaml |
|||
|
|||
# Odoo source. |
|||
# Update this section to switch to OCA/OCB or apply custom patches |
|||
odoo: |
|||
defaults: |
|||
depth: 1 |
|||
remotes: |
|||
origin: https://github.com/odoo/odoo.git |
|||
target: origin $ODOO_VERSION |
|||
merges: |
|||
- origin $ODOO_VERSION |
@ -1,20 +0,0 @@ |
|||
# Configuration for known file extensions |
|||
[*.{css,js,json,less,md,py,rst,sass,scss,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,md}] |
|||
indent_size = 2 |
|||
|
|||
# Do not configure editor for libs and autogenerated content |
|||
[{*/static/{lib,src/lib}/**,*/static/description/index.html,*/readme/../README.rst}] |
|||
charset = unset |
|||
end_of_line = unset |
|||
indent_size = unset |
|||
indent_style = unset |
|||
insert_final_newline = false |
|||
trim_trailing_whitespace = false |
@ -1,184 +0,0 @@ |
|||
env: |
|||
browser: true |
|||
|
|||
# See https://github.com/OCA/odoo-community.org/issues/37#issuecomment-470686449 |
|||
parserOptions: |
|||
ecmaVersion: 2017 |
|||
|
|||
# Globals available in Odoo that shouldn't produce errorings |
|||
globals: |
|||
_: readonly |
|||
$: readonly |
|||
fuzzy: readonly |
|||
jQuery: readonly |
|||
moment: readonly |
|||
odoo: readonly |
|||
openerp: readonly |
|||
Promise: 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: off |
|||
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 |
|||
- args: none |
|||
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] |
|||
space-before-function-paren: ["warn", {"anonymous": "always", "named": "never"}] |
|||
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 |
@ -1,11 +0,0 @@ |
|||
[flake8] |
|||
max-line-length = 80 |
|||
max-complexity = 16 |
|||
# B = bugbear |
|||
# B9 = bugbear opinionated (incl line length) |
|||
select = C,E,F,W,B,B9 |
|||
# E203: whitespace before ':' (black behaviour) |
|||
# E501: flake8 line length (covered by bugbear B950) |
|||
# W503: line break before binary operator (black behaviour) |
|||
# C901: "method is too complex" -- it's too complex to fix existing modules. Disable for now |
|||
ignore = E203,E501,W503,B950,C901 |
@ -1,2 +0,0 @@ |
|||
ko_fi: itprojectsllc # This is supposed to bring some coffee for us |
|||
patreon: itpp # become our patron |
@ -1,145 +0,0 @@ |
|||
# Copyright 2020 IT Projects Labs |
|||
# |
|||
# Licensed under the Apache License, Version 2.0 (the "License"); |
|||
# you may not use this file except in compliance with the License. |
|||
# You may obtain a copy of the License at |
|||
# |
|||
# http://www.apache.org/licenses/LICENSE-2.0 |
|||
# |
|||
# Unless required by applicable law or agreed to in writing, software |
|||
# distributed under the License is distributed on an "AS IS" BASIS, |
|||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|||
# See the License for the specific language governing permissions and |
|||
# limitations under the License. |
|||
name: "Port module" |
|||
|
|||
on: |
|||
issues: |
|||
types: |
|||
- opened |
|||
- reopened |
|||
|
|||
jobs: |
|||
port: |
|||
runs-on: ubuntu-latest |
|||
if: "startsWith(github.event.issue.title, 'DINAR-PORT ')" |
|||
steps: |
|||
- name: Post link |
|||
uses: KeisukeYamashita/create-comment@v1 |
|||
with: |
|||
comment: |
|||
"Porting is started. Check logs: https://github.com/${{ github.repository |
|||
}}/actions/runs/${{ github.run_id }}" |
|||
- name: Checkout DINAR |
|||
uses: actions/checkout@v2 |
|||
with: |
|||
path: DINAR |
|||
repository: itpp-labs/DINAR-fork |
|||
ref: master |
|||
- uses: actions/setup-python@v2 |
|||
with: |
|||
python-version: "3.7.x" |
|||
- name: Install python tools |
|||
run: | |
|||
pip install plumbum pre-commit git-aggregator |
|||
- name: Check Python Version |
|||
run: |
|||
echo "PY=$(python --version --version | sha256sum | cut -d' ' -f1)" >> |
|||
$GITHUB_ENV |
|||
- name: Analyze request |
|||
env: |
|||
TITLE: ${{ github.event.issue.title }} |
|||
run: | |
|||
# sets environment variables that available in next steps via $ {{ env.PORT_... }} notation |
|||
python DINAR/workflow-files/analyze_port_trigger.py "$TITLE" |
|||
- name: Checkout Repo |
|||
uses: actions/checkout@v2 |
|||
with: |
|||
path: REPO |
|||
fetch-depth: 0 |
|||
ref: ${{ env.PORT_TO_BRANCH }} |
|||
- uses: actions/cache@v1 |
|||
with: |
|||
path: ~/.cache/pre-commit |
|||
key: pre-commit|${{ env.PY }}|${{ hashFiles('REPO/.pre-commit-config.yaml') }} |
|||
- name: Copy module to new branch |
|||
run: | |
|||
git config --global user.email "itpp-bot@users.noreply.github.com" |
|||
git config --global user.name "Mitchell Admin" |
|||
cd REPO |
|||
if [ ! -d ${{ env.PORT_MODULE }} ] |
|||
then |
|||
# apply original commit history |
|||
if ! git format-patch --keep-subject --stdout origin/${{ env.PORT_TO_BRANCH }}..origin/${{ env.PORT_FROM_BRANCH }} -- ${{ env.PORT_MODULE }} | git am -3 --keep |
|||
then |
|||
# git am failed |
|||
git am --abort |
|||
|
|||
# just copy source |
|||
git checkout origin/${{ env.PORT_FROM_BRANCH }} -- ${{ env.PORT_MODULE }} |
|||
git commit -m ":tada:${{ env.PORT_FROM_BRANCH_TAGS }} ${{ env.PORT_MODULE }} |
|||
previous commits history: https://github.com/${{ github.repository }}/commits/${{ env.PORT_FROM_BRANCH }}/${{ env.PORT_MODULE }} |
|||
|
|||
> Made via .github/workflows/DINAR-PORT.yml" |
|||
fi |
|||
fi |
|||
- name: make OCA/odoo-module-migrator |
|||
run: | |
|||
gitaggregate -c DINAR/workflow-files/odoo-module-migrator-mix.yml |
|||
pip install -e ./odoo-module-migrator |
|||
- name: apply OCA/odoo-module-migrator |
|||
run: | |
|||
LOG_FILE=../odoo-module-migrator.logs |
|||
cd REPO |
|||
odoo-module-migrate \ |
|||
--modules ${{ env.PORT_MODULE }} \ |
|||
--init-version-name ${{ env.PORT_FROM_BRANCH }} \ |
|||
--target-version-name ${{ env.PORT_TO_BRANCH }} \ |
|||
--no-commit \ |
|||
--no-pre-commit \ |
|||
2> $LOG_FILE || true |
|||
cat $LOG_FILE |
|||
|
|||
# remove colors |
|||
sed -r -i "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g" $LOG_FILE |
|||
# escape character |
|||
# TODO: update KeisukeYamashita/create-comment to support reading comment's body from file |
|||
echo 'MIGRATOR_LOGS<<EOF' >> $GITHUB_ENV |
|||
cat $LOG_FILE >> $GITHUB_ENV |
|||
echo 'EOF' >> $GITHUB_ENV |
|||
|
|||
git add -A |
|||
git commit -m ":arrow_up:${{ env.PORT_TO_BRANCH_TAGS }} OCA/odoo-module-migrator |
|||
|
|||
close #${{ github.event.issue.number }} |
|||
|
|||
> Made via .github/workflows/DINAR-PORT.yml" |
|||
- name: pre-commit |
|||
run: | |
|||
cd REPO |
|||
pre-commit run --files $(find ${{ env.PORT_MODULE }} -type f) || true |
|||
git add -A |
|||
git commit -m ":rainbow: pre-commit |
|||
> Made via .github/workflows/DINAR-PORT.yml" || echo "pre-commit: no changes" |
|||
- name: PR |
|||
uses: peter-evans/create-pull-request@v3 |
|||
id: cpr |
|||
with: |
|||
path: REPO |
|||
# GITHUB_TOKEN would not trigger PR checks |
|||
token: ${{ secrets.DINAR_TOKEN }} |
|||
branch: ${{ env.PORT_TO_BRANCH }}-${{ env.PORT_MODULE }} |
|||
title: "[${{ env.PORT_TO_BRANCH }}] ${{ env.PORT_MODULE }}" |
|||
body: | |
|||
Made by [DINAR](https://github.com/itpp-labs/DINAR#readme) by request in #${{ github.event.issue.number }} |
|||
- name: Post logs |
|||
uses: KeisukeYamashita/create-comment@v1 |
|||
with: |
|||
number: ${{ steps.cpr.outputs.pull-request-number }} |
|||
comment: | |
|||
[Migrator](https://github.com/OCA/odoo-module-migrator/)'s [logs](https://github.com/${{ github.repository |
|||
}}/actions/runs/${{ github.run_id }}): |
|||
|
|||
``` |
|||
${{ env.MIGRATOR_LOGS }} |
|||
``` |
@ -1,264 +0,0 @@ |
|||
# Copyright 2020 IT Projects Labs |
|||
# |
|||
# Licensed under the Apache License, Version 2.0 (the "License"); |
|||
# you may not use this file except in compliance with the License. |
|||
# You may obtain a copy of the License at |
|||
# |
|||
# http://www.apache.org/licenses/LICENSE-2.0 |
|||
# |
|||
# Unless required by applicable law or agreed to in writing, software |
|||
# distributed under the License is distributed on an "AS IS" BASIS, |
|||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|||
# See the License for the specific language governing permissions and |
|||
# limitations under the License. |
|||
name: "DINAR" |
|||
|
|||
on: |
|||
pull_request: |
|||
|
|||
jobs: |
|||
pre-commit: |
|||
name: "pre-commit" |
|||
# Let Quick Review/Tests run first |
|||
needs: |
|||
- review |
|||
- tests |
|||
runs-on: ubuntu-latest |
|||
steps: |
|||
- name: Checkout Repo |
|||
uses: actions/checkout@v2 |
|||
- uses: actions/setup-python@v1 |
|||
with: |
|||
python-version: "3.7.x" |
|||
- name: Check Python Version |
|||
run: |
|||
echo "PY=$(python --version --version | sha256sum | cut -d' ' -f1)" >> |
|||
$GITHUB_ENV |
|||
- uses: actions/cache@v1 |
|||
with: |
|||
path: ~/.cache/pre-commit |
|||
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} |
|||
- uses: pre-commit/action@v1.0.1 |
|||
|
|||
review: |
|||
name: "Quick Review" |
|||
runs-on: ubuntu-latest |
|||
steps: |
|||
- name: Checkout Repo |
|||
uses: actions/checkout@v2 |
|||
with: |
|||
path: REPO |
|||
- name: Checkout DINAR |
|||
uses: actions/checkout@v2 |
|||
with: |
|||
path: DINAR |
|||
repository: itpp-labs/DINAR-fork |
|||
ref: master |
|||
- uses: actions/setup-python@v1 |
|||
with: |
|||
python-version: "3.7.x" |
|||
- name: Install python tools |
|||
run: | |
|||
pip install plumbum PyGithub pyyaml |
|||
- name: Analyze PR |
|||
run: | |
|||
# sets environment variables that available in next steps via $ {{ env.PR_... }} notation |
|||
cd REPO |
|||
python ../DINAR/workflow-files/analyze-modules.py updated ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${{ github.event.number }} |
|||
- name: Configure docker |
|||
run: | |
|||
bash DINAR/workflow-files/configure-docker.sh ${{ secrets.DINAR_TOKEN || secrets.GITHUB_TOKEN }} |
|||
echo "PR_FILES=../../REPO" >> $GITHUB_ENV |
|||
- name: HOW TO RUN ODOO LOCALLY |
|||
if: always() |
|||
run: | |
|||
export MODULES=${{ env.PR_MODULES }} |
|||
export LOAD_MODULES=${{ env.PR_MODULES_LOAD }} |
|||
export PR_NUM=${{ github.event.number }} |
|||
export VERSION=${{ github.event.pull_request.base.ref }} |
|||
export REVISION_PR=${{ github.event.pull_request.head.sha}} |
|||
export DINAR_REPO="itpp-labs/DINAR-fork" |
|||
bash DINAR/workflow-files/how-to-run-locally.sh |
|||
- name: Check Python Version |
|||
run: |
|||
echo "PY=$(python --version --version | sha256sum | cut -d' ' -f1)" >> |
|||
$GITHUB_ENV |
|||
- uses: actions/cache@v1 |
|||
with: |
|||
path: ~/.cache/pre-commit |
|||
key: pre-commit|${{ env.PY }}|${{ hashFiles('REPO/.pre-commit-config.yaml') }} |
|||
- name: Install pre-commit |
|||
run: | |
|||
pip install pre-commit |
|||
- name: PRE-COMMIT against updated files only |
|||
run: | |
|||
cd REPO |
|||
git fetch origin ${{ github.event.pull_request.base.ref }} |
|||
echo "CHANGED FILES:" |
|||
git diff --name-only --no-ext-diff FETCH_HEAD..HEAD -- . |
|||
echo "RUN PRE-COMMIT:" |
|||
pre-commit run --show-diff-on-failure --color=always --show-diff-on-failure --files $(git diff --name-only --no-ext-diff FETCH_HEAD..HEAD -- .) |
|||
|
|||
tests: |
|||
name: "Quick Tests" |
|||
runs-on: ubuntu-latest |
|||
steps: |
|||
- name: Checkout Repo |
|||
uses: actions/checkout@v2 |
|||
with: |
|||
path: REPO |
|||
- name: Checkout DINAR |
|||
uses: actions/checkout@v2 |
|||
with: |
|||
path: DINAR |
|||
repository: itpp-labs/DINAR-fork |
|||
ref: master |
|||
- name: Configure docker |
|||
run: | |
|||
bash DINAR/workflow-files/configure-docker.sh ${{ secrets.DINAR_TOKEN || secrets.GITHUB_TOKEN }} |
|||
echo "PR_FILES=../../REPO" >> $GITHUB_ENV |
|||
- name: Install python tools |
|||
run: | |
|||
pip install plumbum PyGithub pyyaml |
|||
- name: Download Docker images with preinstalled modules |
|||
run: | |
|||
docker-compose -p DINAR -f DINAR/workflow-files/docker-compose-DINAR-pr.yml config |
|||
docker-compose -p DINAR -f DINAR/workflow-files/docker-compose-DINAR-pr.yml pull |
|||
docker-compose -p DINAR -f DINAR/workflow-files/docker-compose-DINAR-pr.yml up --no-start |
|||
- name: Analyze PR |
|||
run: | |
|||
# Get list of installed modules |
|||
ODOO_BASE_MODULES=$(docker inspect \ |
|||
--format '{{ index .Config.Labels "dinar.odoo.modules"}}' \ |
|||
dinar_odoo_1) |
|||
echo "ODOO_BASE_MODULES=$ODOO_BASE_MODULES" |
|||
|
|||
# sets environment variables that available in next steps via $ {{ env.PR_... }} notation |
|||
cd REPO |
|||
python ../DINAR/workflow-files/analyze-modules.py updated ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${{ github.event.number }} $ODOO_BASE_MODULES |
|||
- name: Install json parser |
|||
run: | |
|||
sudo apt-get install jq |
|||
- name: Install Additional Dependencies (Modules) |
|||
if: env.PR_MODULES_DEPS != '' |
|||
run: | |
|||
# Install new dependencies without tests |
|||
export MODULES="${{ env.PR_MODULES_DEPS }}" |
|||
export LOAD_MODULES="${{ env.PR_MODULES_LOAD }}" |
|||
docker-compose -p DINAR -f DINAR/workflow-files/docker-compose-DINAR-pr.yml config |
|||
docker-compose -p DINAR -f DINAR/workflow-files/docker-compose-DINAR-pr.yml up --abort-on-container-exit |
|||
- name: Install Additional Dependencies (Packages) |
|||
if: env.PR_DEPS != '' |
|||
run: | |
|||
# TODO https://github.com/itpp-labs/DINAR/issues/42 |
|||
exit 1 |
|||
- name: Prepare Artifact Folder |
|||
run: | |
|||
mkdir new-deps/ |
|||
# create dummy file to be sure that Artifact will be uploaded |
|||
echo ok > new-deps/.empty |
|||
echo "ARTIFACT=empty" >> $GITHUB_ENV |
|||
- name: Prepare DINAR with additional dependencies |
|||
if: env.PR_MODULES_DEPS != '' || env.PR_DEPS != '' |
|||
run: | |
|||
# Save artifacts for local run and for integrations Tests |
|||
bash DINAR/workflow-files/save-docker-layers.sh new-deps/ |
|||
echo "${{ env.PR_MODULES_DEPS }}" > new-deps/modules.txt |
|||
echo "ARTIFACT=yes" >> $GITHUB_ENV |
|||
- name: Save DINAR with dependencies |
|||
uses: actions/upload-artifact@v1 |
|||
with: |
|||
name: new-deps |
|||
path: new-deps/ |
|||
- name: HOW TO RUN QUICK TESTS LOCALLY |
|||
if: always() |
|||
run: | |
|||
export MODULES=${{ env.PR_MODULES }} |
|||
export LOAD_MODULES=${{ env.PR_MODULES_LOAD }} |
|||
export PR_NUM=${{ github.event.number }} |
|||
export VERSION=${{ github.event.pull_request.base.ref }} |
|||
export REVISION_PR=${{ github.event.pull_request.head.sha}} |
|||
export DINAR_REPO="itpp-labs/DINAR-fork" |
|||
export ODOO_EXTRA_ARG=--test-enable |
|||
bash DINAR/workflow-files/how-to-run-locally.sh ${{ secrets.GITHUB_TOKEN }} |
|||
- name: Test updated modules |
|||
if: env.PR_MODULES != '' |
|||
run: | |
|||
export MODULES="${{ env.PR_MODULES }}" |
|||
export LOAD_MODULES="${{ env.PR_MODULES_LOAD }}" |
|||
export ODOO_EXTRA_ARG=--test-enable |
|||
docker-compose -p DINAR -f DINAR/workflow-files/docker-compose-DINAR-pr.yml config |
|||
docker-compose -p DINAR -f DINAR/workflow-files/docker-compose-DINAR-pr.yml up --abort-on-container-exit |
|||
|
|||
tests-all: |
|||
name: Integration Tests |
|||
# Let Quick Review/Tests run first |
|||
# This job uses artifacts from "Quick Tests" |
|||
needs: |
|||
- tests |
|||
- review |
|||
runs-on: ubuntu-latest |
|||
steps: |
|||
- name: Checkout Repo |
|||
uses: actions/checkout@v2 |
|||
with: |
|||
path: REPO |
|||
- name: Checkout DINAR |
|||
uses: actions/checkout@v2 |
|||
with: |
|||
path: DINAR |
|||
repository: itpp-labs/DINAR-fork |
|||
ref: master |
|||
- name: Install python tools |
|||
run: | |
|||
pip install plumbum pyyaml |
|||
- name: Download Additional Dependencies artifact |
|||
uses: actions/download-artifact@v1 |
|||
with: |
|||
name: new-deps |
|||
path: new-deps/ |
|||
- name: Check artifact |
|||
run: | |
|||
if [ ! -f new-deps/modules.txt ]; then |
|||
echo "ARTIFACT=empty" >> $GITHUB_ENV |
|||
fi |
|||
- name: Configure Docker |
|||
run: | |
|||
bash DINAR/workflow-files/configure-docker.sh ${{ secrets.DINAR_TOKEN || secrets.GITHUB_TOKEN }} |
|||
echo "PR_FILES=../../REPO" >> $GITHUB_ENV |
|||
- name: Analyze PR |
|||
run: | |
|||
# sets environment variables that available in next steps via $ {{ env.PR_... }} notation |
|||
DEPS_MODULES=$(cat new-deps/modules.txt || true) |
|||
cd REPO |
|||
python ../DINAR/workflow-files/analyze-modules.py all "$DEPS_MODULES" |
|||
- name: Install json parser |
|||
run: | |
|||
sudo apt-get install jq |
|||
- name: HOW TO RUN TESTS LOCALLY |
|||
if: always() |
|||
run: | |
|||
export MODULES=${{ env.ALL_MODULES }} |
|||
export LOAD_MODULES=${{ env.ALL_MODULES_LOAD }} |
|||
export PR_NUM=${{ github.event.number }} |
|||
export VERSION=${{ github.event.pull_request.base.ref }} |
|||
export REVISION_PR=${{ github.event.pull_request.head.sha}} |
|||
export DINAR_REPO="itpp-labs/DINAR-fork" |
|||
export ODOO_EXTRA_ARG=--test-enable |
|||
bash DINAR/workflow-files/how-to-run-locally.sh ${{ secrets.GITHUB_TOKEN }} |
|||
- name: Download base images |
|||
run: | |
|||
docker-compose -p DINAR -f DINAR/workflow-files/docker-compose-DINAR-pr.yml config |
|||
docker-compose -p DINAR -f DINAR/workflow-files/docker-compose-DINAR-pr.yml pull |
|||
docker-compose -p DINAR -f DINAR/workflow-files/docker-compose-DINAR-pr.yml up --no-start |
|||
- name: Apply new-deps artifact |
|||
if: env.ARTIFACT != 'empty' |
|||
run: | |
|||
bash DINAR/workflow-files/load-docker-layers.sh new-deps/ |
|||
- name: Test all modules |
|||
run: | |
|||
export MODULES="${{ env.ALL_MODULES }}" |
|||
export LOAD_MODULES="${{ env.ALL_MODULES_LOAD }}" |
|||
export ODOO_EXTRA_ARG=--test-enable |
|||
docker-compose -p DINAR -f DINAR/workflow-files/docker-compose-DINAR-pr.yml config |
|||
docker-compose -p DINAR -f DINAR/workflow-files/docker-compose-DINAR-pr.yml up --abort-on-container-exit |
@ -1,116 +0,0 @@ |
|||
# Copyright 2020 IT Projects Labs |
|||
# |
|||
# Licensed under the Apache License, Version 2.0 (the "License"); |
|||
# you may not use this file except in compliance with the License. |
|||
# You may obtain a copy of the License at |
|||
# |
|||
# http://www.apache.org/licenses/LICENSE-2.0 |
|||
# |
|||
# Unless required by applicable law or agreed to in writing, software |
|||
# distributed under the License is distributed on an "AS IS" BASIS, |
|||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|||
# See the License for the specific language governing permissions and |
|||
# limitations under the License. |
|||
name: "DINAR: Docker Image Building" |
|||
|
|||
on: |
|||
push: |
|||
paths: |
|||
- ".DINAR/**" |
|||
- ".github/workflows/DINAR.yml" |
|||
|
|||
# Cron works only for defaul branch. See https://github.com/itpp-labs/DINAR/issues/48 |
|||
schedule: |
|||
- cron: "5 5 * * 0" |
|||
|
|||
jobs: |
|||
check-secret: |
|||
runs-on: ubuntu-latest |
|||
steps: |
|||
- name: Check that DINAR_TOKEN is set |
|||
run: | |
|||
if [ -z "${{ secrets.DINAR_TOKEN }}" ] |
|||
then |
|||
echo "DINAR_TOKEN is not set" |
|||
exit 1 |
|||
fi |
|||
|
|||
check-branch: |
|||
runs-on: ubuntu-latest |
|||
steps: |
|||
- name: Check that this branch needs docker images |
|||
run: | |
|||
REF=${GITHUB_BASE_REF:-${GITHUB_REF}} |
|||
BRANCH=${REF##*/} |
|||
CHECK=$( echo "$BRANCH" | grep -E "^(master|[0-9]+\.[0-9]+)(-dev-.+)?$" || true) |
|||
if [ -z "$CHECK" ] |
|||
then |
|||
echo "This branch is not supposed to be a target of pull requests, so docker image is not needed." |
|||
echo "For information check https://github.com/itpp-labs/DINAR/issues/60" |
|||
exit 1 |
|||
fi |
|||
|
|||
rebuild-images: |
|||
runs-on: ubuntu-latest |
|||
needs: |
|||
- check-secret |
|||
- check-branch |
|||
steps: |
|||
- name: Checkout Repo |
|||
uses: actions/checkout@v2 |
|||
with: |
|||
path: REPO |
|||
- name: Checkout DINAR |
|||
uses: actions/checkout@v2 |
|||
with: |
|||
path: DINAR |
|||
repository: itpp-labs/DINAR-fork |
|||
ref: master |
|||
- uses: actions/setup-python@v1 |
|||
with: |
|||
python-version: "3.7.x" |
|||
- name: Prepare build folder |
|||
run: | |
|||
cp -rnT DINAR/embedded-files/ REPO/ |
|||
|
|||
- name: Configure Docker |
|||
run: | |
|||
bash DINAR/workflow-files/configure-docker.sh ${{ secrets.DINAR_TOKEN }} |
|||
|
|||
cat <<- EOF > REPO/.DINAR/image/.netrc |
|||
machine github.com |
|||
login $GITHUB_ACTOR |
|||
password ${{ secrets.DINAR_TOKEN }} |
|||
EOF |
|||
- name: Build ${{ env.IMAGE_ODOO_BASE }} |
|||
uses: elgohr/Publish-Docker-Github-Action@master |
|||
env: |
|||
LOCAL_CUSTOM_DIR: ./image |
|||
AGGREGATE: true |
|||
PIP_INSTALL_ODOO: false |
|||
CLEAN: false |
|||
COMPILE: false |
|||
with: |
|||
name: ${{ env.IMAGE_ODOO_BASE }} |
|||
registry: ${{ env.REGISTRY }} |
|||
username: ${{ env.REGISTRY_USERNAME }} |
|||
password: ${{ env.REGISTRY_PASSWORD }} |
|||
buildargs: ODOO_VERSION,AGGREGATE,PIP_INSTALL_ODOO,CLEAN,COMPILE,LOCAL_CUSTOM_DIR |
|||
workdir: REPO/.DINAR/ |
|||
- name: Install python tools |
|||
run: | |
|||
pip install plumbum pyyaml |
|||
- name: Compute Modules Dependencies |
|||
run: | |
|||
# sets environment variables that available in next steps via $ {{ env.VAR_NAME }} notation |
|||
cd REPO |
|||
python ../DINAR/workflow-files/analyze-modules.py all |
|||
- name: Install Base Addons |
|||
run: | |
|||
export MODULES=$ALL_MODULES_DEPENDENCIES |
|||
|
|||
export DOODBA_WITHOUT_DEMO=all |
|||
bash DINAR/workflow-files/images-with-preinstalled-modules.sh $IMAGE_DB-nodemo $IMAGE_ODOO-nodemo |
|||
|
|||
export DOODBA_WITHOUT_DEMO=false |
|||
bash DINAR/workflow-files/images-with-preinstalled-modules.sh $IMAGE_DB $IMAGE_ODOO |
@ -1,19 +0,0 @@ |
|||
name: Telegram Notifications |
|||
|
|||
on: |
|||
issues: |
|||
types: [opened, reopened, deleted, closed] |
|||
|
|||
jobs: |
|||
notify: |
|||
runs-on: ubuntu-latest |
|||
|
|||
steps: |
|||
- name: Send notifications to Telegram |
|||
run: |
|||
curl -s -X POST https://api.telegram.org/bot${{ secrets.TELEGRAM_TOKEN |
|||
}}/sendMessage -d chat_id=${{ secrets.TELEGRAM_CHAT_ID }} -d text="${MESSAGE}" |
|||
>> /dev/null |
|||
env: |
|||
MESSAGE: |
|||
"Issue ${{ github.event.action }}: \n${{ github.event.issue.html_url }}" |
@ -0,0 +1,58 @@ |
|||
# Byte-compiled / optimized / DLL files |
|||
__pycache__/ |
|||
*.py[cod] |
|||
|
|||
# C extensions |
|||
*.so |
|||
|
|||
# Distribution / packaging |
|||
.Python |
|||
env/ |
|||
bin/ |
|||
build/ |
|||
develop-eggs/ |
|||
dist/ |
|||
eggs/ |
|||
lib64/ |
|||
parts/ |
|||
sdist/ |
|||
var/ |
|||
*.egg-info/ |
|||
.installed.cfg |
|||
*.egg |
|||
|
|||
# Installer logs |
|||
pip-log.txt |
|||
pip-delete-this-directory.txt |
|||
|
|||
# Unit test / coverage reports |
|||
htmlcov/ |
|||
.tox/ |
|||
.coverage |
|||
.cache |
|||
nosetests.xml |
|||
coverage.xml |
|||
|
|||
# Translations |
|||
*.mo |
|||
|
|||
# Pycharm |
|||
.idea |
|||
|
|||
# Mr Developer |
|||
.mr.developer.cfg |
|||
.project |
|||
.pydevproject |
|||
|
|||
# Rope |
|||
.ropeproject |
|||
|
|||
# Sphinx documentation |
|||
docs/_build/ |
|||
|
|||
# Backup files |
|||
*~ |
|||
*.swp |
|||
|
|||
# odoo |
|||
!static/lib/ |
@ -1,13 +0,0 @@ |
|||
[settings] |
|||
; see https://github.com/psf/black |
|||
multi_line_output=3 |
|||
include_trailing_comma=True |
|||
force_grid_wrap=0 |
|||
combine_as_imports=True |
|||
use_parentheses=True |
|||
line_length=88 |
|||
known_odoo=odoo |
|||
known_odoo_addons=odoo.addons |
|||
sections=FUTURE,STDLIB,THIRDPARTY,ODOO,ODOO_ADDONS,FIRSTPARTY,LOCALFOLDER |
|||
default_section=THIRDPARTY |
|||
known_third_party= |
@ -1,111 +0,0 @@ |
|||
exclude: | |
|||
(?x) |
|||
# Files and folders generated by bots, to avoid loops |
|||
^setup/|/static/description/index\.html$|/i18n/.*\.pot?$| |
|||
# Maybe reactivate this when all README files include prettier ignore tags? |
|||
^README\.md$| |
|||
# Library files can have extraneous formatting (even minimized) |
|||
/static/(src/)?lib/| |
|||
# Repos using Sphinx to generate docs don't need prettying |
|||
^docs/_templates/.*\.html$| |
|||
# You don't usually want a bot to modify your legal texts |
|||
(LICENSE.*|COPYING.*) |
|||
default_language_version: |
|||
python: python3 |
|||
node: "14.13.0" |
|||
repos: |
|||
- repo: https://github.com/myint/autoflake |
|||
rev: v1.4 |
|||
hooks: |
|||
- id: autoflake |
|||
args: ["-i", "--ignore-init-module-imports"] |
|||
- repo: https://github.com/psf/black |
|||
rev: 20.8b1 |
|||
hooks: |
|||
- id: black |
|||
- repo: https://github.com/pre-commit/mirrors-prettier |
|||
rev: v2.1.2 |
|||
hooks: |
|||
- id: prettier |
|||
name: prettier + plugin-xml |
|||
additional_dependencies: |
|||
- "prettier@2.1.2" |
|||
- "@prettier/plugin-xml@0.12.0" |
|||
args: |
|||
- --plugin=@prettier/plugin-xml |
|||
- repo: https://github.com/pre-commit/mirrors-eslint |
|||
rev: v7.8.1 |
|||
hooks: |
|||
- id: eslint |
|||
verbose: true |
|||
args: |
|||
- --color |
|||
- --fix |
|||
- repo: https://github.com/pre-commit/pre-commit-hooks |
|||
rev: v2.4.0 |
|||
hooks: |
|||
- id: trailing-whitespace |
|||
# exclude autogenerated files |
|||
exclude: /README\.rst$ |
|||
- id: end-of-file-fixer |
|||
# exclude autogenerated files |
|||
exclude: /README\.rst$ |
|||
- id: debug-statements |
|||
- id: fix-encoding-pragma |
|||
args: ["--remove"] |
|||
- id: check-case-conflict |
|||
- id: check-docstring-first |
|||
- id: check-executables-have-shebangs |
|||
- id: check-merge-conflict |
|||
- id: check-symlinks |
|||
- id: check-xml |
|||
- id: mixed-line-ending |
|||
args: ["--fix=lf"] |
|||
- repo: https://github.com/PyCQA/pylint |
|||
rev: pylint-2.5.3 |
|||
hooks: |
|||
- id: pylint |
|||
name: pylint with optional checks |
|||
args: ["--rcfile=.pylintrc", "--exit-zero"] |
|||
verbose: true |
|||
additional_dependencies: &pylint_deps |
|||
- pylint-odoo==3.5.0 |
|||
- id: pylint |
|||
name: pylint with mandatory checks |
|||
args: ["--rcfile=.pylintrc-mandatory"] |
|||
additional_dependencies: *pylint_deps |
|||
- repo: https://github.com/asottile/pyupgrade |
|||
rev: v1.26.2 |
|||
hooks: |
|||
- id: pyupgrade |
|||
args: ["--keep-percent-format"] |
|||
- repo: https://github.com/acsone/setuptools-odoo |
|||
rev: 2.6.0 |
|||
hooks: |
|||
- id: setuptools-odoo-make-default |
|||
- id: setuptools-odoo-get-requirements |
|||
args: |
|||
- --output |
|||
- requirements.txt |
|||
- --header |
|||
- "# generated from manifests external_dependencies" |
|||
- repo: https://gitlab.com/PyCQA/flake8 |
|||
rev: 3.8.3 |
|||
hooks: |
|||
- id: flake8 |
|||
name: flake8 except __init__.py |
|||
exclude: /__init__\.py$ |
|||
additional_dependencies: ["flake8-bugbear==20.1.4"] |
|||
- id: flake8 |
|||
name: flake8 only __init__.py |
|||
args: ["--extend-ignore=F401"] # ignore unused imports in __init__.py |
|||
files: /__init__\.py$ |
|||
additional_dependencies: ["flake8-bugbear==20.1.4"] |
|||
- repo: https://github.com/PyCQA/isort |
|||
rev: 5.5.1 |
|||
hooks: |
|||
- id: isort |
|||
name: isort except __init__.py |
|||
args: |
|||
- --settings=. |
|||
exclude: /__init__\.py$ |
@ -1,8 +0,0 @@ |
|||
# 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" |
@ -1,86 +0,0 @@ |
|||
[MASTER] |
|||
load-plugins=pylint_odoo |
|||
score=n |
|||
|
|||
[ODOOLINT] |
|||
readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst" |
|||
manifest_required_authors=IT Projects Labs |
|||
manifest_required_keys=license |
|||
manifest_deprecated_keys=description,active |
|||
license_allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3,MIT,Other OSI approved licence,OPL-1 |
|||
valid_odoo_versions=14.0 |
|||
|
|||
[MESSAGES CONTROL] |
|||
disable=all |
|||
|
|||
# This .pylintrc contains optional AND mandatory checks and is meant to be |
|||
# loaded in an IDE to have it check everything, in the hope this will make |
|||
# optional checks more visible to contributors who otherwise never look at a |
|||
# green travis to see optional checks that failed. |
|||
# .pylintrc-mandatory containing only mandatory checks is used the pre-commit |
|||
# config as a blocking check. |
|||
|
|||
enable=anomalous-backslash-in-string, |
|||
api-one-deprecated, |
|||
api-one-multi-together, |
|||
assignment-from-none, |
|||
attribute-deprecated, |
|||
class-camelcase, |
|||
dangerous-default-value, |
|||
dangerous-view-replace-wo-priority, |
|||
duplicate-id-csv, |
|||
duplicate-key, |
|||
duplicate-xml-fields, |
|||
duplicate-xml-record-id, |
|||
eval-referenced, |
|||
eval-used, |
|||
incoherent-interpreter-exec-perm, |
|||
license-allowed, |
|||
manifest-author-string, |
|||
manifest-deprecated-key, |
|||
#manifest-required-author, |
|||
manifest-required-key, |
|||
manifest-version-format, |
|||
method-compute, |
|||
method-inverse, |
|||
method-required-super, |
|||
method-search, |
|||
missing-manifest-dependency, |
|||
openerp-exception-warning, |
|||
pointless-statement, |
|||
pointless-string-statement, |
|||
print-used, |
|||
redundant-keyword-arg, |
|||
redundant-modulename-xml, |
|||
reimported, |
|||
relative-import, |
|||
return-in-init, |
|||
rst-syntax-error, |
|||
sql-injection, |
|||
too-few-format-args, |
|||
translation-field, |
|||
translation-required, |
|||
unreachable, |
|||
use-vim-comment, |
|||
wrong-tabs-instead-of-spaces, |
|||
xml-syntax-error, |
|||
# messages that do not cause the lint step to fail |
|||
consider-merging-classes-inherited, |
|||
create-user-wo-reset-password, |
|||
dangerous-filter-wo-user, |
|||
deprecated-module, |
|||
file-not-used, |
|||
invalid-commit, |
|||
missing-newline-extrafiles, |
|||
missing-readme, |
|||
no-utf8-coding-comment, |
|||
odoo-addons-relative-import, |
|||
old-api7-method-defined, |
|||
redefined-builtin, |
|||
too-complex, |
|||
unnecessary-utf8-coding-comment |
|||
|
|||
[REPORTS] |
|||
msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg} |
|||
output-format=colorized |
|||
reports=no |
@ -1,65 +0,0 @@ |
|||
[MASTER] |
|||
load-plugins=pylint_odoo |
|||
score=n |
|||
|
|||
[ODOOLINT] |
|||
readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst" |
|||
manifest_required_authors=IT Projects Labs |
|||
manifest_required_keys=license |
|||
manifest_deprecated_keys=description,active |
|||
license_allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3,MIT,Other OSI approved licence,OPL-1 |
|||
valid_odoo_versions=14.0 |
|||
|
|||
[MESSAGES CONTROL] |
|||
disable=all |
|||
|
|||
enable=anomalous-backslash-in-string, |
|||
api-one-deprecated, |
|||
api-one-multi-together, |
|||
assignment-from-none, |
|||
attribute-deprecated, |
|||
class-camelcase, |
|||
dangerous-default-value, |
|||
dangerous-view-replace-wo-priority, |
|||
duplicate-id-csv, |
|||
duplicate-key, |
|||
duplicate-xml-fields, |
|||
duplicate-xml-record-id, |
|||
eval-referenced, |
|||
eval-used, |
|||
incoherent-interpreter-exec-perm, |
|||
license-allowed, |
|||
manifest-author-string, |
|||
manifest-deprecated-key, |
|||
#manifest-required-author, |
|||
manifest-required-key, |
|||
manifest-version-format, |
|||
method-compute, |
|||
method-inverse, |
|||
method-required-super, |
|||
method-search, |
|||
missing-import-error, |
|||
missing-manifest-dependency, |
|||
openerp-exception-warning, |
|||
pointless-statement, |
|||
pointless-string-statement, |
|||
print-used, |
|||
redundant-keyword-arg, |
|||
redundant-modulename-xml, |
|||
reimported, |
|||
relative-import, |
|||
return-in-init, |
|||
rst-syntax-error, |
|||
sql-injection, |
|||
too-few-format-args, |
|||
translation-field, |
|||
translation-required, |
|||
unreachable, |
|||
use-vim-comment, |
|||
wrong-tabs-instead-of-spaces, |
|||
xml-syntax-error |
|||
|
|||
[REPORTS] |
|||
msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg} |
|||
output-format=colorized |
|||
reports=no |
@ -0,0 +1,38 @@ |
|||
language: python |
|||
|
|||
python: |
|||
- "2.7" |
|||
|
|||
sudo: false |
|||
cache: pip |
|||
|
|||
addons: |
|||
postgresql: "9.5" |
|||
apt: |
|||
packages: |
|||
- expect-dev # provides unbuffer utility |
|||
- python-lxml # because pip installation is slow |
|||
|
|||
env: |
|||
- VERSION="8.0" LINT_CHECK="1" |
|||
- VERSION="8.0" ODOO_REPO="odoo/odoo" LINT_CHECK="0" |
|||
- VERSION="8.0" ODOO_REPO="OCA/OCB" LINT_CHECK="0" |
|||
- VERSION="8.0" UNIT_TEST="1" LINT_CHECK="0" |
|||
|
|||
virtualenv: |
|||
system_site_packages: true |
|||
|
|||
install: |
|||
- pip install anybox.testing.openerp |
|||
- git clone https://github.com/it-projects-llc/maintainer-quality-tools.git ${HOME}/maintainer-quality-tools |
|||
- export PATH=${HOME}/maintainer-quality-tools/travis:${PATH} |
|||
- travis_install_nightly |
|||
|
|||
script: |
|||
- travis_run_tests |
|||
|
|||
after_success: |
|||
coveralls |
|||
|
|||
notifications: |
|||
email: false |
@ -0,0 +1,166 @@ |
|||
GNU LESSER GENERAL PUBLIC LICENSE |
|||
Version 3, 29 June 2007 |
|||
|
|||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> |
|||
Everyone is permitted to copy and distribute verbatim copies |
|||
of this license document, but changing it is not allowed. |
|||
|
|||
|
|||
This version of the GNU Lesser General Public License incorporates |
|||
the terms and conditions of version 3 of the GNU General Public |
|||
License, supplemented by the additional permissions listed below. |
|||
|
|||
0. Additional Definitions. |
|||
|
|||
As used herein, "this License" refers to version 3 of the GNU Lesser |
|||
General Public License, and the "GNU GPL" refers to version 3 of the GNU |
|||
General Public License. |
|||
|
|||
"The Library" refers to a covered work governed by this License, |
|||
other than an Application or a Combined Work as defined below. |
|||
|
|||
An "Application" is any work that makes use of an interface provided |
|||
by the Library, but which is not otherwise based on the Library. |
|||
Defining a subclass of a class defined by the Library is deemed a mode |
|||
of using an interface provided by the Library. |
|||
|
|||
A "Combined Work" is a work produced by combining or linking an |
|||
Application with the Library. The particular version of the Library |
|||
with which the Combined Work was made is also called the "Linked |
|||
Version". |
|||
|
|||
The "Minimal Corresponding Source" for a Combined Work means the |
|||
Corresponding Source for the Combined Work, excluding any source code |
|||
for portions of the Combined Work that, considered in isolation, are |
|||
based on the Application, and not on the Linked Version. |
|||
|
|||
The "Corresponding Application Code" for a Combined Work means the |
|||
object code and/or source code for the Application, including any data |
|||
and utility programs needed for reproducing the Combined Work from the |
|||
Application, but excluding the System Libraries of the Combined Work. |
|||
|
|||
1. Exception to Section 3 of the GNU GPL. |
|||
|
|||
You may convey a covered work under sections 3 and 4 of this License |
|||
without being bound by section 3 of the GNU GPL. |
|||
|
|||
2. Conveying Modified Versions. |
|||
|
|||
If you modify a copy of the Library, and, in your modifications, a |
|||
facility refers to a function or data to be supplied by an Application |
|||
that uses the facility (other than as an argument passed when the |
|||
facility is invoked), then you may convey a copy of the modified |
|||
version: |
|||
|
|||
a) under this License, provided that you make a good faith effort to |
|||
ensure that, in the event an Application does not supply the |
|||
function or data, the facility still operates, and performs |
|||
whatever part of its purpose remains meaningful, or |
|||
|
|||
b) under the GNU GPL, with none of the additional permissions of |
|||
this License applicable to that copy. |
|||
|
|||
3. Object Code Incorporating Material from Library Header Files. |
|||
|
|||
The object code form of an Application may incorporate material from |
|||
a header file that is part of the Library. You may convey such object |
|||
code under terms of your choice, provided that, if the incorporated |
|||
material is not limited to numerical parameters, data structure |
|||
layouts and accessors, or small macros, inline functions and templates |
|||
(ten or fewer lines in length), you do both of the following: |
|||
|
|||
a) Give prominent notice with each copy of the object code that the |
|||
Library is used in it and that the Library and its use are |
|||
covered by this License. |
|||
|
|||
b) Accompany the object code with a copy of the GNU GPL and this license |
|||
document. |
|||
|
|||
4. Combined Works. |
|||
|
|||
You may convey a Combined Work under terms of your choice that, |
|||
taken together, effectively do not restrict modification of the |
|||
portions of the Library contained in the Combined Work and reverse |
|||
engineering for debugging such modifications, if you also do each of |
|||
the following: |
|||
|
|||
a) Give prominent notice with each copy of the Combined Work that |
|||
the Library is used in it and that the Library and its use are |
|||
covered by this License. |
|||
|
|||
b) Accompany the Combined Work with a copy of the GNU GPL and this license |
|||
document. |
|||
|
|||
c) For a Combined Work that displays copyright notices during |
|||
execution, include the copyright notice for the Library among |
|||
these notices, as well as a reference directing the user to the |
|||
copies of the GNU GPL and this license document. |
|||
|
|||
d) Do one of the following: |
|||
|
|||
0) Convey the Minimal Corresponding Source under the terms of this |
|||
License, and the Corresponding Application Code in a form |
|||
suitable for, and under terms that permit, the user to |
|||
recombine or relink the Application with a modified version of |
|||
the Linked Version to produce a modified Combined Work, in the |
|||
manner specified by section 6 of the GNU GPL for conveying |
|||
Corresponding Source. |
|||
|
|||
1) Use a suitable shared library mechanism for linking with the |
|||
Library. A suitable mechanism is one that (a) uses at run time |
|||
a copy of the Library already present on the user's computer |
|||
system, and (b) will operate properly with a modified version |
|||
of the Library that is interface-compatible with the Linked |
|||
Version. |
|||
|
|||
e) Provide Installation Information, but only if you would otherwise |
|||
be required to provide such information under section 6 of the |
|||
GNU GPL, and only to the extent that such information is |
|||
necessary to install and execute a modified version of the |
|||
Combined Work produced by recombining or relinking the |
|||
Application with a modified version of the Linked Version. (If |
|||
you use option 4d0, the Installation Information must accompany |
|||
the Minimal Corresponding Source and Corresponding Application |
|||
Code. If you use option 4d1, you must provide the Installation |
|||
Information in the manner specified by section 6 of the GNU GPL |
|||
for conveying Corresponding Source.) |
|||
|
|||
5. Combined Libraries. |
|||
|
|||
You may place library facilities that are a work based on the |
|||
Library side by side in a single library together with other library |
|||
facilities that are not Applications and are not covered by this |
|||
License, and convey such a combined library under terms of your |
|||
choice, if you do both of the following: |
|||
|
|||
a) Accompany the combined library with a copy of the same work based |
|||
on the Library, uncombined with any other library facilities, |
|||
conveyed under the terms of this License. |
|||
|
|||
b) Give prominent notice with the combined library that part of it |
|||
is a work based on the Library, and explaining where to find the |
|||
accompanying uncombined form of the same work. |
|||
|
|||
6. Revised Versions of the GNU Lesser General Public License. |
|||
|
|||
The Free Software Foundation may publish revised and/or new versions |
|||
of the GNU Lesser General Public License from time to time. Such new |
|||
versions will be similar in spirit to the present version, but may |
|||
differ in detail to address new problems or concerns. |
|||
|
|||
Each version is given a distinguishing version number. If the |
|||
Library as you received it specifies that a certain numbered version |
|||
of the GNU Lesser General Public License "or any later version" |
|||
applies to it, you have the option of following the terms and |
|||
conditions either of that published version or of any later version |
|||
published by the Free Software Foundation. If the Library as you |
|||
received it does not specify a version number of the GNU Lesser |
|||
General Public License, you may choose any version of the GNU Lesser |
|||
General Public License ever published by the Free Software Foundation. |
|||
|
|||
If the Library as you received it specifies that a proxy can decide |
|||
whether future versions of the GNU Lesser General Public License shall |
|||
apply, that proxy's public statement of acceptance of any version is |
|||
permanent authorization for you to choose that version for the |
|||
Library. |
|||
|
@ -0,0 +1,17 @@ |
|||
.. image:: https://itpp.dev/images/infinity-readme.png |
|||
:alt: Tested and maintained by IT Projects Labs |
|||
:target: https://itpp.dev |
|||
|
|||
IM Notifications |
|||
================ |
|||
|
|||
Description: https://apps.odoo.com/apps/modules/8.0/im_notif/ |
|||
|
|||
Further information and discussion: https://yelizariev.github.io/odoo/module/2015/02/18/im-notifications.html |
|||
|
|||
Tested on `Odoo 8.0 <https://github.com/odoo/odoo/commit/ab7b5d7732a7c222a0aea45bd173742acd47242d>`_ |
|||
|
|||
Odoo 9.0+ |
|||
========= |
|||
|
|||
For newer version the module is not needed, cause there is similar built-in feature |
@ -0,0 +1,9 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from . import im_notif_models |
|||
|
|||
|
|||
def pre_uninstall(cr, registry): |
|||
query = ("UPDATE res_partner " |
|||
"SET notify_email = 'always' " |
|||
"WHERE notify_email LIKE 'im%';") |
|||
cr.execute(query) |
@ -0,0 +1,17 @@ |
|||
# -*- coding: utf-8 -*- |
|||
{ |
|||
'name': 'IM Notifications', |
|||
'version': '1.0.1', |
|||
'author': 'IT-Projects LLC, Ivan Yelizariev', |
|||
'license': 'GPL-3', |
|||
'category': 'Tools', |
|||
'website': 'https://twitter.com/yelizariev', |
|||
'depends': ['im_chat', 'mail'], |
|||
'images': ['images/my-pref.png'], |
|||
'data': [ |
|||
'im_notif_data.xml', |
|||
'im_notif_views.xml', |
|||
], |
|||
'installable': True, |
|||
'uninstall_hook': 'pre_uninstall', |
|||
} |
@ -0,0 +1,4 @@ |
|||
`1.0.1` |
|||
------- |
|||
|
|||
- Hide Notifications user |
@ -0,0 +1,19 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<openerp> |
|||
<data> |
|||
<record id="notif_partner" model="res.partner"> |
|||
<field name="name">Notifications</field> |
|||
<field name="active" eval="False"/> |
|||
<field name="comment">Technical profile. You should not delete it.</field> |
|||
</record> |
|||
<record id="notif_user" model="res.users"> |
|||
<field name="name">Notifications</field> |
|||
<field name="login">notifications</field> |
|||
<field name="password"></field> |
|||
<field name="groups_id" eval="[(6,0,[ref('base.group_user')])]"/> |
|||
<!--<field name="image" type="base64" file="base/static/img/public_user-image.png"/>--> |
|||
<field name="partner_id" ref="notif_partner"/> |
|||
<field name="active" eval="True"/> |
|||
</record> |
|||
</data> |
|||
</openerp> |
@ -0,0 +1,160 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from openerp import SUPERUSER_ID |
|||
from openerp import models |
|||
from openerp import tools |
|||
from openerp.osv import fields as old_fields |
|||
|
|||
|
|||
class ResPartner(models.Model): |
|||
_inherit = 'res.partner' |
|||
_columns = { |
|||
'notify_email': old_fields.selection([ |
|||
('none', 'Never'), |
|||
('im', 'Only IM (if online)'), |
|||
('im_xor_email', 'IM (if online) + email (if offline)'), |
|||
('im_and_email', 'IM (if online) + email'), |
|||
('always', 'Only emails'), |
|||
], 'Receive Inbox Notifications by Email, IM', required=True, |
|||
oldname='notification_email_send', |
|||
help="Policy to receive emails, IM for new messages pushed to your personal Inbox. IM can be used only for partners with odoo user account" |
|||
), |
|||
} |
|||
|
|||
|
|||
class MailNotification(models.Model): |
|||
_inherit = 'mail.notification' |
|||
|
|||
def get_recipients(self, cr, uid, ids, message, context=None): |
|||
# based on addons/mail/mail_followers.py::get_partners_to_email |
|||
""" Return the list of partners to notify, based on their preferences. |
|||
|
|||
:param browse_record message: mail.message to notify |
|||
:param list partners_to_notify: optional list of partner ids restricting |
|||
the notifications to process |
|||
""" |
|||
email_pids = [] |
|||
im_uids = [] |
|||
for notification in self.browse(cr, uid, ids, context=context): |
|||
if notification.is_read: |
|||
continue |
|||
partner = notification.partner_id |
|||
# Do not send to partners without email address defined |
|||
if not partner.email: |
|||
continue |
|||
# Do not send to partners having same email address than the author (can cause loops or bounce effect due to messy database) |
|||
if message.author_id and message.author_id.email == partner.email: |
|||
continue |
|||
# Partner does not want to receive any emails or is opt-out |
|||
n = partner.notify_email |
|||
if n == 'none': |
|||
continue |
|||
if n == 'always': |
|||
email_pids.append(partner.id) |
|||
continue |
|||
send_email = False |
|||
for user in partner.user_ids: |
|||
if user.im_status == 'offline': |
|||
if n != 'im': |
|||
send_email = True |
|||
else: |
|||
im_uids.append(user.id) |
|||
if n == 'im_and_email': |
|||
send_email = True |
|||
|
|||
if not len(partner.user_ids): |
|||
# send notification to partner, that doesn't have odoo account, but has "im*" value in notify_email |
|||
send_email = True |
|||
|
|||
if send_email: |
|||
email_pids.append(partner.id) |
|||
|
|||
return email_pids, im_uids |
|||
|
|||
def _message2im(self, cr, uid, message): |
|||
inbox_action = self.pool['ir.model.data'].xmlid_to_res_id(cr, SUPERUSER_ID, 'mail.mail_inboxfeeds') |
|||
inbox_url = '#menu_id=%s' % inbox_action |
|||
url = None |
|||
if message.res_id: |
|||
url = '#id=%s&model=%s&view_type=form' % ( |
|||
message.res_id, |
|||
message.model |
|||
) |
|||
author = message.author_id and message.author_id.name_get() |
|||
author = author and author[0][1] or message.email_from |
|||
|
|||
about = message.subject or message.record_name or 'UNDEFINED' |
|||
about = '[ABOUT] %s' % about |
|||
if url: |
|||
about = '<a href="%s">%s</a>' % (url, about) |
|||
im_text = [ |
|||
'_____________________', |
|||
'<a href="%s">_____[open_inbox]_____</a>' % inbox_url, |
|||
'%s [FROM] %s' % (message.type, author), |
|||
about, |
|||
] |
|||
# im_text = im_text + body.split('\n') |
|||
return im_text |
|||
|
|||
def _notify_email(self, cr, uid, ids, message_id, force_send=False, user_signature=True, context=None): |
|||
# based on addons/mail/mail_followers.py::_notify_email |
|||
message = self.pool['mail.message'].browse(cr, SUPERUSER_ID, message_id, context=context) |
|||
|
|||
# compute partners |
|||
email_pids, im_uids = self.get_recipients(cr, uid, ids, message, context=None) |
|||
if email_pids: |
|||
self._do_notify_email(cr, uid, email_pids, message, force_send, user_signature, context) |
|||
|
|||
if im_uids: |
|||
self._do_notify_im(cr, uid, im_uids, message, context) |
|||
|
|||
return True |
|||
|
|||
def _do_notify_im(self, cr, uid, im_uids, message, context=None): |
|||
im_text = self._message2im(cr, uid, message) |
|||
|
|||
user_from = self.pool['ir.model.data'].xmlid_to_res_id(cr, SUPERUSER_ID, 'im_notif.notif_user') |
|||
|
|||
session_obj = self.pool['im_chat.session'] |
|||
message_type = 'message' |
|||
for user_to in im_uids: |
|||
session = session_obj.session_get(cr, user_from, user_to, context=context) |
|||
uuid = session.get('uuid') |
|||
message_content = '\n'.join(im_text) |
|||
self.pool["im_chat.message"].post(cr, SUPERUSER_ID, user_from, uuid, message_type, message_content, context=context) |
|||
|
|||
return True |
|||
|
|||
def _do_notify_email(self, cr, uid, email_pids, message, force_send=False, user_signature=True, context=None): |
|||
|
|||
# compute email body (signature, company data) |
|||
body_html = message.body |
|||
# add user signature except for mail groups, where users are usually adding their own signatures already |
|||
user_id = message.author_id and message.author_id.user_ids and message.author_id.user_ids[0] and message.author_id.user_ids[0].id or None |
|||
signature_company = self.get_signature_footer(cr, uid, user_id, res_model=message.model, res_id=message.res_id, context=context, user_signature=(user_signature and message.model != 'mail.group')) |
|||
if signature_company: |
|||
body_html = tools.append_content_to_html(body_html, signature_company, plaintext=False, container_tag='div') |
|||
# compute email references |
|||
references = message.parent_id.message_id if message.parent_id else False |
|||
|
|||
# custom values |
|||
custom_values = dict() |
|||
if message.model and message.res_id and self.pool.get(message.model) and hasattr(self.pool[message.model], 'message_get_email_values'): |
|||
custom_values = self.pool[message.model].message_get_email_values(cr, uid, message.res_id, message, context=context) |
|||
|
|||
# create email values |
|||
max_recipients = 50 |
|||
chunks = [email_pids[x:x + max_recipients] for x in xrange(0, len(email_pids), max_recipients)] |
|||
email_ids = [] |
|||
for chunk in chunks: |
|||
mail_values = { |
|||
'mail_message_id': message.id, |
|||
'auto_delete': True, |
|||
'body_html': body_html, |
|||
'recipient_ids': [(4, id) for id in chunk], |
|||
'references': references, |
|||
} |
|||
mail_values.update(custom_values) |
|||
email_ids.append(self.pool.get('mail.mail').create(cr, uid, mail_values, context=context)) |
|||
if force_send and len(chunks) < 2: # for more than 50 followers, use the queue system |
|||
self.pool.get('mail.mail').send(cr, uid, email_ids, context=context) |
|||
return True |
@ -0,0 +1,12 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<openerp> |
|||
<data> |
|||
<template id="assets_backend" name="im_notif assets" inherit_id="web.assets_backend"> |
|||
<xpath expr="." position="inside"> |
|||
<!--<link rel="stylesheet" href="/im_notif/static/src/css/im_notif.css"/>--> |
|||
<script type="text/javascript" src="/im_notif/static/src/js/im_notif.js"></script> |
|||
</xpath> |
|||
</template> |
|||
|
|||
</data> |
|||
</openerp> |
After Width: 748 | Height: 400 | Size: 37 KiB |
After Width: 100 | Height: 100 | Size: 3.0 KiB |
After Width: 240 | Height: 342 | Size: 28 KiB |
@ -0,0 +1,69 @@ |
|||
<section class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="oe_span12"> |
|||
<h2 class="oe_slogan">IM Notifications</h2> |
|||
<h3 class="oe_slogan">Get instant notification inside odoo</h3> |
|||
</div> |
|||
|
|||
<div class="oe_span6"> |
|||
<p class="oe_mt32"> |
|||
A user is able to select option for notifications: |
|||
|
|||
<ul class="org-ul"> |
|||
<li>Never </li> |
|||
<li>Only IM (if online) </li> |
|||
<li>IM (if online) + email (if offline) </li> |
|||
<li>IM (if online) + email </li> |
|||
<li>Only Emails </li></ul> |
|||
</p> |
|||
</div> |
|||
|
|||
<div class="oe_span6"> |
|||
<div class="oe_picture"> |
|||
<img src="my-pref-button.png"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container oe_dark"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="oe_span6"> |
|||
<p class="oe_mt32"> |
|||
Each notification includes: |
|||
<ul> |
|||
<li>Message type: email, comment or notification </li> |
|||
<li>Author's name </li> |
|||
<li>Subject with a link to related record (if exists) </li> |
|||
<li>Link to inbox </li> |
|||
</ul> |
|||
</p> |
|||
</div> |
|||
|
|||
<div class="oe_span6"> |
|||
<div class="oe_picture"> |
|||
<img src="im-chat.png?3"/> |
|||
</div> |
|||
</div> |
|||
<div class="oe_span12"> |
|||
<p class="oe_mt32"> |
|||
Further information and discussion: <a href="https://yelizariev.github.io/odoo/module/2015/02/18/im-notifications.html">https://yelizariev.github.io/odoo/module/2015/02/18/im-notifications.html</a> |
|||
</p> |
|||
</div> |
|||
|
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="oe_span12"> |
|||
<h2>Need our service?</h2> |
|||
<p class="oe_mt32">Contact us by <a href="mailto:it@it-projects.info">email</a> or fill out <a href="https://www.it-projects.info/page/website.contactus " target="_blank">request form</a></p> |
|||
<ul> |
|||
<li><a href="mailto:it@it-projects.info">it@it-projects.info <i class="fa fa-envelope-o"></i></a></li> |
|||
<li><a href="https://www.it-projects.info/page/website.contactus " target="_blank"> |
|||
https://www.it-projects.info/page/website.contactus <i class="fa fa-list-alt"></i></a></li> |
|||
</ul> |
|||
</div> |
|||
</div> |
|||
</section> |
After Width: 260 | Height: 220 | Size: 16 KiB |
@ -0,0 +1,44 @@ |
|||
(function(){ |
|||
|
|||
"use strict"; |
|||
|
|||
var _t = openerp._t; |
|||
var _lt = openerp._lt; |
|||
var QWeb = openerp.qweb; |
|||
|
|||
openerp.im_chat.Conversation.include({ |
|||
escape_keep_url: function(str){ |
|||
//var url_regex = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/gi;
|
|||
var url_regex = /((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?|(<a)[^>]*href="([^"]*)"[^>]*>([^<]*)<\/a>)/gi; |
|||
var last = 0; |
|||
var txt = ""; |
|||
while (true) { |
|||
var result = url_regex.exec(str); |
|||
if (! result) |
|||
break; |
|||
txt += _.escape(str.slice(last, result.index)); |
|||
last = url_regex.lastIndex; |
|||
var href = ''; |
|||
var content = ''; |
|||
var is_odoo_ref = false; |
|||
if (result[8]=='<a'){ |
|||
href = result[9]; |
|||
if (href[0]=='#'){ |
|||
href += '&rnd='+parseInt(Math.random()*1000); |
|||
content = result[10]; |
|||
is_odoo_ref = true; |
|||
} else { |
|||
//only internal urls are allowed
|
|||
href = ''; |
|||
} |
|||
}else{ |
|||
href = _.escape(result[0]); |
|||
content = href; |
|||
} |
|||
txt += '<a href="' + href + '"' + (is_odoo_ref?'':' target="_blank"')+'>' + content + '</a>'; |
|||
} |
|||
txt += _.escape(str.slice(last, str.length)); |
|||
return txt; |
|||
}, |
|||
}); |
|||
})(); |
@ -0,0 +1,17 @@ |
|||
.. image:: https://itpp.dev/images/infinity-readme.png |
|||
:alt: Tested and maintained by IT Projects Labs |
|||
:target: https://itpp.dev |
|||
|
|||
=================== |
|||
Show all messages |
|||
=================== |
|||
|
|||
Adds ``Messaging / All messages`` menu, that shows all messages accesable by current user |
|||
|
|||
Further information |
|||
------------------- |
|||
|
|||
Odoo Apps Store: https://apps.odoo.com/apps/modules/8.0/mail_all/ |
|||
|
|||
|
|||
Tested on `Odoo 8.0 <https://github.com/odoo/odoo/commit/0af32f3f84bae07b11abb8538d02e35c7369a348>`_ |
@ -0,0 +1,3 @@ |
|||
# -*- coding: utf-8 -*- |
|||
|
|||
from . import models |
@ -0,0 +1,26 @@ |
|||
# -*- coding: utf-8 -*- |
|||
{ |
|||
"name": "Show all messages", |
|||
"summary": """Checkout all messages where you have access""", |
|||
"category": "Discuss", |
|||
"images": ['images/1.png'], |
|||
"version": "1.0.0", |
|||
|
|||
"author": "IT-Projects LLC, Pavel Romanchenko", |
|||
"website": "https://twitter.com/OdooFree", |
|||
"license": "GPL-3", |
|||
|
|||
"depends": [ |
|||
"mail", |
|||
], |
|||
"external_dependencies": {"python": [], "bin": []}, |
|||
"data": [ |
|||
"views/templates.xml", |
|||
], |
|||
"demo": [], |
|||
"post_load": None, |
|||
"pre_init_hook": None, |
|||
"post_init_hook": None, |
|||
"installable": True, |
|||
"auto_install": False, |
|||
} |
@ -0,0 +1,7 @@ |
|||
Updates |
|||
======= |
|||
|
|||
`1.0.0` |
|||
------- |
|||
|
|||
- Init version |
@ -0,0 +1,9 @@ |
|||
=================== |
|||
Show all messages |
|||
=================== |
|||
|
|||
Usage |
|||
===== |
|||
|
|||
* Open menu ``Messaging / All messages`` |
|||
* You see all messages |
After Width: 740 | Height: 394 | Size: 96 KiB |
@ -0,0 +1 @@ |
|||
# -*- coding: utf-8 -*- |
After Width: 740 | Height: 394 | Size: 96 KiB |
After Width: 100 | Height: 100 | Size: 2.1 KiB |
@ -0,0 +1,32 @@ |
|||
<section class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="oe_span12"> |
|||
<h2 class="oe_slogan">Show all messages</h2> |
|||
<h3 class="oe_slogan">Checkout all messages where you have access</h3> |
|||
</div> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="oe_span12"> |
|||
<p class="oe_mt32"> |
|||
The module adds usual menu, that shows all messages. It differs from Arhives, because it also shows messages, which doesn't have current User as a participant. Example for Administrator: |
|||
</p> |
|||
</div> |
|||
<div class="oe_row_img oe_centered"> |
|||
<img class="oe_picture oe_screenshot" src="1.png"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="oe_span12"> |
|||
<h2>Need our service?</h2> |
|||
<p class="oe_mt32">Contact us by <a href="mailto:it@it-projects.info">email</a> or fill out <a href="https://www.it-projects.info/page/website.contactus " target="_blank">request form</a></p> |
|||
<ul> |
|||
<li><a href="mailto:it@it-projects.info">it@it-projects.info <i class="fa fa-envelope-o"></i></a></li> |
|||
<li><a href="https://www.it-projects.info/page/website.contactus " target="_blank"> |
|||
https://www.it-projects.info/page/website.contactus <i class="fa fa-list-alt"></i></a></li> |
|||
</ul> |
|||
</div> |
|||
</div> |
|||
</section> |
@ -0,0 +1,32 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<openerp> |
|||
<data> |
|||
<record id="action_mail_all_feeds" model="ir.actions.client"> |
|||
<field name="name">All messages</field> |
|||
<field name="tag">mail.wall</field> |
|||
<field name="context">{ |
|||
'default_model': 'res.users', |
|||
'default_res_id': uid, |
|||
'thread_model': 'res.partner', |
|||
'needaction_menu_ref': ['mail.mail_tomefeeds', 'mail.mail_starfeeds', 'mail.mail_inboxfeeds'] |
|||
}</field> |
|||
<field name="params" eval=""{ |
|||
'domain': [], |
|||
'view_mailbox': True, |
|||
'show_compose_message': False |
|||
}""/> |
|||
<field name="help" type="html"> |
|||
<p> |
|||
No message found. |
|||
</p> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="mail_all_feeds" model="ir.ui.menu"> |
|||
<field name="name">All messages</field> |
|||
<field name="sequence" eval="100"/> |
|||
<field name="action" ref="action_mail_all_feeds"/> |
|||
<field name="parent_id" ref="mail.mail_feeds"/> |
|||
</record> |
|||
</data> |
|||
</openerp> |
@ -0,0 +1,26 @@ |
|||
.. image:: https://itpp.dev/images/infinity-readme.png |
|||
:alt: Tested and maintained by IT Projects Labs |
|||
:target: https://itpp.dev |
|||
|
|||
=================== |
|||
Popup Attachments |
|||
=================== |
|||
|
|||
The module opens attached mail images in popup. |
|||
|
|||
Questions? |
|||
========== |
|||
|
|||
To get an assistance on this module contact us by email :arrow_right: help@itpp.dev |
|||
|
|||
Contributors |
|||
============ |
|||
* Dinar Gabbasov <gabbasov@it-projects.info> |
|||
|
|||
Further information |
|||
=================== |
|||
|
|||
Odoo Apps Store: https://apps.odoo.com/apps/modules/8.0/mail_attachment_popup/ |
|||
|
|||
|
|||
Tested on `Odoo 8.0 <https://github.com/odoo/odoo/commit/6682bde8a202794740b9756542b5b119db7606f3>`_ |
@ -0,0 +1,26 @@ |
|||
# -*- coding: utf-8 -*- |
|||
{ |
|||
"name": """Popup Attachments""", |
|||
"summary": """Open attached mail images in popup""", |
|||
"category": "Extra Tools", |
|||
"version": "1.0.0", |
|||
"images": ['images/popup_image.png'], |
|||
|
|||
"author": "IT-Projects LLC, Dinar Gabbasov", |
|||
'website': "https://twitter.com/gabbasov_dinar", |
|||
"license": "GPL-3", |
|||
|
|||
"depends": [ |
|||
"mail", |
|||
], |
|||
"external_dependencies": {"python": [], "bin": []}, |
|||
"data": [ |
|||
"views/mail_attachment_popup_template.xml", |
|||
], |
|||
"qweb": [ |
|||
"static/src/xml/mail_attachment_popup.xml", |
|||
], |
|||
|
|||
"installable": True, |
|||
'auto_install': False, |
|||
} |
@ -0,0 +1,4 @@ |
|||
`1.0.0` |
|||
------- |
|||
|
|||
- Init version |
@ -0,0 +1,16 @@ |
|||
=================== |
|||
Popup Attachments |
|||
=================== |
|||
|
|||
Installation |
|||
============ |
|||
|
|||
* `Install <https://odoo-development.readthedocs.io/en/latest/odoo/usage/install-module.html>`__ this module in a usual way |
|||
|
|||
Usage |
|||
===== |
|||
|
|||
* Open 'Messaging' menu |
|||
* Find any message with image in attachments |
|||
* Click on the image |
|||
* Browser opens image in popup instead of downloading it |
After Width: 749 | Height: 371 | Size: 128 KiB |
After Width: 361 | Height: 382 | Size: 63 KiB |
After Width: 361 | Height: 381 | Size: 131 KiB |
After Width: 100 | Height: 100 | Size: 2.1 KiB |
@ -0,0 +1,84 @@ |
|||
<section class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="oe_span12"> |
|||
<h2 class="oe_slogan">Popup Attachments</h2> |
|||
<h3 class="oe_slogan">Open attachments in popup</h3> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="oe_span12"> |
|||
<p class="oe_mt32"> |
|||
The module allows to open attachments (images) in popup. It is convenient if you want to display them only without downloading. |
|||
</p> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container oe_dark"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="oe_span12"> |
|||
<h3 class="oe_slogan">How it works</h3> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="oe_span6"> |
|||
<p class="oe_mt32"> |
|||
Go to "Messaging" menu and open email that contains image(s) in attachment. |
|||
</p> |
|||
</div> |
|||
<div class="oe_span6"> |
|||
<div class="oe_row_img oe_centered"> |
|||
<img class="oe_demo oe_picture oe_screenshot" src="attach_image.png"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container oe_dark"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="oe_span6"> |
|||
<div class="oe_row_img oe_centered"> |
|||
<img class="oe_demo oe_picture oe_screenshot" src="popup.png"/> |
|||
</div> |
|||
</div> |
|||
<div class="oe_span6"> |
|||
<p class="oe_mt32"> |
|||
Click on the image and see how popup is appear. |
|||
</p> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="oe_span6"> |
|||
<p class="oe_mt32"> |
|||
Moreover, you can download it to your device by clicking on the "Download" button if needed. |
|||
</p> |
|||
</div> |
|||
<div class="oe_span6"> |
|||
<div class="oe_row_img oe_centered"> |
|||
<img class="oe_demo oe_picture oe_screenshot" src="download.png"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="oe_span12"> |
|||
<h2>Need our service?</h2> |
|||
<p class="oe_mt32">Contact us by <a href="mailto:it@it-projects.info">email</a> or fill out <a href="https://www.it-projects.info/page/website.contactus " target="_blank">request form</a></p> |
|||
<ul> |
|||
<li><a href="mailto:it@it-projects.info">it@it-projects.info <i class="fa fa-envelope-o"></i></a></li> |
|||
<li><a href="https://www.it-projects.info/page/website.contactus " target="_blank">https://www.it-projects.info/page/website.contactus <i class="fa fa-list-alt"></i></a></li> |
|||
</ul> |
|||
</div> |
|||
</div> |
|||
</section> |
After Width: 365 | Height: 382 | Size: 150 KiB |
@ -0,0 +1,429 @@ |
|||
/* |
|||
|
|||
arcticModal — jQuery plugin |
|||
Version: 0.3 |
|||
Author: Sergey Predvoditelev (sergey.predvoditelev@gmail.com) |
|||
Company: Arctic Laboratory (http://arcticlab.ru/)
|
|||
|
|||
Docs & Examples: http://arcticlab.ru/arcticmodal/
|
|||
|
|||
*/ |
|||
(function($) { |
|||
|
|||
|
|||
var default_options = { |
|||
|
|||
type: 'html', // ajax или html
|
|||
content: '', |
|||
url: '', |
|||
ajax: {}, |
|||
ajax_request: null, |
|||
|
|||
closeOnEsc: true, |
|||
closeOnOverlayClick: true, |
|||
|
|||
clone: false, |
|||
|
|||
overlay: { |
|||
block: undefined, |
|||
tpl: '<div class="arcticmodal-overlay"></div>', |
|||
css: { |
|||
backgroundColor: '#000', |
|||
opacity: .6 |
|||
} |
|||
}, |
|||
|
|||
container: { |
|||
block: undefined, |
|||
tpl: '<div class="arcticmodal-container"><table class="arcticmodal-container_i"><tr><td class="arcticmodal-container_i2"></td></tr></table></div>' |
|||
}, |
|||
|
|||
wrap: undefined, |
|||
body: undefined, |
|||
|
|||
errors: { |
|||
tpl: '<div class="arcticmodal-error arcticmodal-close"></div>', |
|||
autoclose_delay: 2000, |
|||
ajax_unsuccessful_load: 'Error' |
|||
}, |
|||
|
|||
openEffect: { |
|||
type: 'fade', |
|||
speed: 400 |
|||
}, |
|||
closeEffect: { |
|||
type: 'fade', |
|||
speed: 400 |
|||
}, |
|||
|
|||
beforeOpen: $.noop, |
|||
afterOpen: $.noop, |
|||
beforeClose: $.noop, |
|||
afterClose: $.noop, |
|||
afterLoading: $.noop, |
|||
afterLoadingOnShow: $.noop, |
|||
errorLoading: $.noop |
|||
|
|||
}; |
|||
|
|||
|
|||
var modalID = 0; |
|||
var modals = $([]); |
|||
|
|||
|
|||
var utils = { |
|||
|
|||
|
|||
// Определяет произошло ли событие e вне блока block
|
|||
isEventOut: function(blocks, e) { |
|||
var r = true; |
|||
$(blocks).each(function() { |
|||
if ($(e.target).get(0)==$(this).get(0)) r = false; |
|||
if ($(e.target).closest('HTML', $(this).get(0)).length==0) r = false; |
|||
}); |
|||
return r; |
|||
} |
|||
|
|||
|
|||
}; |
|||
|
|||
|
|||
var modal = { |
|||
|
|||
|
|||
// Возвращает элемент, которым был вызван плагин
|
|||
getParentEl: function(el) { |
|||
var r = $(el); |
|||
if (r.data('arcticmodal')) return r; |
|||
r = $(el).closest('.arcticmodal-container').data('arcticmodalParentEl'); |
|||
if (r) return r; |
|||
return false; |
|||
}, |
|||
|
|||
|
|||
// Переход
|
|||
transition: function(el, action, options, callback) { |
|||
callback = callback==undefined ? $.noop : callback; |
|||
switch (options.type) { |
|||
case 'fade': |
|||
action=='show' ? el.fadeIn(options.speed, callback) : el.fadeOut(options.speed, callback); |
|||
break; |
|||
case 'none': |
|||
action=='show' ? el.show() : el.hide(); |
|||
callback(); |
|||
break; |
|||
} |
|||
}, |
|||
|
|||
|
|||
// Подготвка содержимого окна
|
|||
prepare_body: function(D, $this) { |
|||
|
|||
// Обработчик закрытия
|
|||
$('.arcticmodal-close', D.body).unbind('click.arcticmodal').bind('click.arcticmodal', function() { |
|||
$this.arcticmodal('close'); |
|||
return false; |
|||
}); |
|||
|
|||
}, |
|||
|
|||
|
|||
// Инициализация элемента
|
|||
init_el: function($this, options) { |
|||
var D = $this.data('arcticmodal'); |
|||
if (D) return; |
|||
|
|||
D = options; |
|||
modalID++; |
|||
D.modalID = modalID; |
|||
|
|||
// Overlay
|
|||
D.overlay.block = $(D.overlay.tpl); |
|||
D.overlay.block.css(D.overlay.css); |
|||
|
|||
// Container
|
|||
D.container.block = $(D.container.tpl); |
|||
|
|||
// BODY
|
|||
D.body = $('.arcticmodal-container_i2', D.container.block); |
|||
if (options.clone) { |
|||
D.body.html($this.clone(true)); |
|||
} else { |
|||
$this.before('<div id="arcticmodalReserve' + D.modalID + '" style="display: none" />'); |
|||
D.body.html($this); |
|||
} |
|||
|
|||
// Подготовка содержимого
|
|||
modal.prepare_body(D, $this); |
|||
|
|||
// Закрытие при клике на overlay
|
|||
if (D.closeOnOverlayClick) |
|||
D.overlay.block.add(D.container.block).click(function(e) { |
|||
if (utils.isEventOut($('>*', D.body), e)) |
|||
$this.arcticmodal('close'); |
|||
}); |
|||
|
|||
// Запомним настройки
|
|||
D.container.block.data('arcticmodalParentEl', $this); |
|||
$this.data('arcticmodal', D); |
|||
modals = $.merge(modals, $this); |
|||
|
|||
// Показать
|
|||
$.proxy(actions.show, $this)(); |
|||
if (D.type=='html') return $this; |
|||
|
|||
// Ajax-загрузка
|
|||
if (D.ajax.beforeSend!=undefined) { |
|||
var fn_beforeSend = D.ajax.beforeSend; |
|||
delete D.ajax.beforeSend; |
|||
} |
|||
if (D.ajax.success!=undefined) { |
|||
var fn_success = D.ajax.success; |
|||
delete D.ajax.success; |
|||
} |
|||
if (D.ajax.error!=undefined) { |
|||
var fn_error = D.ajax.error; |
|||
delete D.ajax.error; |
|||
} |
|||
var o = $.extend(true, { |
|||
url: D.url, |
|||
beforeSend: function() { |
|||
if (fn_beforeSend==undefined) { |
|||
D.body.html('<div class="arcticmodal-loading" />'); |
|||
} else { |
|||
fn_beforeSend(D, $this); |
|||
} |
|||
}, |
|||
success: function(responce) { |
|||
|
|||
// Событие после загрузки до показа содержимого
|
|||
$this.trigger('afterLoading'); |
|||
D.afterLoading(D, $this, responce); |
|||
|
|||
if (fn_success==undefined) { |
|||
D.body.html(responce); |
|||
} else { |
|||
fn_success(D, $this, responce); |
|||
} |
|||
modal.prepare_body(D, $this); |
|||
|
|||
// Событие после загрузки после отображения содержимого
|
|||
$this.trigger('afterLoadingOnShow'); |
|||
D.afterLoadingOnShow(D, $this, responce); |
|||
|
|||
}, |
|||
error: function() { |
|||
|
|||
// Событие при ошибке загрузки
|
|||
$this.trigger('errorLoading'); |
|||
D.errorLoading(D, $this); |
|||
|
|||
if (fn_error==undefined) { |
|||
D.body.html(D.errors.tpl); |
|||
$('.arcticmodal-error', D.body).html(D.errors.ajax_unsuccessful_load); |
|||
$('.arcticmodal-close', D.body).click(function() { |
|||
$this.arcticmodal('close'); |
|||
return false; |
|||
}); |
|||
if (D.errors.autoclose_delay) |
|||
setTimeout(function() { |
|||
$this.arcticmodal('close'); |
|||
}, D.errors.autoclose_delay); |
|||
} else { |
|||
fn_error(D, $this); |
|||
} |
|||
} |
|||
}, D.ajax); |
|||
D.ajax_request = $.ajax(o); |
|||
|
|||
// Запомнить настройки
|
|||
$this.data('arcticmodal', D); |
|||
|
|||
}, |
|||
|
|||
|
|||
// Инициализация
|
|||
init: function(options) { |
|||
options = $.extend(true, {}, default_options, options); |
|||
if ($.isFunction(this)) { |
|||
if (options==undefined) { |
|||
$.error('jquery.arcticmodal: Uncorrect parameters'); |
|||
return; |
|||
} |
|||
if (options.type=='') { |
|||
$.error('jquery.arcticmodal: Don\'t set parameter "type"'); |
|||
return; |
|||
} |
|||
switch (options.type) { |
|||
case 'html': |
|||
if (options.content=='') { |
|||
$.error('jquery.arcticmodal: Don\'t set parameter "content"'); |
|||
return |
|||
} |
|||
var c = options.content; |
|||
options.content = ''; |
|||
|
|||
return modal.init_el($(c), options); |
|||
break; |
|||
case 'ajax': |
|||
if (options.url=='') { |
|||
$.error('jquery.arcticmodal: Don\'t set parameter "url"'); |
|||
return; |
|||
} |
|||
return modal.init_el($('<div />'), options); |
|||
break; |
|||
} |
|||
} else { |
|||
return this.each(function() { |
|||
modal.init_el($(this), $.extend(true, {}, options)); |
|||
}); |
|||
} |
|||
} |
|||
|
|||
|
|||
}; |
|||
|
|||
|
|||
var actions = { |
|||
|
|||
|
|||
// Показать
|
|||
show: function() { |
|||
var $this = modal.getParentEl(this); |
|||
if ($this===false) { |
|||
$.error('jquery.arcticmodal: Uncorrect call'); |
|||
return; |
|||
} |
|||
var D = $this.data('arcticmodal'); |
|||
|
|||
// Добавить overlay и container
|
|||
D.overlay.block.hide(); |
|||
D.container.block.hide(); |
|||
$('BODY').append(D.overlay.block); |
|||
$('BODY').append(D.container.block); |
|||
|
|||
// Событие
|
|||
D.beforeOpen(D, $this); |
|||
$this.trigger('beforeOpen'); |
|||
|
|||
// Wrap
|
|||
if (D.wrap.css('overflow')!='hidden') { |
|||
D.wrap.data('arcticmodalOverflow', D.wrap.css('overflow')); |
|||
var w1 = D.wrap.outerWidth(true); |
|||
D.wrap.css('overflow', 'hidden'); |
|||
var w2 = D.wrap.outerWidth(true); |
|||
if (w2!=w1) |
|||
D.wrap.css('marginRight', (w2 - w1) + 'px'); |
|||
} |
|||
|
|||
// Скрыть предыдущие оверлеи
|
|||
modals.not($this).each(function() { |
|||
var d = $(this).data('arcticmodal'); |
|||
d.overlay.block.hide(); |
|||
}); |
|||
|
|||
// Показать
|
|||
modal.transition(D.overlay.block, 'show', modals.length>1 ? {type: 'none'} : D.openEffect); |
|||
modal.transition(D.container.block, 'show', modals.length>1 ? {type: 'none'} : D.openEffect, function() { |
|||
D.afterOpen(D, $this); |
|||
$this.trigger('afterOpen'); |
|||
}); |
|||
|
|||
return $this; |
|||
}, |
|||
|
|||
|
|||
// Закрыть
|
|||
close: function() { |
|||
if ($.isFunction(this)) { |
|||
modals.each(function() { |
|||
$(this).arcticmodal('close'); |
|||
}); |
|||
} else { |
|||
return this.each(function() { |
|||
var $this = modal.getParentEl(this); |
|||
if ($this===false) { |
|||
$.error('jquery.arcticmodal: Uncorrect call'); |
|||
return; |
|||
} |
|||
var D = $this.data('arcticmodal'); |
|||
|
|||
// Событие перед закрытием
|
|||
if (D.beforeClose(D, $this)===false) return; |
|||
$this.trigger('beforeClose'); |
|||
|
|||
// Показать предыдущие оверлеи
|
|||
modals.not($this).last().each(function() { |
|||
var d = $(this).data('arcticmodal'); |
|||
d.overlay.block.show(); |
|||
}); |
|||
|
|||
modal.transition(D.overlay.block, 'hide', modals.length>1 ? {type: 'none'} : D.closeEffect); |
|||
modal.transition(D.container.block, 'hide', modals.length>1 ? {type: 'none'} : D.closeEffect, function() { |
|||
|
|||
// Событие после закрытия
|
|||
D.afterClose(D, $this); |
|||
$this.trigger('afterClose'); |
|||
|
|||
// Если не клонировали - вернём на место
|
|||
if (!D.clone) |
|||
$('#arcticmodalReserve' + D.modalID).replaceWith(D.body.find('>*')); |
|||
|
|||
D.overlay.block.remove(); |
|||
D.container.block.remove(); |
|||
$this.data('arcticmodal', null); |
|||
if (!$('.arcticmodal-container').length) { |
|||
if (D.wrap.data('arcticmodalOverflow')) |
|||
D.wrap.css('overflow', D.wrap.data('arcticmodalOverflow')); |
|||
D.wrap.css('marginRight', 0); |
|||
} |
|||
|
|||
}); |
|||
|
|||
if (D.type=='ajax') |
|||
D.ajax_request.abort(); |
|||
|
|||
modals = modals.not($this); |
|||
}); |
|||
} |
|||
}, |
|||
|
|||
|
|||
// Установить опции по-умолчанию
|
|||
setDefault: function(options) { |
|||
$.extend(true, default_options, options); |
|||
} |
|||
|
|||
|
|||
}; |
|||
|
|||
|
|||
$(function() { |
|||
default_options.wrap = $((document.all && !document.querySelector) ? 'html' : 'body'); |
|||
}); |
|||
|
|||
|
|||
// Закрытие при нажатии Escape
|
|||
$(document).bind('keyup.arcticmodal', function(e) { |
|||
var m = modals.last(); |
|||
if (!m.length) return; |
|||
var D = m.data('arcticmodal'); |
|||
if (D.closeOnEsc && (e.keyCode===27)) |
|||
m.arcticmodal('close'); |
|||
}); |
|||
|
|||
|
|||
$.arcticmodal = $.fn.arcticmodal = function(method) { |
|||
|
|||
if (actions[method]) { |
|||
return actions[method].apply(this, Array.prototype.slice.call(arguments, 1)); |
|||
} else if (typeof method==='object' || !method) { |
|||
return modal.init.apply(this, arguments); |
|||
} else { |
|||
$.error('jquery.arcticmodal: Method ' + method + ' does not exist'); |
|||
} |
|||
|
|||
}; |
|||
|
|||
|
|||
})(jQuery); |
@ -0,0 +1,8 @@ |
|||
.arcticmodal-overlay, |
|||
.arcticmodal-container { position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: 1010; } |
|||
.arcticmodal-container { overflow: auto; margin: 0; padding: 0; border: 0; border-collapse: collapse; } |
|||
*:first-child+html .arcticmodal-container { height: 100% } |
|||
.arcticmodal-container_i { height: 100%; margin: 0 auto; } |
|||
.arcticmodal-container_i2 { padding: 24px; margin: 0; border: 0; vertical-align: middle; padding-top: 50px;} |
|||
.arcticmodal-error { padding: 20px; border-radius: 10px; background: #000; color: #fff; } |
|||
.arcticmodal-loading { width: 80px; height: 80px; border-radius: 10px; background: #000 url(/mail_attachment_popup/static/src/img/loading.gif) no-repeat 50% 50%; } |
@ -0,0 +1,11 @@ |
|||
.box-modal { |
|||
position: relative; |
|||
padding: 16px; |
|||
background: #fff; |
|||
color: #3c3c3c; |
|||
font: 14px/18px Arial, "Helvetica CY", "Nimbus Sans L", sans-serif; |
|||
box-shadow: 0 0 0 6px rgba(153, 153, 153, .3); |
|||
border-radius: 6px; |
|||
} |
|||
.box-modal_close { position: absolute; right: -25px; top: -25px; font-size: 30px; line-height: 15px; color: #ffffff; cursor: pointer; } |
|||
.box-modal_close:hover { color: #B1B1B1; } |
@ -0,0 +1,10 @@ |
|||
.g-hidden { |
|||
display: none; |
|||
} |
|||
.box-modal img { |
|||
max-width: 1100px; |
|||
width: 100%; |
|||
} |
|||
.oe_attachment.oe_preview { |
|||
cursor: pointer; |
|||
} |
After Width: 32 | Height: 32 | Size: 3.1 KiB |
@ -0,0 +1,19 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<template> |
|||
<t t-extend="mail.thread.message.attachments"> |
|||
<t t-jquery="t[t-if='attachment.file_type_icon === 'webimage''] a[t-att-href='attachment.url']" t-operation="replace"> |
|||
<span class="m-dotted" t-attf-onclick="$('#ImageModal{{ attachment.id }}').arcticmodal()"> |
|||
<img t-att-src="widget.attachments_resize_image(attachment.id, [100,80])"></img> |
|||
<div class='oe_name'><t t-raw='attachment.name' /></div> |
|||
</span> |
|||
<div class="g-hidden"> |
|||
<div class="box-modal" t-attf-id="ImageModal{{ attachment.id }}"> |
|||
<div class="box-modal_close arcticmodal-close">X</div> |
|||
<img t-att-src="widget.attachments_resize_image(attachment.id, [100,80])"></img> |
|||
<div class='oe_name'><t t-raw='attachment.name' /></div> |
|||
<div class='oe_download_original_img'><a t-att-href='attachment.url' target="_blank">Download</a></div> |
|||
</div> |
|||
</div> |
|||
</t> |
|||
</t> |
|||
</template> |
@ -0,0 +1,13 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<openerp> |
|||
<data> |
|||
<template id="assets_backend" name="account assets" inherit_id="web.assets_backend"> |
|||
<xpath expr="." position="inside"> |
|||
<link rel="stylesheet" href="/mail_attachment_popup/static/src/css/jquery.arcticmodal.css"/> |
|||
<link rel="stylesheet" href="/mail_attachment_popup/static/src/css/simple.css"/> |
|||
<link rel="stylesheet" href="/mail_attachment_popup/static/src/css/styles.css"/> |
|||
<script type="text/javascript" src="/mail_attachment_popup/static/lib/js/jquery.arcticmodal.js"></script> |
|||
</xpath> |
|||
</template> |
|||
</data> |
|||
</openerp> |
@ -0,0 +1,9 @@ |
|||
.. image:: https://itpp.dev/images/infinity-readme.png |
|||
:alt: Tested and maintained by IT Projects Labs |
|||
:target: https://itpp.dev |
|||
|
|||
Check mail immediately |
|||
====================== |
|||
|
|||
Description: https://apps.odoo.com/apps/modules/8.0/mail_check_immediately/ |
|||
|
@ -0,0 +1,2 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from . import models |
@ -0,0 +1,17 @@ |
|||
# -*- coding: utf-8 -*- |
|||
{ |
|||
'name': 'Check mail immediately', |
|||
'version': '1.0.1', |
|||
'author': 'IT-Projects LLC, Ivan Yelizariev', |
|||
'license': 'GPL-3', |
|||
"category": "Discuss", |
|||
'website': 'https://twitter.com/yelizariev', |
|||
'depends': ['base', 'web', 'fetchmail', 'mail'], |
|||
'data': [ |
|||
'views.xml', |
|||
], |
|||
'qweb': [ |
|||
"static/src/xml/main.xml", |
|||
], |
|||
'installable': True |
|||
} |
@ -0,0 +1,4 @@ |
|||
`1.0.1` |
|||
------- |
|||
|
|||
- FIX: incorrectly displayed last updated time when multiple threads (--workers) |
After Width: 750 | Height: 371 | Size: 80 KiB |
@ -0,0 +1,66 @@ |
|||
# -*- coding: utf-8 -*- |
|||
import datetime |
|||
|
|||
from openerp.tools.translate import _ |
|||
from openerp import tools |
|||
|
|||
from openerp import exceptions |
|||
from openerp import models, fields, api |
|||
|
|||
|
|||
class FetchMailServer(models.Model): |
|||
_inherit = 'fetchmail.server' |
|||
_name = 'fetchmail.server' |
|||
|
|||
_last_updated = None |
|||
|
|||
run_time = fields.Datetime(string="Launch time") |
|||
|
|||
def _run_time(self): |
|||
if not self._last_updated: |
|||
self._last_updated = tools.datetime.now() |
|||
|
|||
src_tstamp_str = self._last_updated.strftime(tools.misc.DEFAULT_SERVER_DATETIME_FORMAT) |
|||
src_format = tools.misc.DEFAULT_SERVER_DATETIME_FORMAT |
|||
dst_format = tools.misc.DEFAULT_SERVER_DATETIME_FORMAT |
|||
dst_tz_name = self._context.get('tz') or self.env.user.tz |
|||
_now = tools.misc.server_to_local_timestamp(src_tstamp_str, src_format, dst_format, dst_tz_name) |
|||
|
|||
return _now |
|||
|
|||
@api.model |
|||
def _fetch_mails(self): |
|||
|
|||
if self._context.get('run_fetchmail_manually'): |
|||
# if interval less than 5 seconds |
|||
if self._last_updated and (datetime.datetime.now() - self._last_updated) < datetime.timedelta(0, 5): |
|||
raise exceptions.Warning(_('Error'), _('Task can be started no earlier than 5 seconds.')) |
|||
|
|||
super(FetchMailServer, self)._fetch_mails() |
|||
|
|||
res = self.env['fetchmail.server'].sudo().with_context(tz=self.env.user.tz).search([('state', '=', 'done')]) |
|||
if res: |
|||
res[0].run_time = self._run_time() |
|||
|
|||
|
|||
class FetchMailImmediately(models.AbstractModel): |
|||
|
|||
_name = 'fetch_mail.imm' |
|||
|
|||
@api.model |
|||
def get_last_update_time(self): |
|||
res = self.env['fetchmail.server'].sudo().with_context(tz=self.env.user.tz).search([('state', '=', 'done')]) |
|||
array = [r.run_time for r in res] |
|||
if array: |
|||
return array[0] |
|||
else: |
|||
return None |
|||
|
|||
@api.model |
|||
def run_fetchmail_manually(self): |
|||
|
|||
fetchmail_task = self.env.ref('fetchmail.ir_cron_mail_gateway_action') |
|||
fetchmail_model = self.env['fetchmail.server'].sudo() |
|||
|
|||
fetchmail_task._try_lock() |
|||
fetchmail_model.with_context(run_fetchmail_manually=True)._fetch_mails() |
After Width: 100 | Height: 100 | Size: 2.1 KiB |
@ -0,0 +1,47 @@ |
|||
<section class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="oe_span12"> |
|||
<h2 class="oe_slogan">Check mail immediately</h2> |
|||
<h3 class="oe_slogan">Keep your inbox up to date</h3> |
|||
</div> |
|||
|
|||
<div class="oe_span12"> |
|||
<div class="oe_demo oe_picture oe_screenshot"> |
|||
<img src="screenshot.png?"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container oe_dark"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="oe_span12"> |
|||
<h2>Protect your business</h2> |
|||
</div> |
|||
<div class="oe_span6"> |
|||
<p class="oe_mt32"> |
|||
<a href="https://github.com/odoo/odoo/issues/7464">Sometimes</a> odoo mail fetching system doesn't work for really long time. It could be a real problem, if you will not notice it on time. Until this issue is fixed, you can restart odoo every time when you see that last fetching time is more than 5 minutes. |
|||
</p> |
|||
</div> |
|||
|
|||
<div class="oe_span6"> |
|||
<div class="oe_picture"> |
|||
<img src="issue.png?3"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="oe_span12"> |
|||
<h2>Need our service?</h2> |
|||
<p class="oe_mt32">Contact us by <a href="mailto:it@it-projects.info">email</a> or fill out <a href="https://www.it-projects.info/page/website.contactus " target="_blank">request form</a></p> |
|||
<ul> |
|||
<li><a href="mailto:it@it-projects.info">it@it-projects.info <i class="fa fa-envelope-o"></i></a></li> |
|||
<li><a href="https://www.it-projects.info/page/website.contactus " target="_blank"> |
|||
https://www.it-projects.info/page/website.contactus <i class="fa fa-list-alt"></i></a></li> |
|||
</ul> |
|||
</div> |
|||
</div> |
|||
</section> |
After Width: 217 | Height: 140 | Size: 8.5 KiB |
After Width: 840 | Height: 447 | Size: 88 KiB |
@ -0,0 +1,55 @@ |
|||
openerp.mail_check_immediately = function(instance, local) { |
|||
|
|||
instance.mail.Wall.include({ |
|||
|
|||
init: function(){ |
|||
this._super.apply(this, arguments); |
|||
|
|||
var _this = this; |
|||
|
|||
this.imm_model = new instance.web.Model('fetch_mail.imm'); |
|||
this.events['click a.oe_fetch_new_mails'] = function(){ |
|||
_this.run_fetchmail_manually(); |
|||
}; |
|||
}, |
|||
|
|||
start: function() { |
|||
var _this = this; |
|||
|
|||
|
|||
this._super(); |
|||
|
|||
this.get_last_fetched_time(); |
|||
|
|||
this.get_time_loop = setInterval(function(){ |
|||
_this.get_last_fetched_time(); |
|||
}, 30000); |
|||
|
|||
}, |
|||
|
|||
run_fetchmail_manually: function(){ |
|||
var _this = this; |
|||
|
|||
this.imm_model.call('run_fetchmail_manually', {context: new instance.web.CompoundContext()}).then(function(){ |
|||
_this.get_last_fetched_time(); |
|||
}); |
|||
}, |
|||
|
|||
get_last_fetched_time: function(){ |
|||
var _this = this; |
|||
this.imm_model.call('get_last_update_time', {context: new instance.web.CompoundContext()}).then(function(res){ |
|||
var value; |
|||
if (res) |
|||
value = $.timeago(res); |
|||
value = value || 'undefined'; |
|||
_this.$el.find('span.oe_view_manager_fetch_mail_imm_field').html(value); |
|||
}); |
|||
}, |
|||
|
|||
destroy: function(){ |
|||
clearInterval(this.get_time_loop); |
|||
this._super.apply(this, arguments); |
|||
} |
|||
|
|||
}); |
|||
}; |
@ -0,0 +1,25 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<templates> |
|||
<t t-name="fetch_mail_immediately.header"> |
|||
<tr class="oe_header_row"> |
|||
<td t-att-colspan="colspan or '3'"> |
|||
<div class="oe_view_manager_fetch_mail_imm"> |
|||
<em> |
|||
<span>Mails fetched:</span> |
|||
<a href="#" class="oe_fetch_new_mails" title="Click to fetch mails now"> |
|||
<span class="oe_view_manager_fetch_mail_imm_field"></span> |
|||
</a> |
|||
</em> |
|||
</div> |
|||
</td> |
|||
<td></td> |
|||
</tr> |
|||
</t> |
|||
<t t-extend="mail.wall"> |
|||
<t t-jquery="tr.oe_header_row_top" t-operation="after"> |
|||
<t t-call="fetch_mail_immediately.header"> |
|||
<t t-set="colspan" t-value="2"/> |
|||
</t> |
|||
</t> |
|||
</t> |
|||
</templates> |
@ -0,0 +1,9 @@ |
|||
<openerp> |
|||
<data> |
|||
<template id="assets_backend_inherited_check_mail" name="Check mail immediately bar" inherit_id="web.assets_backend"> |
|||
<xpath expr="." position="inside"> |
|||
<script type="text/javascript" src="/mail_check_immediately/static/src/js/main.js"></script> |
|||
</xpath> |
|||
</template> |
|||
</data> |
|||
</openerp> |
@ -0,0 +1,8 @@ |
|||
.. image:: https://itpp.dev/images/infinity-readme.png |
|||
:alt: Tested and maintained by IT Projects Labs |
|||
:target: https://itpp.dev |
|||
|
|||
Delete access link in email footer |
|||
================================== |
|||
|
|||
Tested on `8.0 <https://github.com/odoo/odoo/commit/ab7b5d7732a7c222a0aea45bd173742acd47242d>`_ |
@ -0,0 +1,2 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from . import mail_delete_access_link |
@ -0,0 +1,12 @@ |
|||
# -*- coding: utf-8 -*- |
|||
{ |
|||
'name': 'Delete access link in email footer', |
|||
'version': '1.0.0', |
|||
'author': 'IT-Projects LLC, Ivan Yelizariev', |
|||
'license': 'GPL-3', |
|||
"category": "Discuss", |
|||
'website': 'https://twitter.com/yelizariev', |
|||
'depends': ['mail'], |
|||
'data': [], |
|||
'installable': True |
|||
} |
@ -0,0 +1,9 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from openerp.osv import osv |
|||
|
|||
|
|||
class MailMail(osv.Model): |
|||
_inherit = 'mail.mail' |
|||
|
|||
def _get_partner_access_link(self, cr, uid, mail, partner=None, context=None): |
|||
return None |
After Width: 100 | Height: 100 | Size: 2.1 KiB |
@ -0,0 +1,27 @@ |
|||
.. image:: https://itpp.dev/images/infinity-readme.png |
|||
:alt: Tested and maintained by IT Projects Labs |
|||
:target: https://itpp.dev |
|||
|
|||
============================= |
|||
Delete Odoo footer in email |
|||
============================= |
|||
|
|||
Questions? |
|||
========== |
|||
|
|||
To get an assistance on this module contact us by email :arrow_right: help@itpp.dev |
|||
|
|||
Contributors |
|||
============ |
|||
* `Ivan Yelizariev <https://it-projects.info/team/yelizariev>`__ |
|||
|
|||
|
|||
The module is not maintained since Odoo 9.0. |
|||
|
|||
Further information |
|||
=================== |
|||
|
|||
Odoo Apps Store: https://apps.odoo.com/apps/modules/8.0/mail_delete_odoo_footer/ |
|||
|
|||
|
|||
Tested on `Odoo 8.0 <https://github.com/odoo/odoo/commit/ab7b5d7732a7c222a0aea45bd173742acd47242d>`_ |
@ -0,0 +1,13 @@ |
|||
# -*- coding: utf-8 -*- |
|||
{ |
|||
'name': 'Delete Odoo footer in email', |
|||
'version': '1.0.0', |
|||
'author': 'IT-Projects LLC, Ivan Yelizariev', |
|||
'license': 'GPL-3', |
|||
"category": "Discuss", |
|||
'website': 'https://yelizariev.github.io', |
|||
'depends': ['mail_delete_access_link', 'mail_delete_sent_by_footer'], |
|||
'data': [ |
|||
], |
|||
'installable': True |
|||
} |
@ -0,0 +1,4 @@ |
|||
`1.0.0` |
|||
------- |
|||
|
|||
- Init version |
@ -0,0 +1,13 @@ |
|||
============================= |
|||
Delete Odoo footer in email |
|||
============================= |
|||
|
|||
Installation |
|||
============ |
|||
|
|||
* `Install <https://odoo-development.readthedocs.io/en/latest/odoo/usage/install-module.html>`__ this module in a usual way |
|||
|
|||
Configuration |
|||
============= |
|||
|
|||
This module do not need any special configuration. |
After Width: 100 | Height: 100 | Size: 2.1 KiB |
@ -0,0 +1,8 @@ |
|||
.. image:: https://itpp.dev/images/infinity-readme.png |
|||
:alt: Tested and maintained by IT Projects Labs |
|||
:target: https://itpp.dev |
|||
|
|||
Delete "Sent by..." footer in email |
|||
=================================== |
|||
|
|||
Tested on `8.0 <https://github.com/odoo/odoo/commit/ab7b5d7732a7c222a0aea45bd173742acd47242d>`_ |
@ -0,0 +1,2 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from . import mail_delete_sent_by_footer |
@ -0,0 +1,13 @@ |
|||
# -*- coding: utf-8 -*- |
|||
{ |
|||
'name': 'Delete "Sent by..." footer in email', |
|||
'version': '1.0.0', |
|||
'author': 'IT-Projects LLC, Ivan Yelizariev', |
|||
'license': 'GPL-3', |
|||
'category': 'Debranding', |
|||
'website': 'https://twitter.com/yelizariev', |
|||
'depends': ['mail'], |
|||
'data': [ |
|||
], |
|||
'installable': True |
|||
} |
@ -0,0 +1,23 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from openerp.osv import osv |
|||
from openerp import tools, SUPERUSER_ID |
|||
|
|||
|
|||
class MailNotification(osv.Model): |
|||
_inherit = 'mail.notification' |
|||
|
|||
def get_signature_footer(self, cr, uid, user_id, res_model=None, res_id=None, context=None, user_signature=True): |
|||
footer = "" |
|||
if not user_id: |
|||
return footer |
|||
|
|||
# add user signature |
|||
user = self.pool.get("res.users").browse(cr, SUPERUSER_ID, [user_id], context=context)[0] |
|||
if user_signature: |
|||
if user.signature: |
|||
signature = user.signature |
|||
else: |
|||
signature = "--<br />%s" % user.name |
|||
footer = tools.append_content_to_html(footer, signature, plaintext=False) |
|||
|
|||
return footer |
After Width: 100 | Height: 100 | Size: 2.1 KiB |
@ -0,0 +1,48 @@ |
|||
.. image:: https://itpp.dev/images/infinity-readme.png |
|||
:alt: Tested and maintained by IT Projects Labs |
|||
:target: https://itpp.dev |
|||
|
|||
Fix mail error 553 |
|||
================== |
|||
|
|||
Module updates 'FROM' field to portal@MYDOMAIN.COM value in order to fix 553 error on a mail service that checks FROM field. |
|||
|
|||
E.g: |
|||
|
|||
* Customer send email from USER@CUSTOMER.com to info@MYDOMAIN.COM |
|||
* odoo accept email and try to send notifcation to related odoo users. E.g to admin@gmail.com. |
|||
* By default odoo prepare notification email with parameters as follows: |
|||
|
|||
* FROM: user@CUSTOMER.com |
|||
* TO: admin@gmail.com |
|||
|
|||
if you mail service provider, e.g. pdd.yandex.ru, doesn't allow emails with a FROM value differ from ...@MYDOMAIN.COM, then you get 553. This is why you need to update FROM value to portal@MYDOMAIN.COM |
|||
|
|||
Configuration |
|||
============= |
|||
|
|||
You can configure default alias at Settings -> System Parameters -> mail.catchall.alias_from |
|||
|
|||
You can configure name for default alias at Settings -> System Parameters -> mail.catchall.name_alias_from |
|||
|
|||
Known issues / Roadmap |
|||
====================== |
|||
|
|||
The module is consist of redefined send function from mail.mail |
|||
model. So it is just copy pasted source code with some |
|||
modification. This function is changed very rarely, but sometime it |
|||
can happens and the module should be updated. You can check commits |
|||
for mail_mail.py here: |
|||
https://github.com/odoo/odoo/commits/8.0/addons/mail/mail_mail.py |
|||
|
|||
Tested on `Odoo 8.0 <https://github.com/odoo/odoo/commit/d023c079ed86468436f25da613bf486a4a17d625>`_ |
|||
|
|||
Status |
|||
====== |
|||
|
|||
Related issues at odoo's tracker: |
|||
* https://github.com/odoo/odoo/issues/5864 |
|||
* https://github.com/odoo/odoo/issues/3347 |
|||
|
|||
Fix: https://github.com/odoo-dev/odoo/commit/a4597fe34fcfa8dae28b156410080346bb33af33 |
|||
|
@ -0,0 +1,2 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from . import mail_fix_553 |
@ -0,0 +1,12 @@ |
|||
# -*- coding: utf-8 -*- |
|||
{ |
|||
"name": "Fix mail error 553", |
|||
"version": "0.3", |
|||
"author": "IT-Projects LLC, Ivan Yelizariev", |
|||
'license': 'GPL-3', |
|||
"category": "Discuss", |
|||
"website": "https://yelizariev.github.io", |
|||
"depends": ["base", "mail"], |
|||
"data": ["data.xml"], |
|||
"installable": True |
|||
} |
@ -0,0 +1,15 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<openerp> |
|||
<data noupdate="1"> |
|||
<!-- Catchall Email Alias --> |
|||
<record id="icp_mail_catchall_alias_from" model="ir.config_parameter"> |
|||
<field name="key">mail.catchall.alias_from</field> |
|||
<field name="value">portal</field> |
|||
</record> |
|||
<!-- Name for Catchall Email Alias --> |
|||
<record id="icp_mail_catchall_name_alias_from" model="ir.config_parameter"> |
|||
<field name="key">mail.catchall.name_alias_from</field> |
|||
<field name="value">Odoo</field> |
|||
</record> |
|||
</data> |
|||
</openerp> |
@ -0,0 +1,165 @@ |
|||
# -*- coding: utf-8 -*- |
|||
|
|||
import base64 |
|||
import logging |
|||
import re |
|||
from email.utils import formataddr |
|||
|
|||
from openerp import tools |
|||
from openerp import SUPERUSER_ID |
|||
from openerp.addons.base.ir.ir_mail_server import MailDeliveryException |
|||
from openerp.osv import osv |
|||
from openerp.tools.safe_eval import safe_eval as eval |
|||
from openerp.tools.translate import _ |
|||
|
|||
_logger = logging.getLogger(__name__) |
|||
|
|||
|
|||
class MailMail(osv.Model): |
|||
_inherit = "mail.mail" |
|||
|
|||
def send(self, cr, uid, ids, auto_commit=False, raise_exception=False, context=None): |
|||
# copy-paste from addons/mail/mail_mail.py |
|||
""" Sends the selected emails immediately, ignoring their current |
|||
state (mails that have already been sent should not be passed |
|||
unless they should actually be re-sent). |
|||
Emails successfully delivered are marked as 'sent', and those |
|||
that fail to be deliver are marked as 'exception', and the |
|||
corresponding error mail is output in the server logs. |
|||
|
|||
:param bool auto_commit: whether to force a commit of the mail status |
|||
after sending each mail (meant only for scheduler processing); |
|||
should never be True during normal transactions (default: False) |
|||
:param bool raise_exception: whether to raise an exception if the |
|||
email sending process has failed |
|||
:return: True |
|||
""" |
|||
|
|||
# NEW STUFF |
|||
catchall_alias = self.pool['ir.config_parameter'].get_param(cr, uid, "mail.catchall.alias_from", context=context) |
|||
catchall_alias_name = self.pool['ir.config_parameter'].get_param(cr, uid, "mail.catchall.name_alias_from", context=context) |
|||
catchall_domain = self.pool['ir.config_parameter'].get_param(cr, uid, "mail.catchall.domain", context=context) |
|||
|
|||
correct_email_from = r'@%s>?\s*$' % catchall_domain |
|||
default_email_from = '%s@%s' % (catchall_alias, catchall_domain) |
|||
|
|||
context = dict(context or {}) |
|||
ir_mail_server = self.pool.get('ir.mail_server') |
|||
ir_attachment = self.pool['ir.attachment'] |
|||
for mail in self.browse(cr, SUPERUSER_ID, ids, context=context): |
|||
try: |
|||
# TDE note: remove me when model_id field is present on mail.message - done here to avoid doing it multiple times in the sub method |
|||
if mail.model: |
|||
model_id = self.pool['ir.model'].search(cr, SUPERUSER_ID, [('model', '=', mail.model)], context=context)[0] |
|||
model = self.pool['ir.model'].browse(cr, SUPERUSER_ID, model_id, context=context) |
|||
else: |
|||
model = None |
|||
if model: |
|||
context['model_name'] = model.name |
|||
|
|||
# load attachment binary data with a separate read(), as prefetching all |
|||
# `datas` (binary field) could bloat the browse cache, triggerring |
|||
# soft/hard mem limits with temporary data. |
|||
attachment_ids = [a.id for a in mail.attachment_ids] |
|||
attachments = [(a['datas_fname'], base64.b64decode(a['datas'])) |
|||
for a in ir_attachment.read(cr, SUPERUSER_ID, attachment_ids, |
|||
['datas_fname', 'datas'])] |
|||
|
|||
# specific behavior to customize the send email for notified partners |
|||
email_list = [] |
|||
if mail.email_to: |
|||
email_list.append(self.send_get_email_dict(cr, uid, mail, context=context)) |
|||
for partner in mail.recipient_ids: |
|||
email_list.append(self.send_get_email_dict(cr, uid, mail, partner=partner, context=context)) |
|||
# headers |
|||
headers = {} |
|||
bounce_alias = self.pool['ir.config_parameter'].get_param(cr, uid, "mail.bounce.alias", context=context) |
|||
catchall_domain = self.pool['ir.config_parameter'].get_param(cr, uid, "mail.catchall.domain", context=context) |
|||
if bounce_alias and catchall_domain: |
|||
if mail.model and mail.res_id: |
|||
headers['Return-Path'] = '%s-%d-%s-%d@%s' % (bounce_alias, mail.id, mail.model, mail.res_id, catchall_domain) |
|||
else: |
|||
headers['Return-Path'] = '%s-%d@%s' % (bounce_alias, mail.id, catchall_domain) |
|||
if mail.headers: |
|||
try: |
|||
headers.update(eval(mail.headers)) |
|||
except Exception: |
|||
pass |
|||
|
|||
# Writing on the mail object may fail (e.g. lock on user) which |
|||
# would trigger a rollback *after* actually sending the email. |
|||
# To avoid sending twice the same email, provoke the failure earlier |
|||
mail.write({'state': 'exception'}) |
|||
mail_sent = False |
|||
|
|||
# build an RFC2822 email.message.Message object and send it without queuing |
|||
res = None |
|||
for email in email_list: |
|||
|
|||
# NEW STUFF |
|||
email_from = mail.email_from |
|||
if re.search(correct_email_from, email_from) is None: |
|||
email_from = default_email_from |
|||
if catchall_alias_name: |
|||
email_from = formataddr((catchall_alias_name, email_from)) |
|||
|
|||
msg = ir_mail_server.build_email( |
|||
email_from=email_from, # NEW STUFF |
|||
email_to=email.get('email_to'), |
|||
subject=email.get('subject'), |
|||
body=email.get('body'), |
|||
body_alternative=email.get('body_alternative'), |
|||
email_cc=tools.email_split(mail.email_cc), |
|||
reply_to=mail.reply_to, |
|||
attachments=attachments, |
|||
message_id=mail.message_id, |
|||
references=mail.references, |
|||
object_id=mail.res_id and ('%s-%s' % (mail.res_id, mail.model)), |
|||
subtype='html', |
|||
subtype_alternative='plain', |
|||
headers=headers) |
|||
try: |
|||
res = ir_mail_server.send_email(cr, uid, msg, |
|||
mail_server_id=mail.mail_server_id.id, |
|||
context=context) |
|||
except AssertionError as error: |
|||
if error.message == ir_mail_server.NO_VALID_RECIPIENT: |
|||
# No valid recipient found for this particular |
|||
# mail item -> ignore error to avoid blocking |
|||
# delivery to next recipients, if any. If this is |
|||
# the only recipient, the mail will show as failed. |
|||
_logger.warning("Ignoring invalid recipients for mail.mail %s: %s", |
|||
mail.message_id, email.get('email_to')) |
|||
else: |
|||
raise |
|||
if res: |
|||
mail.write({'state': 'sent', 'message_id': res}) |
|||
mail_sent = True |
|||
|
|||
# /!\ can't use mail.state here, as mail.refresh() will cause an error |
|||
# see revid:odo@openerp.com-20120622152536-42b2s28lvdv3odyr in 6.1 |
|||
if mail_sent: |
|||
_logger.info('Mail with ID %r and Message-Id %r successfully sent', mail.id, mail.message_id) |
|||
self._postprocess_sent_message(cr, uid, mail, context=context, mail_sent=mail_sent) |
|||
except MemoryError: |
|||
# prevent catching transient MemoryErrors, bubble up to notify user or abort cron job |
|||
# instead of marking the mail as failed |
|||
_logger.exception('MemoryError while processing mail with ID %r and Msg-Id %r. ' |
|||
'Consider raising the --limit-memory-hard startup option', |
|||
mail.id, mail.message_id) |
|||
raise |
|||
except Exception as e: |
|||
_logger.exception('failed sending mail.mail %s', mail.id) |
|||
mail.write({'state': 'exception'}) |
|||
self._postprocess_sent_message(cr, uid, mail, context=context, mail_sent=False) |
|||
if raise_exception: |
|||
if isinstance(e, AssertionError): |
|||
# get the args of the original error, wrap into a value and throw a MailDeliveryException |
|||
# that is an except_orm, with name and value as arguments |
|||
value = '. '.join(e.args) |
|||
raise MailDeliveryException(_("Mail Delivery Failed"), value) |
|||
raise |
|||
|
|||
if auto_commit is True: |
|||
cr.commit() |
|||
return True |