Better layout of form and add reply button

bzr revid: ced-4ef4945bd0ec737c9d3a8422cf8042296dd13486
This commit is contained in:
ced 2007-10-11 13:56:45 +00:00
parent b37d876b90
commit 34f97ab271
3 changed files with 22 additions and 11 deletions

View File

@ -495,6 +495,15 @@ class crm_case(osv.osv):
)
return True
def add_reply(self, cursor, user, ids, context=None):
for case in self.browse(cursor, user, ids, context=context):
if case.history_line:
description = case.history_line[0].description
self.write(cursor, user, case.id, {
'description': '> ' + description.replace('\n','\n> '),
}, context=context)
return True
def case_log(self, cr, uid, ids,context={}, email=False, *args):
cases = self.browse(cr, uid, ids)
self.__history(cr, uid, cases, 'Historize', history=True, email=email)

View File

@ -283,16 +283,6 @@
</group>
<separator colspan="4"/>
<group col="2" colspan="2" expand="1">
<group col="2" colspan="2">
<field name="canal_id"/>
<field name="som" select="2"/>
</group>
<field name="description" colspan="2" select="2" nolabel="1"/>
<button name="case_log_reply" string="Send Partner &amp; Historize" states="open" type="object"/>
<button name="case_log" string="Historize" states="open" type="object"/>
</group>
<field name="history_line" colspan="2" nolabel="1" mode="tree,form">
<form string="Communication history">
<group col="6" colspan="4">
@ -309,6 +299,19 @@
<field name="date"/>
</tree>
</field>
<group col="2" colspan="2" expand="1">
<field name="canal_id"/>
<field name="som" select="2"/>
<button name="add_reply" string="Add Last Mail for Replying"
states="open" type="object" colspan="2"/>
<field name="description" colspan="2" select="2" nolabel="1"/>
<button name="case_log_reply"
string="Send Partner &amp; Historize" states="open"
type="object"/>
<button name="case_log" string="Historize" states="open"
type="object"/>
</group>
<separator colspan="4"/>
<group col="8" colspan="4">
<field name="state" select="1"/>

View File

@ -76,7 +76,6 @@ class email_parser(object):
message = self.msg_body_get(msg)
data = {
'name': self._decode_header(msg['Subject']),
'description': '> '+message['body'].replace('\n','\n> '),
'section_id': self.section_id,
'email_from': self._decode_header(msg['From']),
'email_cc': self._decode_header(msg['Cc'] or ''),