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

Custom CRM Report or Dashboard? Is this possible without custom code?

By
John Baldwin
on 9/8/14, 10:57 AM 1,786 views

In my business there are many stages from raw prospect (Leads) to final sale (Opportunity=Won). We use severl reports that take the total number of leads/opportunities in one stage and divide it by the total number of leads/opportunities in another stage to produce a percentage. I would like to configure report filters or analysis measures to do this automatically. My question is, first is this possible in odoo currently or will it have to be developed in a module?

I know I can get a count in stages during a specific time frame. That provides my variables, but I'm not sure how I could group and divide the two too produce the percentage...

I don't expect anyone to provide the code, but a little advice or pointing me in the right direction would be great! Thanks in advance. :)

1

Brett Lehrer

--Brett Lehrer--
1252
| 5 4 8
Milwaukee, United States
--Brett Lehrer--
Director of IT and open source enthusiast.
Brett Lehrer
On 9/9/14, 3:23 AM

My best guess would be creating a new SQL view that has those calculations built-in, then add a new menu item under the Reporting section.  You'd probably need to define things fairly explicitly in the SQL to get it to work cleanly and quickly, but I don't see why it wouldn't work.  See addons/crm/report/crm_lead_report.py as an example implementation of creating a new view, or addons/account/report/accout_invoice_report.py as an example of a large sub-query with calculations that run on the results.

I don't know the details on this approach but my guess would be to use a sub-query to count the number of leads in each stage, then in the main query, re-list all the values plus divide the two counts.  Once you have it broken down into an SQL view you can re-run grouping queries on it.  Need to know a bit about SQL to do it, but most of the work for this can be done in a tool like pgAdmin to test out queries.

Thanks for the answer and I think you are at least partially right. I found this ( https://doc.odoo.com/trunk/web_graph/# ) , which describes the abilities of the reporting system in detail. That information plus this ( https://doc.odoo.com/trunk/web/search_view/ ), which describes filters in detail made me realize that I was going to need a custom module. I am currently coding an inherited CRM report, setting variables that perform my calculations and using those computed variables as a measure selection in my report. Coupled with some custom filters I should be able to accomplish what I want to do. Going to try anyway. BTW, I'm giving you a vote for the effort, but can't accept this as a complete answer. Thanks again.

John Baldwin
on 9/9/14, 4:19 AM

Well I don't know enough about what you're trying to do so it's a bit tough to come up with specific details. If you want to post some sample code as a reference it's a lot easier to come up with a detailed response.

Brett Lehrer
on 9/13/14, 2:42 PM

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: 9/8/14, 10:57 AM
Seen: 1786 times
Last updated: 3/16/15, 8:10 AM