[tryton-debian-vcs] tryton-server branch debian-squeeze-1.6 created. d8819e90b07b3579bc8f55e5c6ffad5213bda659
Mathias Behrle
tryton-debian-vcs at alioth.debian.org
Wed Nov 27 17:15:10 UTC 2013
The following commit has been merged in the debian-squeeze-1.6 branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-server.git;a=commitdiff;h=d8819e90b07b3579bc8f55e5c6ffad5213bda659
commit d8819e90b07b3579bc8f55e5c6ffad5213bda659
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Wed Feb 9 23:43:44 2011 +0100
Enforcing stronger permissions on trytond.conf in postinst (Closes: #612644).
diff --git a/debian/tryton-server.README.Debian b/debian/tryton-server.README.Debian
index c5ad8c1..f35cb9e 100644
--- a/debian/tryton-server.README.Debian
+++ b/debian/tryton-server.README.Debian
@@ -70,8 +70,9 @@ Now, you're finished. Please be aware of the following things:
Tryton Server).
* trytond must have read access to its configuration file, otherwise it will
- start with internal defaults. The postinst script will (re)set correct
- permissions on the standard configuration file (0644 on /etc/tyond.conf).
+ start with internal defaults. The postinst script will (re)set ownership to
+ the system user running trytond and correct permissions on the standard
+ configuration file (0400 on /etc/tyond.conf).
* trytond listens by default on port 8070 (netrpc). If you need to change
this, edit /etc/trytond.conf and replace 'port = 8070' with
@@ -101,4 +102,4 @@ Now, you're finished. Please be aware of the following things:
* Only the same major version of Tryton Client and Tryton server can connect.
- -- Mathias Behrle <mathiasb at mbsolutions.selfip.biz> Sun, 09 May 2010 12:00:00 +0200
+ -- Mathias Behrle <mathiasb at m9s.biz> Sun, 09 May 2010 12:00:00 +0200
diff --git a/debian/tryton-server.postinst b/debian/tryton-server.postinst
index 46b7108..04c7485 100644
--- a/debian/tryton-server.postinst
+++ b/debian/tryton-server.postinst
@@ -22,10 +22,11 @@ case "${1}" in
chown ${USER}:adm ${LOGFILE}
chmod 0640 ${LOGFILE}
- # Setting permissions on configuration file
+ # Setting ownership and permissions on configuration file
# trytond uses internal defaults, if it cannot read the
# configuration file.
- chmod 0644 ${CONFFILE}
+ chown ${USER}:${USER} ${CONFFILE}
+ chmod 0400 ${CONFFILE}
echo
echo "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"
commit bc7b0a93b365e8684454e8f041e10cea6e1f5ac5
Author: Daniel Baumann <daniel at debian.org>
Date: Sun Nov 21 11:14:02 2010 +0100
Removing --remove-home from deluser call in postinst (Closes: #604214).
diff --git a/debian/tryton-server.postrm b/debian/tryton-server.postrm
index 6472dea..3c8aba8 100644
--- a/debian/tryton-server.postrm
+++ b/debian/tryton-server.postrm
@@ -9,7 +9,7 @@ case "${1}" in
# Removing system user
if [ -x /usr/sbin/deluser ]
then
- deluser --quiet --system --remove-home ${USER}
+ deluser --quiet --system ${USER}
fi
# Removing log file
commit f28b4a4375fe1e0aaa877c407d92252449bf1036
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Sat Nov 20 14:19:58 2010 +0100
Releasing debian version 1.6.2-0~50squeeze1.
diff --git a/debian/changelog b/debian/changelog
index 6a508b4..25ebe87 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+tryton-server (1.6.2-0~50squeeze1) unstable; urgency=low
+
+ * Merging upstream version 1.6.2.
+ * Changing my email address.
+
+ -- Mathias Behrle <mathiasb at m9s.biz> Sat, 20 Nov 2010 14:17:40 +0100
+
tryton-server (1.6.1-1) unstable; urgency=low
[ Daniel Baumann ]
commit c05f023f075e6ec4669b87e54099b1cb60bade64
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Sat Nov 20 14:17:25 2010 +0100
Changing my email address.
diff --git a/debian/control b/debian/control
index 03d3cd3..9fc4354 100644
--- a/debian/control
+++ b/debian/control
@@ -4,7 +4,7 @@ Priority: optional
Maintainer: Debian Tryton Maintainers <tryton at lists.debian-maintainers.org>
Uploaders:
Daniel Baumann <daniel at debian.org>,
- Mathias Behrle <mathiasb at mbsolutions.selfip.biz>
+ Mathias Behrle <mathiasb at m9s.biz>
Dm-Upload-Allowed: yes
Build-Depends: debhelper (>= 7.0.50~), python, python-setuptools, python-support
Standards-Version: 3.9.0
diff --git a/debian/copyright b/debian/copyright
index 8984d11..65a11eb 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -52,7 +52,7 @@ License: GPL-3+
Files: debian/*
Copyright:
(C) 2009-2010 Daniel Baumann <daniel at debian.org>
- (C) 2010 Mathias Behrle <mathiasb at mbsolutions.selfip.biz>
+ (C) 2010 Mathias Behrle <mathiasb at m9s.biz>
License: GPL-3+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
commit 3f619f5048cd603dbd1b4097d922f0a89be08ca6
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Sat Nov 20 14:12:28 2010 +0100
Merging upstream version 1.6.2.
diff --git a/CHANGELOG b/CHANGELOG
index a1aed9a..f287299 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 1.6.2 - 2010-11-02
+* Bug fixes (see mercurial logs for details)
+
Version 1.6.1 - 2010-07-29
* Bug fixes (see mercurial logs for details)
* Make _timestamp numeric instead of datetime to work with XML-RPC and JSON-RPC
diff --git a/PKG-INFO b/PKG-INFO
index 6e68007..dc7d3d7 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: trytond
-Version: 1.6.1
+Version: 1.6.2
Summary: Tryton server
Home-page: http://www.tryton.org/
Author: B2CK
diff --git a/trytond.egg-info/PKG-INFO b/trytond.egg-info/PKG-INFO
index 6e68007..dc7d3d7 100644
--- a/trytond.egg-info/PKG-INFO
+++ b/trytond.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: trytond
-Version: 1.6.1
+Version: 1.6.2
Summary: Tryton server
Home-page: http://www.tryton.org/
Author: B2CK
diff --git a/trytond/backend/postgresql/database.py b/trytond/backend/postgresql/database.py
index d737148..f88caf1 100644
--- a/trytond/backend/postgresql/database.py
+++ b/trytond/backend/postgresql/database.py
@@ -10,6 +10,10 @@ from psycopg2.extensions import ISOLATION_LEVEL_SERIALIZABLE
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT
from psycopg2.extensions import register_type, register_adapter
from psycopg2.extensions import UNICODE, AsIs
+try:
+ from psycopg2.extensions import PYDATE, PYDATETIME, PYTIME
+except ImportError:
+ PYDATE, PYDATETIME, PYTIME = None, None, None
from psycopg2 import IntegrityError as DatabaseIntegrityError
from psycopg2 import OperationalError as DatabaseOperationalError
import time
@@ -19,6 +23,7 @@ import os
if os.name == 'posix':
import pwd
from decimal import Decimal
+from trytond.protocols.datatype import Float
RE_FROM = re.compile('.* from "?([a-zA-Z_0-9]+)"?.*$')
RE_INTO = re.compile('.* into "?([a-zA-Z_0-9]+)"?.*$')
@@ -395,6 +400,13 @@ class Cursor(CursorInterface):
return select
register_type(UNICODE)
+if PYDATE:
+ register_type(PYDATE)
+if PYDATETIME:
+ register_type(PYDATETIME)
+if PYTIME:
+ register_type(PYTIME)
register_adapter(Session, AsIs)
register_adapter(float, lambda value: AsIs(repr(value)))
+register_adapter(Float, lambda value: AsIs(repr(value)))
register_adapter(Decimal, lambda value: AsIs(str(value)))
diff --git a/trytond/ir/rule.py b/trytond/ir/rule.py
index 7711d5f..74cf632 100644
--- a/trytond/ir/rule.py
+++ b/trytond/ir/rule.py
@@ -148,6 +148,11 @@ class Rule(ModelSQL, ModelView):
assert mode in ['read', 'write', 'create', 'delete'], \
'Invalid domain mode for security'
+ # Fix for issue1661
+ if (model_name in ('ir.sequence', 'ir.sequence.strict')
+ and mode == 'read'):
+ return '', []
+
# root user above constraint
if user == 0:
if not context.get('user'):
diff --git a/trytond/ir/translation.py b/trytond/ir/translation.py
index 65e0e39..6853a92 100644
--- a/trytond/ir/translation.py
+++ b/trytond/ir/translation.py
@@ -687,9 +687,9 @@ class ReportTranslationSet(Wizard):
if not done:
cursor.execute('INSERT INTO ir_translation ' \
'(name, lang, type, src, value, module, fuzzy)' \
- 'VALUES (%s, %s, %s, %s, %s, %s, False)',
+ 'VALUES (%s, %s, %s, %s, %s, %s, %s)',
(report.report_name, 'en_US', 'odt', string, '',
- report.module))
+ report.module, False))
if strings:
cursor.execute('DELETE FROM ir_translation ' \
'WHERE name = %s ' \
diff --git a/trytond/ir/ui/form.rnc b/trytond/ir/ui/form.rnc
index 83c2eec..ecda2bd 100644
--- a/trytond/ir/ui/form.rnc
+++ b/trytond/ir/ui/form.rnc
@@ -206,6 +206,7 @@ attlist.group &= [ a:defaultValue = "1" ] attribute fill { "0" | "1" }?
attlist.group &= [ a:defaultValue = "1" ] attribute rowspan { text }?
attlist.group &= [ a:defaultValue = "4" ] attribute col { text }?
attlist.group &= ( attribute name { text } | attribute id { text } )
+attlist.group &= attribute states { text }?
hpaned = element hpaned { attlist.paned, child* }
diff --git a/trytond/ir/ui/form.rng b/trytond/ir/ui/form.rng
index 91133a8..ba1c5c2 100644
--- a/trytond/ir/ui/form.rng
+++ b/trytond/ir/ui/form.rng
@@ -747,6 +747,11 @@
<attribute name="id"/>
</choice>
</define>
+ <define name="attlist.group" combine="interleave">
+ <optional>
+ <attribute name="states"/>
+ </optional>
+ </define>
<define name="hpaned">
<element name="hpaned">
<ref name="attlist.paned"/>
diff --git a/trytond/model/model.py b/trytond/model/model.py
index f4a766d..8e5b420 100644
--- a/trytond/model/model.py
+++ b/trytond/model/model.py
@@ -101,33 +101,30 @@ class Model(object):
self._rpc[on_change_with] = False
def __getattr__(self, name):
- try:
- super(Model, self).__getattr__(name)
- except AttributeError:
- # Search if a function exists in inherits parents
- for model_name, field_name in self._inherits.iteritems():
- model_obj = self.pool.get(model_name)
- if hasattr(model_obj, name) and \
- callable(getattr(model_obj, name)):
- def func(cursor, user, *args, **kwargs):
- if args:
- ids = args[0]
- int_id = False
- if isinstance(ids, (int, long)):
- int_id = True
- ids = [ids]
- if reduce(lambda x, y: x and
- isinstance(y, (int, long)), ids, True):
- # Replace ids by the parent ids
- ids = [getattr(x, field_name).id for x in
- self.browse(cursor, user, ids)]
- if int_id:
- ids = ids[0]
- args = tuple([ids] + list(args[1:]))
- return getattr(model_obj, name)(cursor, user, *args,
- **kwargs)
- return func
- raise
+ # Search if a function exists in inherits parents
+ for model_name, field_name in self._inherits.iteritems():
+ model_obj = self.pool.get(model_name)
+ if hasattr(model_obj, name) and \
+ callable(getattr(model_obj, name)):
+ def func(cursor, user, *args, **kwargs):
+ if args:
+ ids = args[0]
+ int_id = False
+ if isinstance(ids, (int, long)):
+ int_id = True
+ ids = [ids]
+ if reduce(lambda x, y: x and
+ isinstance(y, (int, long)), ids, True):
+ # Replace ids by the parent ids
+ ids = [getattr(x, field_name).id for x in
+ self.browse(cursor, user, ids)]
+ if int_id:
+ ids = ids[0]
+ args = tuple([ids] + list(args[1:]))
+ return getattr(model_obj, name)(cursor, user, *args,
+ **kwargs)
+ return func
+ raise AttributeError
def _inherits_reload(self):
"""
diff --git a/trytond/model/modelsql.py b/trytond/model/modelsql.py
index 336bd16..97f509f 100644
--- a/trytond/model/modelsql.py
+++ b/trytond/model/modelsql.py
@@ -1034,6 +1034,8 @@ class ModelSQL(ModelStorage):
if hasattr(model, 'table_query') \
and model.table_query(context):
continue
+ if not isinstance(model, ModelStorage):
+ continue
for field_name, field in model._columns.iteritems():
if isinstance(field, fields.Many2One) \
and field.model_name == self._name:
@@ -1537,36 +1539,30 @@ class ModelSQL(ModelStorage):
domain[i] = ('id', 'not in', ids2 + _rec_get(ids2,
table, domain[i][0]))
else:
- if isinstance(domain[i][2], basestring):
- res_ids = [x[0] for x in target_obj.search(cursor, user,
- [
- ('rec_name', domain[i][1], domain[i][2]),
- ], order=[], context=context)]
- elif isinstance(domain[i][2], (int, long)) \
- and not isinstance(domain[i][2], bool):
- res_ids = [domain[i][2]]
- else:
- res_ids = domain[i][2]
- if res_ids == True or res_ids == False:
+ if isinstance(domain[i][2], bool):
relation_obj = self.pool.get(field.relation_name)
query1 = 'SELECT "' + field.origin + '" ' \
'FROM "' + relation_obj._table + '" '\
'WHERE "' + field.origin + '" IS NOT NULL'
query2 = []
clause = 'inselect'
- if res_ids == False:
+ if domain[i][2] == False:
clause = 'notinselect'
domain[i] = ('id', clause, (query1, query2))
- elif not res_ids:
- domain[i] = ('id', '=', '0')
else:
+ if isinstance(domain[i][2], basestring):
+ target_field = 'rec_name'
+ else:
+ target_field = 'id'
relation_obj = self.pool.get(field.relation_name)
- red_sql, red_ids = reduce_ids('"' + field.target + '"',
- res_ids)
- query1 = 'SELECT "' + field.origin + '" ' \
- 'FROM "' + relation_obj._table + '" ' \
- 'WHERE ' + red_sql
- query2 = red_ids
+
+ query1, query2 = target_obj.search(cursor, user, [
+ (target_field, domain[i][1], domain[i][2]),
+ ], order=[], query_string=True,
+ context=context)
+ query1 = ('SELECT "%s" FROM "%s" WHERE "%s" IN (%s)' %
+ (field.origin, relation_obj._table,
+ field.target, query1))
domain[i] = ('id', 'inselect', (query1, query2))
i += 1
diff --git a/trytond/report/report.py b/trytond/report/report.py
index 773d76a..7614fbf 100644
--- a/trytond/report/report.py
+++ b/trytond/report/report.py
@@ -191,7 +191,8 @@ class Report(object):
if file.startswith('Pictures'):
picture = style2_z.read(file)
pictures.append((file, picture))
- manifest.add_file_entry(file)
+ if manifest:
+ manifest.add_file_entry(file)
style2_z.close()
style2_io.close()
dom_style2 = xml.dom.minidom.parseString(style2_xml)
diff --git a/trytond/version.py b/trytond/version.py
index 524015e..7f600bb 100644
--- a/trytond/version.py
+++ b/trytond/version.py
@@ -1,7 +1,7 @@
#This file is part of Tryton. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
PACKAGE = "trytond"
-VERSION = "1.6.1"
+VERSION = "1.6.2"
LICENSE = "GPL-3"
WEBSITE = "http://www.tryton.org/"
--
tryton-server
More information about the tryton-debian-vcs
mailing list