From 286479e7ef2bbd40ba97f25243bc6fec257b7d97 Mon Sep 17 00:00:00 2001 From: "Harry (Open ERP)" Date: Mon, 1 Feb 2010 18:43:27 +0530 Subject: [PATCH 1/4] [IMP] caldav: xml file of calendar data bzr revid: hmo@tinyerp.com-20100201131327-oxpgu1y65fqik1cz --- addons/base_calendar/base_calendar_data.xml | 5 +- addons/caldav/caldav.py | 3 +- addons/caldav/caldav_data.xml | 376 --------------- addons/crm/crm_meeting_data.xml | 299 +++++++++++- .../project_calendar_data.xml | 428 +++++++++++++++++- 5 files changed, 708 insertions(+), 403 deletions(-) diff --git a/addons/base_calendar/base_calendar_data.xml b/addons/base_calendar/base_calendar_data.xml index 0e7250071c8..b15cd72874e 100644 --- a/addons/base_calendar/base_calendar_data.xml +++ b/addons/base_calendar/base_calendar_data.xml @@ -1,10 +1,7 @@ - + - - OpenERP - diff --git a/addons/caldav/caldav.py b/addons/caldav/caldav.py index 5741f645b1e..5598236dd48 100644 --- a/addons/caldav/caldav.py +++ b/addons/caldav/caldav.py @@ -483,7 +483,8 @@ rule or repeating pattern for anexception to a recurrence set"), 'caldav_alarm_id': fields.many2one('calendar.alarm', 'Alarm'), 'recurrent_uid': fields.integer('Recurrent ID'), 'recurrent_id': fields.datetime('Recurrent ID date'), - } + 'user_id': fields.many2one('res.users', 'Responsible'), + } _defaults = { 'class': lambda *a: 'public', diff --git a/addons/caldav/caldav_data.xml b/addons/caldav/caldav_data.xml index 295b05ba540..c8b20ac134b 100644 --- a/addons/caldav/caldav_data.xml +++ b/addons/caldav/caldav_data.xml @@ -129,381 +129,5 @@ - - - vevent - - - - - - vtodo - - - - - - valarm - - - - - - attendee - - - - - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - field - - - - - - - field - - - diff --git a/addons/crm/crm_meeting_data.xml b/addons/crm/crm_meeting_data.xml index 789708c6a35..09566903d1c 100644 --- a/addons/crm/crm_meeting_data.xml +++ b/addons/crm/crm_meeting_data.xml @@ -25,33 +25,101 @@ Case Meeting crm.meeting - + + - + + + + meeting + + + vevent + [('user_id','=', uid)] + + + + valarm + + + + attendee + + + + + + + + + + + field + - + + + + + field + - + field - + + + + + + field + - + + + + + field + + + + + + + field + + + field - + - + + + + + + field + + + + + + + field + + + @@ -59,5 +127,220 @@ field + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + diff --git a/addons/project_calendar/project_calendar_data.xml b/addons/project_calendar/project_calendar_data.xml index e4c333ca6e2..63b5e99333a 100644 --- a/addons/project_calendar/project_calendar_data.xml +++ b/addons/project_calendar/project_calendar_data.xml @@ -1,13 +1,17 @@ - - - vtodo - - + + meeting_todo + + vtodo + + + [('user_id','=', uid)] + + @@ -15,34 +19,430 @@ {'needs-action': 'draft', 'completed': 'done', 'in-process': 'open', 'cancelled': 'cancelled'} field - - + + + + + + field + + + field - - + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + field - - + + + + + + field + + + field - - + + + + + + field + + + + + + + field + + + hours + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + vevent + + + [('user_id','=', uid)] + + + + valarm + + + + + + attendee + + + + + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + + field + + + + + + + field + + + + + + + {'tentative': 'draft', 'confirmed': 'open', 'cancelled': 'cancel'} + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + + field + + + + + + - \ No newline at end of file + From 489aea8520945e1b2925b6b1eb172a664f46a05f Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Mon, 1 Feb 2010 19:01:10 +0530 Subject: [PATCH 2/4] [IMP]:Survey:Ref.YSA * Improved the code and changes in view,fix bug in report and response wizard. bzr revid: apa@tinyerp.com-20100201133110-de1jvtbom7t06iks --- .../survey/report/survey_analysis_report.py | 2 + .../survey/report/survey_browse_response.py | 12 +++--- addons/survey/survey.py | 22 ++++++---- addons/survey/survey_view.xml | 41 ++++++++++--------- 4 files changed, 43 insertions(+), 34 deletions(-) diff --git a/addons/survey/report/survey_analysis_report.py b/addons/survey/report/survey_analysis_report.py index 79871a63084..069488034d8 100755 --- a/addons/survey/report/survey_analysis_report.py +++ b/addons/survey/report/survey_analysis_report.py @@ -257,6 +257,8 @@ class survey_analysis(report_rml): sqc.question_id = sr.question_id and sra.answer_id = %d and sqc.title ='%s'\ group by sra.answer_id,sqc.rating_weight" % (ans.id,matrix_ans[mat_col])) col_weight = cr.fetchone() + if not col_weight : + col_weight= (0,0) res_count = col_weight[0] if tot_res: rating_weight_sum += col_weight[1] * tot_res diff --git a/addons/survey/report/survey_browse_response.py b/addons/survey/report/survey_browse_response.py index 26ac0e54103..6e26f21e5b3 100644 --- a/addons/survey/report/survey_browse_response.py +++ b/addons/survey/report/survey_browse_response.py @@ -268,7 +268,7 @@ class survey_browse_response(report_rml): """ elif que.type in ['matrix_of_choices_only_one_ans','matrix_of_choices_only_multi_ans','rating_scale','matrix_of_drop_down_menus']: if len(answer) and answer[0].state == "done": - if que.comment_column: + if que.type in ['matrix_of_choices_only_one_ans','rating_scale'] and que.comment_column: pass cols_widhts = [] cols_widhts.append(200) @@ -278,7 +278,7 @@ class survey_browse_response(report_rml): tmp=0.0 sum = 0.0 i = 0 - if que.comment_column: + if que.type in ['matrix_of_choices_only_one_ans','rating_scale'] and que.comment_column: for col in cols_widhts: if i==0: cols_widhts[i] = cols_widhts[i]/2.0 @@ -292,7 +292,7 @@ class survey_browse_response(report_rml): if col.title not in matrix_ans: matrix_ans.append(col.title) len_matrix = len(matrix_ans) - if que.comment_column: + if que.type in ['matrix_of_choices_only_one_ans','rating_scale'] and que.comment_column: matrix_ans.append(que.column_name) rml+="""""" for mat_col in matrix_ans: @@ -342,14 +342,14 @@ class survey_browse_response(report_rml): """ rml+= """""" + value + """""" - if que.comment_column: + if que.type in ['matrix_of_choices_only_one_ans','rating_scale'] and que.comment_column: if comment_value=='False': comment_value = '' rml+= """"""+ to_xml(tools.ustr(comment_value)) + """""" rml+=""" """ - if que.comment_field_type: + if que.is_comment_require: rml+=""" - """ + to_xml(tools.ustr(answer[0].comment)) + """""" + """ + to_xml(tools.ustr(answer[0].comment or '')) + """""" else: rml +=""" No Response diff --git a/addons/survey/survey.py b/addons/survey/survey.py index c6a4a1daf2b..632f4c768ef 100644 --- a/addons/survey/survey.py +++ b/addons/survey/survey.py @@ -331,9 +331,9 @@ class survey_question(osv.osv): raise osv.except_osv(_('Error !'),_("Maximum Required Answer is greater than Minimum Required Answer")) if question['type'] == 'matrix_of_drop_down_menus' and vals.has_key('column_heading_ids'): for col in vals['column_heading_ids']: - if col[2].has_key('menu_choice') and not col[2]['menu_choice']: + if col[2] and col[2].has_key('menu_choice') and not col[2]['menu_choice']: raise osv.except_osv(_('Error !'),_("You must enter one or more menu choices in column heading")) - elif col[2].has_key('menu_choice') and col[2]['menu_choice'].strip() == '': + elif col[2] and col[2].has_key('menu_choice') and col[2]['menu_choice'].strip() == '': raise osv.except_osv(_('Error !'),_("You must enter one or more menu choices in column heading (white spaces not allowed)")) return super(survey_question, self).write(cr, uid, ids, vals, context=context) @@ -740,24 +740,28 @@ class survey_question_wiz(osv.osv_memory): fields[tools.ustr(que) + "_commentcolumn_"+tools.ustr(row['id']) + "_field"] = {'type':'char', 'size' : 255, 'string':tools.ustr(que_rec['column_name']), 'views':{}} etree.SubElement(xml_group, 'field', {'name': tools.ustr(que) + "_commentcolumn_"+tools.ustr(row['id'])+ "_field"}) elif que_rec['type'] == 'matrix_of_choices_only_multi_ans': - xml_group = etree.SubElement(xml_group, 'group', {'col': '2', 'colspan': '2'}) + xml_group = etree.SubElement(xml_group, 'group', {'col': str(len(que_rec['column_heading_ids']) + 1), 'colspan': '4'}) + etree.SubElement(xml_group, 'separator', {'string': '.','colspan': '1'}) + for col in que_col_head.read(cr, uid, que_rec['column_heading_ids']): + etree.SubElement(xml_group, 'separator', {'string': tools.ustr(col['title']),'colspan': '1'}) for row in ans_ids: etree.SubElement(xml_group, 'label', {'string': to_xml(tools.ustr(row['answer'])) +' :-', 'align': '0.0'}) - etree.SubElement(xml_group, 'newline') for col in que_col_head.read(cr, uid, que_rec['column_heading_ids']): - etree.SubElement(xml_group, 'field', {'name': tools.ustr(que) + "_" + tools.ustr(row['id']) + "_" + tools.ustr(col['title'])}) + etree.SubElement(xml_group, 'field', {'name': tools.ustr(que) + "_" + tools.ustr(row['id']) + "_" + tools.ustr(col['title']), 'nolabel':"1"}) fields[tools.ustr(que) + "_" + tools.ustr(row['id']) + "_" + tools.ustr(col['title'])] = {'type':'boolean', 'string': col['title']} elif que_rec['type'] == 'matrix_of_drop_down_menus': - xml_group = etree.SubElement(xml_group, 'group', {'col': '2', 'colspan': '2'}) + xml_group = etree.SubElement(xml_group, 'group', {'col': str(len(que_rec['column_heading_ids']) + 1), 'colspan': '4'}) + etree.SubElement(xml_group, 'separator', {'string': '.','colspan': '1'}) + for col in que_col_head.read(cr, uid, que_rec['column_heading_ids']): + etree.SubElement(xml_group, 'separator', {'string': tools.ustr(col['title']),'colspan': '1'}) for row in ans_ids: etree.SubElement(xml_group, 'label', {'string': to_xml(tools.ustr(row['answer']))+' :-', 'align': '0.0'}) - etree.SubElement(xml_group, 'newline') for col in que_col_head.read(cr, uid, que_rec['column_heading_ids']): selection = [] if col['menu_choice']: for item in col['menu_choice'].split('\n'): if item and not item.strip() == '': selection.append((item ,item)) - etree.SubElement(xml_group, 'field', {'name': tools.ustr(que) + "_" + tools.ustr(row['id']) + "_" + tools.ustr(col['title'])}) + etree.SubElement(xml_group, 'field', {'name': tools.ustr(que) + "_" + tools.ustr(row['id']) + "_" + tools.ustr(col['title']),'nolabel':'1'}) fields[tools.ustr(que) + "_" + tools.ustr(row['id']) + "_" + tools.ustr(col['title'])] = {'type':'selection', 'string': col['title'], 'selection':selection} elif que_rec['type'] == 'multiple_textboxes': xml_group = etree.SubElement(xml_group, 'group', {'col': '1', 'colspan': '4'}) @@ -1238,7 +1242,7 @@ class survey_question_wiz(osv.osv_memory): numeric_sum += int(val) elif val and len(key.split('_')) == 3: resp_obj.write(cr, uid, update, {'state': 'done'}) - if type(val) == type(''): + if type(val) == type('') or type(val) == type(u''): ans_create_id = res_ans_obj.create(cr, uid, {'response_id':update, 'answer_id':ans_id_len[1], 'answer' : ans_id_len[2], 'value_choice' : val}) sur_name_read['store_ans'][update].update({key:val}) else: diff --git a/addons/survey/survey_view.xml b/addons/survey/survey_view.xml index 70b41b589fe..5085ed4986d 100644 --- a/addons/survey/survey_view.xml +++ b/addons/survey/survey_view.xml @@ -30,7 +30,7 @@