Better ergonomy in the CRM module
bzr revid: fp@tinyerp.com-2aa8ab222f6ee6d77221d141c1d05eef043faae8
This commit is contained in:
parent
7e141539e0
commit
70734616d8
|
@ -414,7 +414,8 @@ class crm_case(osv.osv):
|
|||
if history:
|
||||
obj = self.pool.get('crm.case.history')
|
||||
data['description'] = case.description
|
||||
data['email'] = False
|
||||
print case, case.user_id, case.user_id.address_id
|
||||
data['email'] = email or (case.user_id and case.user_id.address_id and case.user_id.address_id.email) or False
|
||||
obj.create(cr, uid, data, context)
|
||||
return True
|
||||
|
||||
|
@ -456,17 +457,17 @@ class crm_case(osv.osv):
|
|||
)
|
||||
return True
|
||||
|
||||
def case_log(self, cr, uid, ids, email=False, *args):
|
||||
def case_log(self, cr, uid, ids,context={}, email=False, *args):
|
||||
cases = self.browse(cr, uid, ids)
|
||||
self.__history(cr, uid, cases, 'Communication', history=True, email=email)
|
||||
self.__history(cr, uid, cases, 'Historize', history=True, email=email)
|
||||
return self.write(cr, uid, ids, {'description':False, 'som':False, 'canal_id': False})
|
||||
|
||||
def case_log_reply(self, cr, uid, ids, email=False, *args):
|
||||
def case_log_reply(self, cr, uid, ids, context={}, email=False, *args):
|
||||
cases = self.browse(cr, uid, ids)
|
||||
for case in cases:
|
||||
if not case.email_from:
|
||||
raise osv.except_osv('Error !', 'You must put a Partner eMail to use this action !')
|
||||
self.__history(cr, uid, cases, 'Communication', history=True, email=False)
|
||||
self.__history(cr, uid, cases, 'Send', history=True, email=False)
|
||||
for case in cases:
|
||||
self.write(cr, uid, [case.id], {'description':False, 'som':False, 'canal_id': False, 'email_last':case.description})
|
||||
emails = [case.email_from] + (case.email_cc or '').split(',')
|
||||
|
|
|
@ -260,12 +260,23 @@
|
|||
<button name="remind_partner" string="Send Reminder" states="open,pending" type="object"/>
|
||||
</group>
|
||||
|
||||
<field name="description" colspan="4" select="2"/>
|
||||
<field name="history_line" colspan="4" nolabel="1" mode="form,tree">
|
||||
<form string="Communication">
|
||||
<group col="6" colspan="4">
|
||||
<field name="date" select="1"/>
|
||||
<field name="email" select="1"/>
|
||||
<field name="canal_id" select="2"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<field name="description" colspan="4" nolabel="1" select="2"/>
|
||||
</form>
|
||||
</field>
|
||||
<field name="description" colspan="4" select="2" nolabel="1"/>
|
||||
<field name="date_deadline" select="2"/>
|
||||
|
||||
<group col="2" colspan="2">
|
||||
<button name="case_log_reply" string="Send" states="open" type="object"/>
|
||||
<button name="case_log" string="Clear" states="open" type="object"/>
|
||||
<button name="case_log" string="Historize" states="open" type="object"/>
|
||||
</group>
|
||||
|
||||
<field name="state" select="1"/>
|
||||
|
@ -277,15 +288,6 @@
|
|||
<button name="case_escalate" string="Escalate" states="open,draft,pending" type="object"/>
|
||||
<button name="case_reset" string="Reset to Draft" states="done,cancel" type="object"/>
|
||||
</group>
|
||||
<field name="history_line" colspan="4" nolabel="1" mode="form,tree">
|
||||
<form string="Communication">
|
||||
<field name="user_id" select="2"/>
|
||||
<field name="date" select="2"/>
|
||||
<field name="email" select="2"/>
|
||||
<newline/>
|
||||
<field name="description" colspan="4" nolabel="1"/>
|
||||
</form>
|
||||
</field>
|
||||
</page><page string="References">
|
||||
<field name="id" select="1"/>
|
||||
<field name="categ_id" select="2" on_change="onchange_categ_id(categ_id)"/>
|
||||
|
|
Loading…
Reference in New Issue