[IMP] remove code from crm and add in to mail
bzr revid: tpa@tinyerp.com-20120507115432-bh4xbm1ys2njo2wa
This commit is contained in:
parent
ce1d6b0a59
commit
6affbbe19b
|
@ -23,8 +23,7 @@ from osv import fields,osv
|
|||
|
||||
class res_partner(osv.osv):
|
||||
""" Inherits partner and adds CRM information in the partner form """
|
||||
_name = "res.partner"
|
||||
_inherit = ['res.partner', 'mail.thread']
|
||||
_inherit = 'res.partner'
|
||||
_columns = {
|
||||
'section_id': fields.many2one('crm.case.section', 'Sales Team'),
|
||||
'opportunity_ids': fields.one2many('crm.lead', 'partner_id',\
|
||||
|
@ -70,22 +69,6 @@ class res_partner(osv.osv):
|
|||
opportunity_ids[partner_id] = opportunity_id
|
||||
return opportunity_ids
|
||||
|
||||
def message_load_ids(self, cr, uid, ids, limit=100, offset=0, domain=[], ascent=False, root_ids=[False], context=None):
|
||||
""" Override of message_load_ids
|
||||
User discussion page :
|
||||
- messages posted on res.partner, partner_id = user.id
|
||||
- messages directly sent to partner
|
||||
"""
|
||||
if context is None:
|
||||
context = {}
|
||||
msg_obj = self.pool.get('mail.message')
|
||||
msg_ids = []
|
||||
for user in self.browse(cr, uid, ids, context=context):
|
||||
msg_ids += msg_obj.search(cr, uid, [('partner_id', '=', user.id)] + domain,
|
||||
limit=limit, offset=offset, context=context)
|
||||
if (ascent): msg_ids = self._message_add_ancestor_ids(cr, uid, ids, msg_ids, root_ids, context=context)
|
||||
return msg_ids
|
||||
res_partner()
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -14,9 +14,6 @@
|
|||
<field name="section_id" completion="1" widget="selection"
|
||||
groups="base.group_extended"/>
|
||||
</field>
|
||||
<xpath expr="/form/notebook" position="after">
|
||||
<field name="message_ids" colspan="4" widget="ThreadView" nolabel="1"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
|
|
@ -24,11 +24,28 @@ from osv import fields
|
|||
|
||||
class res_partner(osv.osv):
|
||||
""" Inherits partner and adds CRM information in the partner form """
|
||||
_inherit = 'res.partner'
|
||||
_inherit = ['res.partner', 'mail.thread']
|
||||
_columns = {
|
||||
'emails': fields.one2many('mail.message', 'partner_id', 'Emails', readonly=True, domain=[('email_from','!=',False)]),
|
||||
}
|
||||
|
||||
def message_load_ids(self, cr, uid, ids, limit=100, offset=0, domain=[], ascent=False, root_ids=[False], context=None):
|
||||
""" Override of message_load_ids
|
||||
User discussion page :
|
||||
- messages posted on res.partner, partner_id = user.id
|
||||
- messages directly sent to partner
|
||||
"""
|
||||
if context is None:
|
||||
context = {}
|
||||
msg_obj = self.pool.get('mail.message')
|
||||
msg_ids = []
|
||||
for user in self.browse(cr, uid, ids, context=context):
|
||||
msg_ids += msg_obj.search(cr, uid, [('partner_id', '=', user.id)] + domain,
|
||||
limit=limit, offset=offset, context=context)
|
||||
if (ascent): msg_ids = self._message_add_ancestor_ids(cr, uid, ids, msg_ids, root_ids, context=context)
|
||||
return msg_ids
|
||||
res_partner()
|
||||
|
||||
res_partner()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -13,6 +13,9 @@
|
|||
<attribute name="invisible">False</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
<xpath expr="/form/notebook" position="after">
|
||||
<field name="message_ids" colspan="4" widget="ThreadView" nolabel="1"/>
|
||||
</xpath>
|
||||
</record>
|
||||
<record id="view_emails_partner_info_form" model="ir.ui.view">
|
||||
<field name="name">res.partner.emails.info.inherit</field>
|
||||
|
|
Loading…
Reference in New Issue