[IMP] survey :- add print survey menu. and change icon and string and remove act_window wizard. add field in print survey wizard.

bzr revid: ysa@tinyerp.co.in-20100511090024-ixef8mq1bsdvn74g
This commit is contained in:
Ysa (Open ERP)
2010-05-11 14:30:24 +05:30
parent ba0480c640
commit 7b86687219
8 changed files with 20 additions and 22 deletions
+4 -5
View File
@@ -149,11 +149,10 @@ class survey_form(report_rml):
<story>"""
surv_obj = pooler.get_pool(cr.dbname).get('survey')
for survey in surv_obj.browse(cr,uid,ids):
if datas.has_key('form') and datas['form']['survey_title']:
rml += """
<blockTable colWidths='"""+_tbl_widths+"""' style="title_tbl">
<tr><td><para style="title">""" + to_xml(tools.ustr(survey.title)) + """</para><para style="P2"><font></font></para></td></tr>
</blockTable>"""
rml += """
<blockTable colWidths='"""+_tbl_widths+"""' style="title_tbl">
<tr><td><para style="title">""" + to_xml(tools.ustr(survey.title)) + """</para><para style="P2"><font></font></para></td></tr>
</blockTable>"""
if survey.note:
rml += """
<para style="P2"></para>
+3 -3
View File
@@ -225,7 +225,7 @@ class survey_question(osv.osv):
'page_id': fields.many2one('survey.page', 'Survey Page', ondelete='cascade', required=1),
'question': fields.char('Question', size=128, required=1),
'answer_choice_ids': fields.one2many('survey.answer', 'question_id', 'Answer'),
'is_require_answer': fields.boolean('Require Answer to Question (optional)'),
'is_require_answer': fields.boolean('Require Answer to Question'),
'required_type': fields.selection([('all','All'), ('at least','At Least'), ('at most','At Most'), ('exactly','Exactly'), ('a range','A Range')], 'Respondent must answer'),
'req_ans': fields.integer('#Required Answer'),
'maximum_req_ans': fields.integer('Maximum Required Answer'),
@@ -250,7 +250,7 @@ class survey_question(osv.osv):
('date_and_time','Date and Time'),('descriptive_text','Descriptive Text'),
('table','Table'),
], 'Question Type', required=1,),
'is_comment_require': fields.boolean('Add Comment Field (optional)'),
'is_comment_require': fields.boolean('Add Comment Field'),
'comment_label': fields.char('Field Label', size = 255),
'comment_field_type': fields.selection([('char', 'Single Line Of Text'), ('text', 'Paragraph of Text')], 'Comment Field Type'),
'comment_valid_type': fields.selection([('do_not_validate', '''Don't Validate Comment Text.'''),
@@ -269,7 +269,7 @@ class survey_question(osv.osv):
'comment_valid_err_msg': fields.text('Error message'),
'make_comment_field': fields.boolean('Make Comment Field an Answer Choice'),
'make_comment_field_err_msg': fields.text('Error message'),
'is_validation_require': fields.boolean('Validate Text (optional)'),
'is_validation_require': fields.boolean('Validate Text'),
'validation_type': fields.selection([('do_not_validate', '''Don't Validate Comment Text.'''),\
('must_be_specific_length', 'Must Be Specific Length'),\
('must_be_whole_number', 'Must Be A Whole Number'),\
+1 -2
View File
@@ -6,8 +6,7 @@
id="report_survey_form"
model="survey"
name="survey.form"
menu="False"
string="Survey Form"/>
string="Print Survey"/>
<report auto="True"
id="survey_analysis"
+2 -2
View File
@@ -478,7 +478,7 @@
<field name="note" colspan="4" nolabel="1"/>
<group colspan="4">
<label string="" colspan="3"/>
<button name="survey_save" string="Ok" type="object" icon="gtk-go-back"/>
<button name="survey_save" string="Ok" type="object" icon="gtk-go-forward"/>
</group>
</form>
</field>
@@ -805,7 +805,7 @@
</notebook>
<group colspan="4">
<label string="" colspan="3"/>
<button name="survey_save" string="Ok" type="object" icon="gtk-ok"/>
<button name="survey_save" string="Ok" type="object" icon="gtk-go-forward"/>
</group>
</form>
</field>
+1 -1
View File
@@ -46,7 +46,7 @@ class survey_browse_answer(osv.osv_memory):
_columns = {
'survey_id': fields.selection(_get_survey, "Survey", required="1"),
'response_id': fields.many2one("survey.response", "Survey Answer"),
'response_id': fields.many2one("survey.response", "Survey Answer", help="If you want to print all answer of selected survey then don't select survey answer and if you select survey answer then print only selected survey answer."),
}
def action_next(self, cr, uid, ids, context=None):
@@ -18,7 +18,7 @@
<separator colspan="4" />
<label align="0.0" colspan="2" string="" />
<button colspan="1" icon="gtk-cancel" special="cancel" string="Cancel"/>
<button colspan="1" icon="gtk-go-forward" name="action_next" string="Start" type="object"/>
<button colspan="1" icon="gtk-go-forward" name="action_next" string="Print" type="object"/>
</form>
</field>
</record>
+3 -3
View File
@@ -28,11 +28,12 @@ from tools.translate import _
class survey_print(osv.osv_memory):
_name = 'survey.print'
_columns = {
'survey_ids': fields.many2many('survey','survey_print',\
'survey_id','print_id', "Survey", required="1"),
'orientation' : fields.selection([('vertical','Portrait(Vertical)'),\
('horizontal','Landscape(Horizontal)')], 'Orientation'),
'paper_size' : fields.selection([('letter','Letter (8.5" x 11")'),\
('legal','Legal (8.5" x 14")'),('a4','A4 (210mm x 297mm)')], 'Paper Size'),
'survey_title' : fields.boolean('Include Survey Title'),
'page_number' : fields.boolean('Include Page Numvers'),
'without_pagebreak' : fields.boolean('Print Without Page Breaks'),
}
@@ -40,7 +41,6 @@ class survey_print(osv.osv_memory):
_defaults = {
'orientation': lambda *a:'vertical',
'paper_size': lambda *a:'letter',
'survey_title':lambda *a: 0,
'page_number':lambda *a: 0,
'without_pagebreak':lambda *a: 0
}
@@ -57,7 +57,7 @@ class survey_print(osv.osv_memory):
@return : Dictionary value for print survey form.
"""
datas = {'ids' : context.get('active_ids', [])}
datas = {'ids' : self.read(cr, uid, ids, [], context)[0]['survey_ids']}
res = self.read(cr, uid, ids, ['survey_title', 'orientation', 'paper_size',\
'page_number', 'without_pagebreak'], context)
res = res and res[0] or {}
+5 -5
View File
@@ -10,10 +10,11 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Survey Print">
<separator string="Survey" colspan="4"/>
<field name="survey_ids" nolabel="1" colspan="4" />
<separator string="Print Option" colspan="4"/>
<field name="orientation" colspan="4"/>
<field name="paper_size" colspan="4"/>
<field name="survey_title" colspan="4"/>
<field name="page_number" colspan="4"/>
<field name="without_pagebreak" colspan="4"/>
<separator colspan="4" />
@@ -34,10 +35,9 @@
<field name="target">new</field>
</record>
<act_window id="action_act_view_survey_print"
key2="client_action_multi" name="Print Survey"
res_model="survey.print" src_model="survey"
view_mode="form" target="new" view_type="form" />
<menuitem name="Print Survey" id="menu_print_survey_form"
action="action_view_survey_print" parent="menu_reporting"
groups="group_survey_manager" icon="STOCK_PRINT"/>
</data>
</openerp>