[MERGE] Survey: Mutiple Usability Fix- lp:~openerp-dev/openobject-addons/trunk-addons13-survey-apa-survey-fka

bzr revid: jam@tinyerp.com-20121004115751-gjklctoohyp6udzz
This commit is contained in:
Jigar Amin
2012-10-04 17:27:51 +05:30
5 changed files with 17 additions and 16 deletions
+1
View File
@@ -77,6 +77,7 @@ class survey(osv.osv):
'tot_comp_survey': lambda * a: 0,
'send_response': lambda * a: 1,
'response_user': lambda * a:1,
'date_open': strftime("%Y-%m-%d %H:%M:%S"),
}
def survey_open(self, cr, uid, ids, arg):
+9 -9
View File
@@ -38,24 +38,24 @@
<div class="oe_title">
<label for="title" class="oe_edit_only"/>
<h1>
<field name="title"/>
<field name="title" attrs="{'readonly':[('state','=','close')]}"/>
</h1>
</div>
<group>
<group>
<field name="id" invisible="1"/>
<field name="responsible_id" class="oe_inline"/>
<field name="send_response"/>
<field name="type"/>
<field name="responsible_id" class="oe_inline" attrs="{'readonly':[('state','=','close')]}"/>
<field name="send_response" attrs="{'readonly':[('state','=','close')]}"/>
<field name="type" attrs="{'readonly':[('state','=','close')]}"/>
</group>
<group>
<field name="max_response_limit" attrs="{'readonly':[('state','in',('open','close'))]}"/>
<field name="response_user" attrs="{'readonly':[('state','in',('open','close'))]}"/>
<field name="max_response_limit" attrs="{'readonly':[('state','=','close')]}"/>
<field name="response_user" attrs="{'readonly':[('state','=','close')]}"/>
</group>
</group>
<notebook>
<page string="Survey Details">
<field name="page_ids" colspan="4" mode="tree">
<field name="page_ids" colspan="4" mode="tree" attrs="{'readonly':[('state','=','close')]}">
<form string="Survey Page" version="7.0">
<sheet>
<label for="title" class="oe_edit_only"/>
@@ -212,10 +212,10 @@
</sheet>
</form>
</field>
<field name="note" placeholder="Survey description..."/>
<field name="note" placeholder="Survey description..." attrs="{'readonly':[('state','=','close')]}"/>
</page>
<page string="Invited User">
<field name="invited_user_ids" readonly="1"/>
<field name="invited_user_ids" attrs="{'readonly':[('state','=','close')]}"/>
</page>
<page string="History">
<group>
+2 -2
View File
@@ -429,13 +429,13 @@ class survey_question_wiz(osv.osv_memory):
vals['attachment_ids'] = [(0,0,{'name': a_name,
'datas_fname': a_name,
'datas': str(a_content).encode('base64')})
for a_name, a_content in attachments]
for a_name, a_content in attachments.items()]
self.pool.get('mail.mail').create(cr, uid, vals, context=context)
xml_form = etree.Element('form', {'string': _('Complete Survey Answer')})
xml_footer = etree.SubElement(xml_form, 'footer', {'col': '6', 'colspan': '4' ,'class': 'oe_survey_title_height'})
etree.SubElement(xml_form, 'separator', {'string': 'Complete Survey', 'colspan': "4"})
etree.SubElement(xml_form, 'separator', {'string': 'Survey Completed', 'colspan': "4"})
etree.SubElement(xml_form, 'label', {'string': 'Thanks for your Answer'})
etree.SubElement(xml_form, 'newline')
etree.SubElement(xml_footer, 'button', {'special':"cancel",'string':"OK",'colspan':"2",'class':'oe_highlight'})
@@ -50,9 +50,6 @@ class survey_send_invitation(osv.osv_memory):
_defaults = {
'send_mail': lambda *a: 1,
'send_mail_existing': lambda *a: 1,
'mail_subject': lambda *a: "Invitation",
'mail_subject_existing': lambda *a: "Invitation",
'mail_from': lambda *a: tools.config['email_from']
}
def genpasswd(self):
@@ -70,11 +67,14 @@ class survey_send_invitation(osv.osv_memory):
name += "\t --> " + sur.title + "\n"
if sur.state != 'open':
msg += sur.title + "\n"
data['mail_subject'] = "Invitation for " + sur.title
data['mail_subject_existing'] = "Invitation for " + sur.title
data['mail_from'] = sur.responsible_id.email
if msg:
raise osv.except_osv(_('Warning!'), _('%sSurvey is not in open state') % msg)
data['mail'] = '''Hello %(name)s, \n\n We are inviting you for following survey. \
\n ''' + name + '''\n Your login ID: %(login)s, Your password: %(passwd)s
\n link :- http://'''+ str(socket.gethostname()) + ''':8080 \n\n Thanks,'''
\n link :- http://'''+ str(socket.gethostname()) + ''':8069 \n\n Thanks,'''
return data
def create_report(self, cr, uid, res_ids, report_name=False, file_name=False):
@@ -16,7 +16,7 @@
</header>
<group col="4">
<separator string="Select Partner" colspan="4"/>
<field name="partner_ids" nolabel="1" colspan="4"/>
<field name="partner_ids" nolabel="1" colspan="4" widget="many2many_tags"/>
<separator colspan="4" string="Send Mail for New User"/>
<field name="send_mail" nolabel="1"/>
<field name="mail_subject" colspan="3"/>