diff --git a/.drone.yml b/.drone.yml index c4fd423..897fc2e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,9 +1,57 @@ -image: python:all -env: - - POSTGRESQL_URI=postgresql://postgres@127.0.0.1:5432/ - - MYSQL_URI=mysql://root@127.0.0.1:3306/ -script: - - pip install tox - - tox -e "{py27,py33,py34,py35}-{sqlite,postgresql}" --skip-missing-interpreters +clone: + hg: + image: plugins/hg + +pipeline: + tox: + image: ${IMAGE} + environment: + - CFLAGS=-O0 + - DB_CACHE=/cache + - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE + - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ + commands: + - pip install tox + - tox -e "${TOXENV}-${DATABASE}" + notify: + image: drillster/drone-email + from: drone@localhost + host: smtp + port: 25 + skip_verify: true + when: + status: [ changed, failure ] + services: - - postgres + postgresql: + image: postgres + when: + matrix: + DATABASE: postgresql + +matrix: + include: + - IMAGE: python:2.7 + TOXENV: py27 + DATABASE: sqlite + - IMAGE: python:2.7 + TOXENV: py27 + DATABASE: postgresql + - IMAGE: python:3.4 + TOXENV: py34 + DATABASE: sqlite + - IMAGE: python:3.4 + TOXENV: py34 + DATABASE: postgresql + - IMAGE: python:3.5 + TOXENV: py35 + DATABASE: sqlite + - IMAGE: python:3.5 + TOXENV: py35 + DATABASE: postgresql + - IMAGE: python:3.6 + TOXENV: py36 + DATABASE: sqlite + - IMAGE: python:3.6 + TOXENV: py36 + DATABASE: postgresql diff --git a/electronic_mail.py b/electronic_mail.py index ecee958..6591346 100644 --- a/electronic_mail.py +++ b/electronic_mail.py @@ -3,7 +3,7 @@ # copyright notices and license terms. from datetime import datetime -from trytond.model import ModelSQL, ModelView, fields +from trytond.model import ModelSQL, ModelView, fields, DeactivableMixin from trytond.pool import Pool, PoolMeta from trytond.pyson import Bool, Eval, Not from trytond.transaction import Transaction @@ -12,7 +12,7 @@ from trytond.transaction import Transaction __all__ = ['ElectronicMailFilter', 'SearchingStart'] -class ElectronicMailFilter(ModelSQL, ModelView): +class ElectronicMailFilter(DeactivableMixin, ModelSQL, ModelView): 'eMail Filter' __name__ = 'electronic.mail.filter' @@ -23,7 +23,6 @@ class ElectronicMailFilter(ModelSQL, ModelView): model = fields.Function(fields.Many2One('ir.model', 'Model'), 'on_change_with_model') cron = fields.Many2One('ir.cron', 'Cron', readonly=True) - active = fields.Boolean('Active') profile = fields.Many2One('searching.profile', 'Profile', domain=[ ('model', '=', Eval('model')), @@ -77,10 +76,6 @@ class ElectronicMailFilter(ModelSQL, ModelView): }, }) - @staticmethod - def default_active(): - return True - @staticmethod def default_mix_operator(): return 'all' diff --git a/electronic_mail.xml b/electronic_mail.xml index 7a4361b..e9b2382 100644 --- a/electronic_mail.xml +++ b/electronic_mail.xml @@ -32,6 +32,26 @@ copyright notices and license terms. --> + + test_profile + Test Profile + + + + send_emails + Send emails + + + + create_cron + Create Cron + + + + delete_cron + Delete Cron + + = 2.5 + {py27,py34,py35,py36}-postgresql: psycopg2 >= 2.5 pypy-postgresql: psycopg2cffi >= 2.5 mysql: MySQL-python + sqlite: sqlitebck setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} @@ -14,4 +15,4 @@ setenv = sqlite: DB_NAME={env:SQLITE_NAME::memory:} postgresql: DB_NAME={env:POSTGRESQL_NAME:test} mysql: DB_NAME={env:MYSQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/ {opts} {packages} +install_command = pip install --pre --process-dependency-links {opts} {packages} diff --git a/tryton.cfg b/tryton.cfg index 804ecf0..d7944c4 100644 --- a/tryton.cfg +++ b/tryton.cfg @@ -1,5 +1,5 @@ [tryton] -version=4.2.0 +version=4.8.0 depends: ir res diff --git a/view/electronic_mail_filter_form.xml b/view/electronic_mail_filter_form.xml index 4fbd68c..9ad3bfd 100644 --- a/view/electronic_mail_filter_form.xml +++ b/view/electronic_mail_filter_form.xml @@ -16,19 +16,19 @@ copyright notices and license terms. --> -