Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
4305 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
kvě 23
6231
0
lis 22
3223
1
pro 21
4650
0
kvě 20
3670
0
bře 15
8718