تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
1980 أدوات العرض

hi guys

I have a few leads in my stages that I want to remind the salesperson to follow up on that lead if it's been 2 weeks since the last change I made on them....

how can I do this?


How should the notification be displayed in this section?


الصورة الرمزية
إهمال
أفضل إجابة

Hi,
You can create an automated action to generate the activities for the sales man.



Thanks

الصورة الرمزية
إهمال
الكاتب

thanks but i dont want to set activity.actually i need to send web notification to salesperson and when i use notify_danger in res.users model,i get the error :

ValueError: <class 'TypeError'>: "'res.users' object is not callable" while evaluating
'model.send_notification_to_salesperson()'

can you show the code, you have added

الكاتب

py code:
def send_notification_to_salesperson(self):
current_date = datetime.now()
two_weeks_ago = current_date - timedelta(days=14)

forbidden_stages = self.env['crm.stage'].search(['|', ('is_won', '=', True), ('name', '=', 'Lost')]).mapped(
'id')
leads = self.env['crm.lead'].search(
[('stage_id', 'not in', forbidden_stages), ('write_date', '<', two_weeks_ago)])

for lead in leads:
lead.user_id.notify_danger("follow up")

cron code:

<record id="cron_send_notification" model="ir.cron">
<field name="name">Notification: Send Notification</field>
<field name="active" eval="True"/>
<field name="priority">4</field>
<field name="interval_type">days</field>
<field name="interval_number">1</field>
<field name="numbercall">-1</field>
<field name="nextcall" eval="(DateTime.now() + timedelta(days=0)).strftime('%Y-%m-%d 10:03:00')"/>
<field name="model_id" ref="model_crm_lead"/>
<field name="state">code</field>
<field name="code">model.send_notification_to_salesperson()</field>
</record>

أفضل إجابة

set the activity properly and set the followers of that salesperson on that particular leads

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
0
مايو 24
1174
0
سبتمبر 23
1054
2
أغسطس 23
3506
2
فبراير 24
81
1
ديسمبر 23
1852