diff --git a/bin/addons/base/ir/ir_model.py b/bin/addons/base/ir/ir_model.py
index 105ffece9dc..6ee219378fa 100644
--- a/bin/addons/base/ir/ir_model.py
+++ b/bin/addons/base/ir/ir_model.py
@@ -244,13 +244,12 @@ class ir_model_fields(osv.osv):
if not vals['name'].startswith('x_'):
raise except_orm(_('Error'), _("Custom fields must have a name that starts with 'x_' !"))
- model_ids = self.pool.get('ir.model').search(cr, user, [('model','=',vals['relation'])])
- if model_ids:
- if self.pool.get(vals['model']):
- self.pool.get(vals['model']).__init__(self.pool, cr)
- self.pool.get(vals['model'])._auto_init(cr, {})
- else:
- raise except_orm(_('Error'), _("Model %s Does not Exist !" % vals['relation']))
+ if 'relation' in vals and not self.pool.get('ir.model').search(cr, user, [('model','=',vals['relation'])]):
+ raise except_orm(_('Error'), _("Model %s Does not Exist !" % vals['relation']))
+
+ if self.pool.get(vals['model']):
+ self.pool.get(vals['model']).__init__(self.pool, cr)
+ self.pool.get(vals['model'])._auto_init(cr, {})
return res
ir_model_fields()
@@ -451,6 +450,7 @@ class ir_model_data(osv.osv):
cr.execute('select id from '+model_obj._table+' where id=%s', (res_id2,))
result3 = cr.fetchone()
if not result3:
+ self._get_id.clear_cache(cr.dbname, uid, module, xml_id)
cr.execute('delete from ir_model_data where id=%s', (action_id2,))
res_id = False
else:
diff --git a/bin/addons/base/res/__init__.py b/bin/addons/base/res/__init__.py
index 91f47a8ba42..08dfa3f640d 100644
--- a/bin/addons/base/res/__init__.py
+++ b/bin/addons/base/res/__init__.py
@@ -24,11 +24,11 @@ import tools
import country
import bank
+import res_lang
import partner
import res_currency
import res_company
import res_user
-import res_lang
import res_request
diff --git a/bin/addons/base/res/partner/partner.py b/bin/addons/base/res/partner/partner.py
index 43b857c1cb6..72f06c0b2dd 100644
--- a/bin/addons/base/res/partner/partner.py
+++ b/bin/addons/base/res/partner/partner.py
@@ -118,13 +118,6 @@ def _partner_title_get(self, cr, uid, context={}):
res = obj.read(cr, uid, ids, ['shortcut','name'], context)
return [(r['shortcut'], r['name']) for r in res]
-def _lang_get(self, cr, uid, context={}):
- obj = self.pool.get('res.lang')
- ids = obj.search(cr, uid, [], context=context)
- res = obj.read(cr, uid, ids, ['code', 'name'], context)
- return [(r['code'], r['name']) for r in res] + [('','')]
-
-
class res_partner(osv.osv):
_description='Partner'
_name = "res.partner"
@@ -136,7 +129,7 @@ class res_partner(osv.osv):
'parent_id': fields.many2one('res.partner','Main Company', select=2),
'child_ids': fields.one2many('res.partner', 'parent_id', 'Partner Ref.'),
'ref': fields.char('Code', size=64),
- 'lang': fields.selection(_lang_get, 'Language', size=5, help="If the selected language is loaded in the system, all documents related to this partner will be printed in this language. If not, it will be english."),
+ 'lang': fields.many2one('res.lang', 'Language', help="If the selected language is loaded in the system, all documents related to this partner will be printed in this language. If not, it will be english."),
'user_id': fields.many2one('res.users', 'Dedicated Salesman', help='The internal user that is in charge of communicating with this partner if any.'),
'vat': fields.char('VAT',size=32 ,help="Value Added Tax number. Check the box if the partner is subjected to the VAT. Used by the VAT legal statement."),
'bank_ids': fields.one2many('res.partner.bank', 'partner_id', 'Banks'),
diff --git a/bin/addons/base/res/partner/partner_demo.xml b/bin/addons/base/res/partner/partner_demo.xml
index ced4f04ae99..731dda1187b 100644
--- a/bin/addons/base/res/partner/partner_demo.xml
+++ b/bin/addons/base/res/partner/partner_demo.xml
@@ -102,7 +102,6 @@
Bank Wealthy and sons
- en_US
China Export
diff --git a/bin/addons/base/res/partner/partner_view.xml b/bin/addons/base/res/partner/partner_view.xml
index 127a44e4549..2a3796b127d 100644
--- a/bin/addons/base/res/partner/partner_view.xml
+++ b/bin/addons/base/res/partner/partner_view.xml
@@ -229,7 +229,7 @@
-
+
diff --git a/bin/osv/expression.py b/bin/osv/expression.py
index 2ee1492ddd0..9cad5137387 100644
--- a/bin/osv/expression.py
+++ b/bin/osv/expression.py
@@ -254,8 +254,12 @@ class expression(object):
query = '(%s OR %s IS NULL)' % (query, left)
else:
params = []
- if (((right == False) and (type(right)==bool)) or (right is None)) and (operator == '='):
- query = '%s.%s IS NULL' % (table._table, left)
+ if right == False and table._columns[leaf[0]]._type=="boolean" and (operator == '='):
+ query = '%s.%s IS NULL or %s.%s = false ' % (table._table, left,table._table, left)
+ elif (((right == False) and (type(right)==bool)) or (right is None)) and (operator == '='):
+ query = '%s.%s IS NULL ' % (table._table, left)
+ elif right == False and table._columns[leaf[0]]._type=="boolean" and (operator in ['<>', '!=']):
+ query = '%s.%s IS NOT NULL and %s.%s != false' % (table._table, left,table._table, left)
elif (((right == False) and (type(right)==bool)) or right is None) and (operator in ['<>', '!=']):
query = '%s.%s IS NOT NULL' % (table._table, left)
else:
diff --git a/bin/report/report_sxw.py b/bin/report/report_sxw.py
index 9d2ca509470..19ca17ae1a3 100644
--- a/bin/report/report_sxw.py
+++ b/bin/report/report_sxw.py
@@ -200,6 +200,7 @@ class rml_parse(object):
try :
att_id = int(attach_id)
attachment = self.pool.get('ir.attachment').browse(self.cr,self.uid,att_id)
+ return attachment.datas
except :
return ''
@@ -500,20 +501,19 @@ class report_sxw(report_rml, preprocess.report):
report_type = 'html'
context['parents'] = html_parents
- rml = report_xml.report_rml_content
-
- rml_parser = self.parser(cr, uid, self.name2, context)
- rml_parser.parents = html_parents
- rml_parser.tag = sxw_tag
+ html = report_xml.report_rml_content
+ html_parser = self.parser(cr, uid, self.name2, context)
+ html_parser.parents = html_parents
+ html_parser.tag = sxw_tag
objs = self.getObjects(cr, uid, ids, context)
- rml_parser.set_context(objs, data, ids, report_type)
+ html_parser.set_context(objs, data, ids, report_type)
+
+ html_dom = etree.HTML(html)
+ html_dom = self.preprocess_rml(html_dom,'html2html')
- rml_dom = etree.HTML(rml)
- rml_dom = self.preprocess_rml(rml_dom,'html2html')
create_doc = self.generators['html2html']
- html = etree.tostring(create_doc(rml_dom, rml_parser.localcontext))
-
- return (html, report_type)
+ html = etree.tostring(create_doc(html_dom, html_parser.localcontext))
+ return (html.replace('<', '<').replace('>', '>').replace('',''), report_type)