Update to 4.8 [CI SKIP]
This commit is contained in:
parent
2973da8c30
commit
46c7c8dfd4
64
.drone.yml
64
.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
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -32,6 +32,26 @@ copyright notices and license terms. -->
|
|||
<field name="view" ref="view_electronic_mail_filter_form"/>
|
||||
<field name="act_window" ref="action_electronic_mail_filter"/>
|
||||
</record>
|
||||
<record model="ir.model.button" id="electronic_mail_test_profile_button">
|
||||
<field name="name">test_profile</field>
|
||||
<field name="string">Test Profile</field>
|
||||
<field name="model" search="[('model', '=', 'electronic.mail.filter')]"/>
|
||||
</record>
|
||||
<record model="ir.model.button" id="electronic_mail_send_emails_button">
|
||||
<field name="name">send_emails</field>
|
||||
<field name="string">Send emails</field>
|
||||
<field name="model" search="[('model', '=', 'electronic.mail.filter')]"/>
|
||||
</record>
|
||||
<record model="ir.model.button" id="electronic_mail_create_cron_button">
|
||||
<field name="name">create_cron</field>
|
||||
<field name="string">Create Cron</field>
|
||||
<field name="model" search="[('model', '=', 'electronic.mail.filter')]"/>
|
||||
</record>
|
||||
<record model="ir.model.button" id="electronic_mail_delete_cron_button">
|
||||
<field name="name">delete_cron</field>
|
||||
<field name="string">Delete Cron</field>
|
||||
<field name="model" search="[('model', '=', 'electronic.mail.filter')]"/>
|
||||
</record>
|
||||
<menuitem
|
||||
name="Electronic Mail Filters"
|
||||
id="menu_electronic_mail_filter"
|
||||
|
|
31
setup.py
31
setup.py
|
@ -12,7 +12,10 @@ try:
|
|||
except ImportError:
|
||||
from ConfigParser import ConfigParser
|
||||
|
||||
MODULE2PREFIX = {}
|
||||
MODULE2PREFIX = {
|
||||
'electronic_mail_template': 'trytonzz',
|
||||
'searching': 'trytonzz',
|
||||
}
|
||||
|
||||
|
||||
def read(fname):
|
||||
|
@ -20,6 +23,7 @@ def read(fname):
|
|||
os.path.join(os.path.dirname(__file__), fname),
|
||||
'r', encoding='utf-8').read()
|
||||
|
||||
|
||||
def get_require_version(name):
|
||||
if minor_version % 2:
|
||||
require = '%s >= %s.%s.dev0, < %s.%s'
|
||||
|
@ -29,6 +33,7 @@ def get_require_version(name):
|
|||
major_version, minor_version + 1)
|
||||
return require
|
||||
|
||||
|
||||
config = ConfigParser()
|
||||
config.readfp(open('tryton.cfg'))
|
||||
info = dict(config.items('tryton'))
|
||||
|
@ -40,9 +45,9 @@ major_version, minor_version, _ = version.split('.', 2)
|
|||
major_version = int(major_version)
|
||||
minor_version = int(minor_version)
|
||||
name = 'trytonzz_electronic_mail_filter'
|
||||
download_url = 'https://bitbucket.org/zikzakmedia/trytond-electronic_mail_filter'
|
||||
download_url = 'https://bitbucket.org/datalife_sco/trytond-electronic_mail_filter'
|
||||
|
||||
requires = []
|
||||
requires = ['emailvalid']
|
||||
for dep in info.get('depends', []):
|
||||
if not re.match(r'(ir|res)(\W|$)', dep):
|
||||
prefix = MODULE2PREFIX.get(dep, 'trytond')
|
||||
|
@ -50,7 +55,25 @@ for dep in info.get('depends', []):
|
|||
requires.append(get_require_version('trytond'))
|
||||
|
||||
tests_require = []
|
||||
dependency_links = []
|
||||
series = '%s.%s' % (major_version, minor_version)
|
||||
if minor_version % 2:
|
||||
branch = 'default'
|
||||
else:
|
||||
branch = series
|
||||
dependency_links = [
|
||||
('hg+https://bitbucket.org/nantic/'
|
||||
'trytond-electronic_mail_template@%(branch)s'
|
||||
'#egg=trytonzz_electronic_mail_template-%(series)s' % {
|
||||
'branch': branch,
|
||||
'series': series,
|
||||
}),
|
||||
('hg+https://bitbucket.org/datalife_sco/'
|
||||
'trytond-searching@%(branch)s'
|
||||
'#egg=trytonzz_searching-%(series)s' % {
|
||||
'branch': branch,
|
||||
'series': series,
|
||||
})
|
||||
]
|
||||
if minor_version % 2:
|
||||
# Add development index for testing with proteus
|
||||
dependency_links.append('https://trydevpi.tryton.org/')
|
||||
|
|
7
tox.ini
7
tox.ini
|
@ -1,12 +1,13 @@
|
|||
[tox]
|
||||
envlist = {py27,py33,py34,py35}-{sqlite,postgresql,mysql},pypy-{sqlite,postgresql}
|
||||
envlist = {py27,py34,py35,py36}-{sqlite,postgresql,mysql},pypy-{sqlite,postgresql}
|
||||
|
||||
[testenv]
|
||||
commands = {envpython} setup.py test
|
||||
deps =
|
||||
{py27,py33,py34,py35}-postgresql: psycopg2 >= 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}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[tryton]
|
||||
version=4.2.0
|
||||
version=4.8.0
|
||||
depends:
|
||||
ir
|
||||
res
|
||||
|
|
|
@ -16,19 +16,19 @@ copyright notices and license terms. -->
|
|||
<notebook colspan="4">
|
||||
<page string="Profile" id="profile">
|
||||
<field name="profile" colspan="4"/>
|
||||
<button name="test_profile" string="Test Profile"
|
||||
<button name="test_profile"
|
||||
icon="tryton-preferences"/>
|
||||
<button name="send_emails" string="Send emails"
|
||||
<button name="send_emails"
|
||||
icon="tryton-mail-message"/>
|
||||
</page>
|
||||
<page string="Cron" id="cron">
|
||||
<label name="cron"/>
|
||||
<field name="cron"/>
|
||||
<group colspan="2" col="2" id="buttons">
|
||||
<button name="create_cron" string="Create Cron"
|
||||
<button name="create_cron"
|
||||
icon="tryton-new"
|
||||
confirm="Are you sure to create the cron?"/>
|
||||
<button name="delete_cron" string="Delete Cron"
|
||||
<button name="delete_cron"
|
||||
icon="tryton-close"
|
||||
confirm="Are you sure to delete the cron?"/>
|
||||
</group>
|
||||
|
|
Loading…
Reference in New Issue