-
-
+
diff --git a/bin/osv/expression.py b/bin/osv/expression.py
index d95852d4f35..01964196bd1 100644
--- a/bin/osv/expression.py
+++ b/bin/osv/expression.py
@@ -203,6 +203,8 @@ class expression(object):
return self
def __leaf_to_sql(self, leaf, table):
+ if leaf == self.__DUMMY_LEAF:
+ return ('(1=1)',[])
left, operator, right = leaf
if operator == 'inselect':
diff --git a/bin/osv/orm.py b/bin/osv/orm.py
index 168ffb9d252..0c6881a0476 100644
--- a/bin/osv/orm.py
+++ b/bin/osv/orm.py
@@ -295,15 +295,14 @@ class orm_template(object):
_table = None
def _field_create(self, cr, context={}):
- cr.execute("SELECT id FROM ir_model WHERE model='%s'" % self._name)
+ cr.execute("SELECT id FROM ir_model_data WHERE name='%s'" % ('model_'+self._name.replace('.','_'),))
if not cr.rowcount:
- # reference model in order to have a description of its fonctionnality in custom_report
cr.execute('SELECT nextval(%s)', ('ir_model_id_seq',))
id = cr.fetchone()[0]
cr.execute("INSERT INTO ir_model (id,model, name, info) VALUES (%s, %s, %s, %s)", (id, self._name, self._description, self.__doc__))
if 'module' in context:
cr.execute("INSERT INTO ir_model_data (name,date_init,date_update,module,model,res_id) VALUES (%s, now(), now(), %s, %s, %s)", \
- ('model_'+self._table, context['module'], 'ir.model', id)
+ ('model_'+self._name.replace('.','_'), context['module'], 'ir.model', id)
)
cr.commit()
diff --git a/bin/reportlab/lib/PyFontify.py b/bin/reportlab/lib/PyFontify.py
index 309f7740df9..27695c25620 100644
--- a/bin/reportlab/lib/PyFontify.py
+++ b/bin/reportlab/lib/PyFontify.py
@@ -32,8 +32,8 @@ import re
# First a little helper, since I don't like to repeat things. (Tismer speaking)
import string
-def replace(where, what, with):
- return string.join(string.split(where, what), with)
+def replace(where, what, with_whom):
+ return string.join(string.split(where, what), with_whom)
# This list of keywords is taken from ref/node13.html of the
# Python 1.3 HTML documentation. ("access" is intentionally omitted.)
diff --git a/bin/tools/translate.py b/bin/tools/translate.py
index c585367b40f..81fe0de05e7 100644
--- a/bin/tools/translate.py
+++ b/bin/tools/translate.py
@@ -368,6 +368,8 @@ def trans_generate(lang, modules, dbname=None):
elif model=='ir.model.fields':
field_name = obj.name
+ if not field_name in pool.get(obj.model)._columns:
+ continue
field_def = pool.get(obj.model)._columns[field_name]
name = obj.model + "," + field_name