[RM] remved res_partner_address refernces
bzr revid: jam@tinyerp.com-20120305093039-agbtpo3opkno5abn
This commit is contained in:
parent
88c25488a5
commit
8716365c42
|
@ -250,8 +250,8 @@ class calendar_attendee(osv.osv):
|
|||
if name == 'cn':
|
||||
if attdata.user_id:
|
||||
result[id][name] = attdata.user_id.name
|
||||
elif attdata.partner_address_id:
|
||||
result[id][name] = attdata.partner_address_id.name or attdata.partner_id.name
|
||||
elif attdata.partner_id:
|
||||
result[id][name] = attdata.partner_id.name or False
|
||||
else:
|
||||
result[id][name] = attdata.email or ''
|
||||
|
||||
|
@ -365,9 +365,7 @@ that points to the directory information corresponding to the attendee."),
|
|||
store=True, help="To specify the language for text values in a\
|
||||
property or property parameter."),
|
||||
'user_id': fields.many2one('res.users', 'User'),
|
||||
'partner_address_id': fields.many2one('res.partner.address', 'Contact'),
|
||||
'partner_id': fields.related('partner_address_id', 'partner_id', type='many2one', \
|
||||
relation='res.partner', string='Partner', help="Partner related to contact"),
|
||||
'partner_id': fields.many2one('res.partner', 'Contact'),
|
||||
'email': fields.char('Email', size=124, help="Email of Invited Person"),
|
||||
'event_date': fields.function(_compute_data, string='Event Date', \
|
||||
type="datetime", multi='event_date'),
|
||||
|
|
|
@ -22,10 +22,8 @@
|
|||
<group colspan="4" col="4">
|
||||
<field name="user_id" string="Invited User"/>
|
||||
<newline/>
|
||||
<field name="partner_address_id"
|
||||
string="Contact" />
|
||||
<field name="partner_id"
|
||||
string="Partner" readonly="1" />
|
||||
string="Contact" />
|
||||
</group>
|
||||
<separator string="Event Detail" colspan="4" />
|
||||
<group colspan="4" col="4">
|
||||
|
@ -78,7 +76,7 @@
|
|||
<field name="sent_by_uid" string="Invitation From" />
|
||||
<field name="role" string="My Role"/>
|
||||
<field name="user_id" invisible="1"/>
|
||||
<field name="partner_address_id" invisible="1"/>
|
||||
<field name="partner_id" invisible="1"/>
|
||||
<field name="cutype" string="Invitation type"/>
|
||||
<field name="state" />
|
||||
<field name="rsvp" string="Required to Join"/>
|
||||
|
@ -132,7 +130,7 @@
|
|||
<filter string="Responsible" icon="terp-personal" domain="[]"
|
||||
context="{'group_by':'user_id'}" />
|
||||
<filter string="Contact" icon="terp-personal" domain="[]"
|
||||
context="{'group_by':'partner_address_id'}" />
|
||||
context="{'group_by':'partner_id'}" />
|
||||
<separator orientation="vertical" />
|
||||
<filter string="Type" icon="terp-stock_symbol-selection" help="Invitation Type"
|
||||
domain="[]" context="{'group_by':'cutype'}" />
|
||||
|
|
|
@ -41,7 +41,7 @@ class base_calendar_invite_attendee(osv.osv_memory):
|
|||
'invite_id', 'user_id', 'Users'),
|
||||
'partner_id': fields.many2one('res.partner', 'Partner'),
|
||||
'email': fields.char('Email', size=124, help="Provide external email address who will receive this invitation."),
|
||||
'contact_ids': fields.many2many('res.partner.address', 'invite_contact_rel',
|
||||
'contact_ids': fields.many2many('res.partner', 'invite_contact_rel',
|
||||
'invite_id', 'contact_id', 'Contacts'),
|
||||
'send_mail': fields.boolean('Send mail?', help='Check this if you want to \
|
||||
send an Email to Invited Person')
|
||||
|
@ -112,10 +112,10 @@ send an Email to Invited Person')
|
|||
mail_to.append(datas['email'])
|
||||
|
||||
elif type == 'partner':
|
||||
add_obj = self.pool.get('res.partner.address')
|
||||
add_obj = self.pool.get('res.partner')
|
||||
for contact in add_obj.browse(cr, uid, datas['contact_ids']):
|
||||
res = {
|
||||
'partner_address_id': contact.id,
|
||||
'partner_id': contact.id,
|
||||
'email': contact.email
|
||||
}
|
||||
res.update(ref)
|
||||
|
@ -159,8 +159,8 @@ send an Email to Invited Person')
|
|||
|
||||
if not partner_id:
|
||||
return {'value': {'contact_ids': []}}
|
||||
cr.execute('SELECT id FROM res_partner_address \
|
||||
WHERE partner_id=%s', (partner_id,))
|
||||
cr.execute('SELECT id FROM res_partner \
|
||||
WHERE id=%s', (partner_id,))
|
||||
contacts = map(lambda x: x[0], cr.fetchall())
|
||||
return {'value': {'contact_ids': contacts}}
|
||||
|
||||
|
|
Loading…
Reference in New Issue