Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Add Meetings to Leads - Odoo v9

By
Randall Risser
on 7/15/16, 8:02 PM 394 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>
0
Najeeb Z
On 10/10/16, 4:58 PM

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 7/15/16, 8:02 PM
Seen: 394 times
Last updated: 10/10/16, 4:58 PM