[tryton-debian-vcs] tryton-server branch upstream-3.8 updated. upstream/3.8.14-1-gcfa9418
Mathias Behrle
tryton-debian-vcs at alioth.debian.org
Sun Nov 12 16:37:36 UTC 2017
The following commit has been merged in the upstream-3.8 branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-server.git;a=commitdiff;h=upstream/3.8.14-1-gcfa9418
commit cfa94186f886462528d1fc31ef2441369de321a8
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Sat Nov 11 14:50:54 2017 +0100
Adding upstream version 3.8.15.
Signed-off-by: Mathias Behrle <mathiasb at m9s.biz>
diff --git a/.drone.yml b/.drone.yml
new file mode 100644
index 0000000..9d7c769
--- /dev/null
+++ b/.drone.yml
@@ -0,0 +1,9 @@
+image: python2.7
+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-{sqlite,postgresql}"
+services:
+ - postgres
diff --git a/CHANGELOG b/CHANGELOG
index 4af3e26..1e6b621 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 3.8.15 - 2017-11-07
+* Bug fixes (see mercurial logs for details)
+
Version 3.8.14 - 2017-08-08
* Bug fixes (see mercurial logs for details)
diff --git a/PKG-INFO b/PKG-INFO
index 17fb790..7f55a8f 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: trytond
-Version: 3.8.14
+Version: 3.8.15
Summary: Tryton server
Home-page: http://www.tryton.org/
Author: Tryton
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 0000000..f8e91e9
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,18 @@
+[tox]
+envlist = py27-{sqlite,postgresql,mysql},pypy-{sqlite,postgresql}
+
+[testenv]
+commands = {envpython} setup.py test
+deps =
+ mock
+ py27-postgresql: psycopg2 >= 2.0
+ pypy-postgresql: psycopg2cffi >= 2.5
+ mysql: MySQL-python
+setenv =
+ sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://}
+ postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://}
+ mysql: TRYTOND_DATABASE_URI={env:MYSQL_URI:mysql://}
+ 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}
diff --git a/trytond.egg-info/PKG-INFO b/trytond.egg-info/PKG-INFO
index 17fb790..7f55a8f 100644
--- a/trytond.egg-info/PKG-INFO
+++ b/trytond.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: trytond
-Version: 3.8.14
+Version: 3.8.15
Summary: Tryton server
Home-page: http://www.tryton.org/
Author: Tryton
diff --git a/trytond.egg-info/SOURCES.txt b/trytond.egg-info/SOURCES.txt
index 7df8bed..ba3f10b 100644
--- a/trytond.egg-info/SOURCES.txt
+++ b/trytond.egg-info/SOURCES.txt
@@ -1,3 +1,5 @@
+.drone.yml
+.hgtags
CHANGELOG
COPYRIGHT
INSTALL
@@ -5,6 +7,7 @@ LICENSE
MANIFEST.in
README
setup.py
+tox.ini
bin/trytond
doc/Makefile
doc/conf.py
@@ -53,6 +56,7 @@ trytond/security.py
trytond/server.py
trytond/test_loader.py
trytond/transaction.py
+trytond/tryton.rnc
trytond/url.py
trytond.egg-info/PKG-INFO
trytond.egg-info/SOURCES.txt
diff --git a/trytond/__init__.py b/trytond/__init__.py
index a7274a6..b78aad1 100644
--- a/trytond/__init__.py
+++ b/trytond/__init__.py
@@ -4,7 +4,7 @@ import os
import time
from email import charset
-__version__ = "3.8.14"
+__version__ = "3.8.15"
os.environ['TZ'] = 'UTC'
if hasattr(time, 'tzset'):
diff --git a/trytond/ir/action.py b/trytond/ir/action.py
index ab55d5c..37f93a8 100644
--- a/trytond/ir/action.py
+++ b/trytond/ir/action.py
@@ -137,7 +137,7 @@ class ActionKeyword(ModelSQL, ModelView):
@classmethod
def search_groups(cls, name, clause):
- return [('action.groups',) + tuple(clause[1:])]
+ return [('action.' + clause[0],) + tuple(clause[1:])]
@classmethod
def validate(cls, actions):
@@ -289,7 +289,7 @@ class ActionMixin(ModelSQL):
@classmethod
def search_action(cls, name, clause):
- return [('action.' + name,) + tuple(clause[1:])]
+ return [('action.' + clause[0],) + tuple(clause[1:])]
@classmethod
def create(cls, vlist):
diff --git a/trytond/ir/translation.py b/trytond/ir/translation.py
index 681b16d..9452fb6 100644
--- a/trytond/ir/translation.py
+++ b/trytond/ir/translation.py
@@ -699,32 +699,10 @@ class Translation(ModelSQL, ModelView):
ModelView._fields_view_get_cache.clear()
vlist = [x.copy() for x in vlist]
- cursor = Transaction().cursor
- table = cls.__table__()
for vals in vlist:
if not vals.get('module'):
if Transaction().context.get('module'):
vals['module'] = Transaction().context['module']
- elif vals.get('type', '') in ('odt', 'view', 'wizard_button',
- 'selection', 'error'):
- cursor.execute(*table.select(table.module,
- where=(table.name == vals.get('name') or '')
- & (table.res_id == vals.get('res_id') or -1)
- & (table.lang == 'en_US')
- & (table.type == vals.get('type') or '')
- & (table.src == vals.get('src') or '')))
- fetchone = cursor.fetchone()
- if fetchone:
- vals['module'] = fetchone[0]
- else:
- cursor.execute(*table.select(table.module, table.src,
- where=(table.name == vals.get('name') or '')
- & (table.res_id == vals.get('res_id') or -1)
- & (table.lang == 'en_US')
- & (table.type == vals.get('type') or '')))
- fetchone = cursor.fetchone()
- if fetchone:
- vals['module'], vals['src'] = fetchone
vals['src_md5'] = cls.get_src_md5(vals.get('src'))
return super(Translation, cls).create(vlist)
diff --git a/trytond/model/modelstorage.py b/trytond/model/modelstorage.py
index e88b15c..b4805b8 100644
--- a/trytond/model/modelstorage.py
+++ b/trytond/model/modelstorage.py
@@ -263,10 +263,16 @@ class ModelStorage(Model):
if 'state' in cls._defaults:
default['state'] = cls._defaults['state']()
+ def is_readonly(Model):
+ return (not issubclass(Model, ModelStorage)
+ or (hasattr(Model, 'table_query')
+ and Model.table_query()))
+
def convert_data(field_defs, data):
data = data.copy()
for field_name in field_defs:
ftype = field_defs[field_name]['type']
+ field = cls._fields[field_name]
if field_name in (
'create_date',
@@ -278,9 +284,8 @@ class ModelStorage(Model):
if field_name in default:
data[field_name] = default[field_name]
- elif (isinstance(cls._fields[field_name], fields.Function)
- and not isinstance(cls._fields[field_name],
- fields.Property)):
+ elif (isinstance(field, fields.Function)
+ and not isinstance(field, fields.Property)):
del data[field_name]
elif ftype in ('many2one', 'one2one'):
try:
@@ -289,10 +294,14 @@ class ModelStorage(Model):
except Exception:
pass
elif ftype in ('one2many',):
- if data[field_name]:
+ if is_readonly(field.get_target()):
+ del data[field_name]
+ elif data[field_name]:
data[field_name] = [('copy', data[field_name])]
elif ftype == 'many2many':
- if data[field_name]:
+ if is_readonly(pool.get(field.relation_name)):
+ del data[field_name]
+ elif data[field_name]:
data[field_name] = [('add', data[field_name])]
if 'id' in data:
del data['id']
@@ -979,12 +988,16 @@ class ModelStorage(Model):
validate_domain(field)
- def required_test(value, field_name):
+ def required_test(value, field_name, field):
if (isinstance(value, (type(None), type(False), list,
tuple, basestring, dict))
and not value):
cls.raise_user_error('required_validation_record',
error_args=cls._get_error_args(field_name))
+ if (field._type == 'reference'
+ and not isinstance(value, ModelStorage)):
+ cls.raise_user_error('required_validation_record',
+ error_args=cls._get_error_args(field_name))
# validate states required
if field.states and 'required' in field.states:
if is_pyson(field.states['required']):
@@ -1000,16 +1013,17 @@ class ModelStorage(Model):
required = PYSONDecoder(env).decode(pyson_required)
if required:
required_test(getattr(record, field_name),
- field_name)
+ field_name, field)
else:
if field.states['required']:
for record in records:
required_test(getattr(record, field_name),
- field_name)
+ field_name, field)
# validate required
if field.required:
for record in records:
- required_test(getattr(record, field_name), field_name)
+ required_test(
+ getattr(record, field_name), field_name, field)
# validate size
if hasattr(field, 'size') and field.size is not None:
for record in records:
diff --git a/trytond/tryton.rnc b/trytond/tryton.rnc
new file mode 100644
index 0000000..fe87698
--- /dev/null
+++ b/trytond/tryton.rnc
@@ -0,0 +1,32 @@
+namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
+
+tryton = element tryton { attlist.tryton, data* }
+attlist.tryton &= empty
+data = element data { attlist.data, (record | menuitem)* }
+attlist.data &=
+ [ a:defaultValue = "0" ] attribute noupdate { "0" | "1" }?
+attlist.data &=
+ [ a:defaultValue = "0" ] attribute grouped { "0" | "1" }?
+attlist.data &= attribute depends { text }
+record = element record { attlist.record, field* }
+attlist.record &= attribute model { text }
+attlist.record &= attribute id { text }
+attlist.record &=
+ [ a:defaultValue = "0" ] attribute update { "0" | "1" }?
+field = element field { attlist.field, text }
+attlist.field &= attribute name { text }
+attlist.field &= attribute search { text }?
+attlist.field &= attribute ref { text }?
+attlist.field &= attribute eval { text }?
+attlist.field &= attribute pyson { "0" | "1" }?
+attlist.field &= attribute type { "xml" }?
+menuitem = element menuitem { attlist.menuitem, empty }
+attlist.menuitem &= attribute id { text }
+attlist.menuitem &= attribute name { text }?
+attlist.menuitem &= attribute icon { text }?
+attlist.menuitem &= attribute sequence { text }?
+attlist.menuitem &= attribute parent { text }?
+attlist.menuitem &= attribute action { text }?
+attlist.menuitem &= attribute groups { text }?
+attlist.menuitem &= attribute active { text }?
+start = tryton
--
tryton-server
More information about the tryton-debian-vcs
mailing list