Skip to Content
Menu
This question has been flagged
1 Reply
3677 Views

Trying to get meetings button and function on leads like it is on opportunities.

Please note I am Odoo v9 online so I can't edit/add any python.

I added the code below to the view of "CRM - Leads Form" that I got from the "Opportunities" view.

It works to create a meeting on the calendar but it does not link it back to the lead.

How do I get it to link back to the lead so that it shows the number count and also takes me right to the events with same lead id on the calendar?


			<button class="oe_stat_button" type="object" context="{'partner_id': partner_id}" name="action_schedule_meeting" icon="fa-calendar">
				<div class="o_stat_info">
					<field name="meeting_count" class="o_stat_value" modifiers="{'readonly': true}"/>
					<span class="o_stat_text" attrs="{'invisible': [('meeting_count', '&lt;', 2)]}" modifiers="{'invisible': [['meeting_count', '&lt;', 2]]}">
						 Meetings
					</span>
					<span class="o_stat_text" attrs="{'invisible': [('meeting_count', '&gt;', 1)]}" modifiers="{'invisible': [['meeting_count', '&gt;', 1]]}">
						 Meeting
					</span>
				</div>
			</button>
Avatar
Discard
Best Answer

Make a custom field in calendar.event model title it x_lead_id and then modify the first line of your code (context to be specific)

context="{'x_lead_id': id}"


It should work.


Thanks

Avatar
Discard
Related Posts Replies Views Activity
1
May 23
3501
0
Nov 22
1700
1
Dec 21
2939
0
May 20
2487
0
Mar 15
6985