diff --git a/addons/crm/crm_helpdesk_view.xml b/addons/crm/crm_helpdesk_view.xml index ee161235c57..9a8bcbe5679 100644 --- a/addons/crm/crm_helpdesk_view.xml +++ b/addons/crm/crm_helpdesk_view.xml @@ -9,9 +9,9 @@ Helpdesk Categories crm.case.categ form - - [('object_id.model', '=', 'crm.helpdesk')] - {'object_id':'crm.helpdesk'} + + [('object_id.model', '=', 'crm.helpdesk')] + {'object_id':'crm.helpdesk'} # ------------------------------------------------------ @@ -26,9 +26,9 @@ - + - + @@ -36,10 +36,10 @@ - + - + @@ -156,7 +156,7 @@ - + CRM - Helpdesk Search crm.helpdesk @@ -184,11 +184,11 @@ - + - + help="My section"/> + diff --git a/addons/document/document_view.xml b/addons/document/document_view.xml index 658dfc3630e..cdbdf161891 100644 --- a/addons/document/document_view.xml +++ b/addons/document/document_view.xml @@ -43,11 +43,11 @@ form tree,form - + parent="menu_document_management_configuration"/> document.directory @@ -173,14 +173,13 @@ form - + - - + @@ -208,17 +207,18 @@ - - - - + + + + + + + + - - - - - - + + + @@ -232,7 +232,7 @@ tree - + @@ -251,7 +251,7 @@ diff --git a/addons/document/nodes.py b/addons/document/nodes.py index 6181b5678e8..c6e2f1b10d1 100644 --- a/addons/document/nodes.py +++ b/addons/document/nodes.py @@ -598,7 +598,8 @@ class node_file(node_class): if fil.parent_id: self.storage_id = fil.parent_id.storage_id.id else: - self.storage_id = None + self.storage_id = None + def get_data(self, cr, fil_obj = None): """ Retrieve the data for some file. @@ -607,12 +608,20 @@ class node_file(node_class): the browse object. """ # this is where storage kicks in.. stor = self.storage_id + if not stor: + data_obj = self.context._dirobj.pool.get('ir.model.data') + data_id = data_obj._get_id(cr, self.context.uid, 'document', 'storage_db') + if data_id: + stor = data_obj.browse(cr, self.context.uid, data_id, context=self.context.context).res_id assert stor stobj = self.context._dirobj.pool.get('document.storage') return stobj.get_data(cr,self.context.uid,stor, self,self.context.context, fil_obj) def get_data_len(self, cr, fil_obj = None): # TODO: verify with the storage object! + bin_size = self.context.context.get('bin_size', False) + if bin_size and not self.content_length: + self.content_length = fil_obj.db_datas return self.content_length def set_data(self, cr, data, fil_obj = None): diff --git a/addons/point_of_sale/pos_view.xml b/addons/point_of_sale/pos_view.xml index af9d8e5bf06..baaac139ce4 100644 --- a/addons/point_of_sale/pos_view.xml +++ b/addons/point_of_sale/pos_view.xml @@ -167,7 +167,7 @@ - + diff --git a/addons/project_timesheet/process/project_timesheet_process.xml b/addons/project_timesheet/process/project_timesheet_process.xml index bcfac8bd8ce..d6ca5cde8bc 100644 --- a/addons/project_timesheet/process/project_timesheet_process.xml +++ b/addons/project_timesheet/process/project_timesheet_process.xml @@ -34,11 +34,11 @@ - + - + @@ -133,7 +133,7 @@ tree - + diff --git a/addons/survey/report/survey_browse_response.py b/addons/survey/report/survey_browse_response.py index 6e423cb53c1..40c75755e1f 100644 --- a/addons/survey/report/survey_browse_response.py +++ b/addons/survey/report/survey_browse_response.py @@ -218,16 +218,16 @@ class survey_browse_response(report_rml): """ if survey.note: rml += """ - """ + to_xml(tools.ustr(survey.note)) + """ + """ + to_xml(tools.ustr(survey.note or '')) + """ """ for page in survey.page_ids: rml += """ - Page :- """ + to_xml(tools.ustr(page.title)) + """ + Page :- """ + to_xml(tools.ustr(page.title or '')) + """ """ if page.note: rml += """ - """ + to_xml(tools.ustr(page.note)) + """ + """ + to_xml(tools.ustr(page.note or '')) + """ """ for que in page.question_ids: rml += """ diff --git a/addons/survey/survey.py b/addons/survey/survey.py index 744829b2d45..cd3584f5361 100644 --- a/addons/survey/survey.py +++ b/addons/survey/survey.py @@ -31,6 +31,7 @@ from tools import to_xml import tools from mx.DateTime import * import netsvc +import os class survey_type(osv.osv): _name = 'survey.type' @@ -902,7 +903,7 @@ class survey_question_wiz(osv.osv_memory): context.update({'response_id':response_id}) report = self.create_report(cr, uid, [int(survey_id)], 'report.survey.browse.response', survey_data.title,context) attachments = [] - file = open("/tmp/" + survey_data.title + ".pdf") + file = open(tools.config['addons_path'] + '/survey/report/' + survey_data.title + ".pdf") file_data = "" while 1: line = file.readline() @@ -910,6 +911,8 @@ class survey_question_wiz(osv.osv_memory): if not line: break attachments.append((survey_data.title + ".pdf",file_data)) + file.close() + os.remove(tools.config['addons_path'] + '/survey/report/' + survey_data.title + ".pdf") user_email = False resp_email = False if user_obj.browse(cr, uid, uid).address_id.id: @@ -938,7 +941,7 @@ class survey_question_wiz(osv.osv_memory): if not report_name or not res_ids: return (False, Exception('Report name and Resources ids are required !!!')) try: - ret_file_name = '/tmp/'+file_name+'.pdf' + ret_file_name = tools.config['addons_path'] + '/survey/report/' + file_name + '.pdf' service = netsvc.LocalService(report_name); (result, format) = service.create(cr, uid, res_ids, {}, context) fp = open(ret_file_name, 'wb+'); diff --git a/addons/survey/survey_view.xml b/addons/survey/survey_view.xml index b71dbe97fb9..779e6eac466 100644 --- a/addons/survey/survey_view.xml +++ b/addons/survey/survey_view.xml @@ -3,7 +3,7 @@ - + diff --git a/addons/survey/wizard/wizard_survey.py b/addons/survey/wizard/wizard_survey.py index b623c8ecd27..631b8d56aea 100755 --- a/addons/survey/wizard/wizard_survey.py +++ b/addons/survey/wizard/wizard_survey.py @@ -114,7 +114,7 @@ def send_mail(self, cr, uid, data, context): attachments = [] for id in survey_ref.browse(cr, uid, data['ids']): report = create_report(cr, uid, [id.id], 'report.survey.form', id.title) - file = open("/tmp/" + id.title +".pdf") + file = open(tools.config['addons_path'] + '/survey/report/' + id.title +".pdf") file_data = "" while 1: line = file.readline() @@ -122,6 +122,8 @@ def send_mail(self, cr, uid, data, context): if not line: break attachments.append((id.title +".pdf",file_data)) + file.close() + os.remove(tools.config['addons_path'] + '/survey/report/' + id.title + ".pdf") for partner in pool.get('res.partner').browse(cr, uid, partner_ids): for addr in partner.address: @@ -191,7 +193,7 @@ def create_report(cr, uid, res_ids, report_name=False, file_name=False): if not report_name or not res_ids: return (False, Exception('Report name and Resources ids are required !!!')) try: - ret_file_name = '/tmp/'+file_name+'.pdf' + ret_file_name = tools.config['addons_path'] + '/survey/report/' + file_name + '.pdf' service = netsvc.LocalService(report_name); (result, format) = service.create(cr, uid, res_ids, {}, {}) fp = open(ret_file_name, 'wb+');