[IMP] crm_partner_assign: Improved partner_assign.yml,

Checked Oppportuniry forword to its nearest partner

bzr revid: ron@tinyerp.com-20111019131910-f1nd58iazih54qka
This commit is contained in:
ron@tinyerp.com 2011-10-19 18:49:10 +05:30
parent 4d016b97a7
commit 1911fab69c
1 changed files with 21 additions and 0 deletions

View File

@ -35,3 +35,24 @@
assert lead.partner_latitude == 50.8495239 , "Lattitude is wrong"
assert lead.partner_longitude == 4.3667002 , "Longitude is wrong"
assert lead.partner_assigned_id.id == ref('base.res_partner_ericdubois0') , "Opportuniy not assign partner"
-
Oppportuniry forword to its nearest partner, so first i create record of forword mail
-
!record {model: crm.lead.forward.to.partner, id: crm_lead_forward_to_partner_rec}:
send_to: email
email_from: 'admin@openerp.com'
email_to: 'admin@tinyerp.com'
subject: 'Openerp lead forward'
history: latest
-
I forword this opportunity to its nearest partner.
-
!python {model: crm.lead.forward.to.partner}: |
from tools import config
host = config.get('smtp_user', '127.0.0.1')
assert config.get(host, True), 'SMTP not configured !'
try:
self.action_forward(cr, uid, ref("crm_lead_forward_to_partner_rec"), context={'active_id': ref('crm.crm_case_abcfuelcounits0'),
'active_ids': [ref('crm.crm_case_abcfuelcounits0')], 'active_model': 'crm.lead'})
except:
pass