diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml
index 2bab40ee457..24837cff586 100644
--- a/addons/crm/crm_lead_view.xml
+++ b/addons/crm/crm_lead_view.xml
@@ -156,7 +156,7 @@
-
+
@@ -421,8 +421,7 @@
-
+
diff --git a/addons/document/document.py b/addons/document/document.py
index 6cb2cabbf38..1671b6bc1ba 100644
--- a/addons/document/document.py
+++ b/addons/document/document.py
@@ -117,8 +117,22 @@ class document_file(osv.osv):
# take partner from uid
if vals.get('res_id', False) and vals.get('res_model', False) and not vals.get('partner_id', False):
vals['partner_id'] = self.__get_partner_id(cr, uid, vals['res_model'], vals['res_id'], context)
+ if vals.get('datas', False):
+ vals['file_type'], vals['index_content'] = self._index(cr, uid, vals['datas'].decode('base64'), vals.get('datas_fname', False), None)
return super(document_file, self).create(cr, uid, vals, context)
+ def write(self, cr, uid, ids, vals, context=None):
+ if context is None:
+ context = {}
+ if vals.get('datas', False):
+ vals['file_type'], vals['index_content'] = self._index(cr, uid, vals['datas'].decode('base64'), vals.get('datas_fname', False), None)
+ return super(document_file, self).write(cr, uid, ids, vals, context)
+
+ def _index(self, cr, uid, data, datas_fname, file_type):
+ mime, icont = cntIndex.doIndex(data, datas_fname, file_type or None, None)
+ icont_u = ustr(icont)
+ return mime, icont_u
+
def __get_partner_id(self, cr, uid, res_model, res_id, context=None):
""" A helper to retrieve the associated partner from any res_model+id
It is a hack that will try to discover if the mentioned record is
diff --git a/addons/document/document_view.xml b/addons/document/document_view.xml
index 4c2456de827..68f294b251c 100644
--- a/addons/document/document_view.xml
+++ b/addons/document/document_view.xml
@@ -167,7 +167,7 @@
-
+
diff --git a/addons/hr_evaluation/hr_evaluation_view.xml b/addons/hr_evaluation/hr_evaluation_view.xml
index 54baee5f538..52b288fdad5 100644
--- a/addons/hr_evaluation/hr_evaluation_view.xml
+++ b/addons/hr_evaluation/hr_evaluation_view.xml
@@ -140,7 +140,7 @@
-
+
diff --git a/addons/lunch/lunch.py b/addons/lunch/lunch.py
index 0a693f50a3f..f61ecc8eb7d 100644
--- a/addons/lunch/lunch.py
+++ b/addons/lunch/lunch.py
@@ -94,9 +94,8 @@ class lunch_order(osv.Model):
"""
today = datetime.now().isoweekday()
assert 1 <= today <= 7, "Should be between 1 and 7"
- mapping = dict((idx, name) for idx, name in enumerate('monday tuestday wednesday thursday friday saturday sunday'.split()))
- if today in mapping:
- return mapping[today]
+ mapping = dict((idx, name) for idx, name in enumerate('days monday tuesday wednesday thursday friday saturday sunday'.split()))
+ return alert[mapping[today]]
def can_display_alert(self, alert):
"""
diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml
index 0edda45b6d1..18fdb739923 100644
--- a/addons/sale/sale_view.xml
+++ b/addons/sale/sale_view.xml
@@ -156,7 +156,7 @@
-
+
@@ -246,7 +246,7 @@