Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

Creating a custom report

Subscribe

Get notified when there's activity on this post

This question has been flagged
developmentmodulesreport
1 Reply
2898 Views
Avatar
Christopher Piggott

I need to make a report that includes the lead_properties in a crm.lead but with the lead properties properly exported - names for the fields from the crm.team record, and value names if it's a selection.  I figured this would also be a good way to try making my first custom report in a module.

I was able to create the module, get it to add itself to the CRM/Reporting menu, and invoke it, but I'm not getting any data.  The template is being invoked, just no rows.

The report itself looks like


          model="crm.lead"
        string="Custom CRM Lead Report"
        report_type="qweb-pdf"
        file="custom_crm_lead_report.report_template"
        name="custom_crm_lead_report.report_template"    />

I have tried a bunch of different ways to get sample data in, but my generate_report() method doesn't ever get called. That's in addition to the fact that I'm probably not returning the correct thing.

Do I need to do something in the report description xml to tell it "and this is the method you call to get the rows of data" ?


class CRMLeadReport(models.Model):
    _name = 'crm.lead.report'
    _description = 'Custom CRM Lead Report'
   @api.model
  def generate_report(self):
        _logger.error("OH NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO")
sample_data = [
            {'lead_name': 'Lead 1', 'team_name': 'Sales Team A', 'custom_data': 'Sample Data 1'},
            {'lead_name': 'Lead 2', 'team_name': 'Sales Team B', 'custom_data': 'Sample Data 2'},
            {'lead_name': 'Lead 3', 'team_name': 'Sales Team C', 'custom_data': 'Sample Data 3'}
        ]   return  {            'docs': [sample_data]        }

0
Avatar
Discard
Christopher Piggott
Author

I think I did everything in that video. Also I followed github.com/vyngt
/odoo-sample-app which shows a couple of reports. I'm quite certain these line up:

<field name="model">crm.lead.coe_report</field>
class COELeadReport(models.Model):
_name = 'crm.lead.coe_report'

This model definitely gets loaded (I can see it in settings / technical / database / model).

so everything seems to be linked together, but my get_report_values never gets called:
@api.model
def _get_report_values(self, docids, data=None)

Yahoo Baba Innovations Pvt.Ltd

I need to check your code first, and then I'll provide the correct answer. Can you please share the code?

Yahoo Baba Innovations Pvt.Ltd

if you need more help feel free to contact i'll guide you.

Christopher Piggott
Author

https://github.com/wz2b/odoo-report-example

Christopher Piggott
Author

I think I figured it out. The rules for how these pieces have to be named are a little complicated.

Avatar
Yahoo Baba Innovations Pvt.Ltd
Best Answer

Hello Christopher Piggott ,


Please refer the video: https://youtu.be/H7cGI23BHNs?si=F095OmTe2rewo7rR

I have shared video please checked and try after if you have any doubt let me know.


Hope this helps!

Thanks & Regards,

Name : Yahoo Baba

Email: yahoobaba077@gmail.com

0
Avatar
Discard
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
Odoo 18 - Custom Module - Error on nested class view Solved
development modules
Avatar
Avatar
Avatar
2
Jul 25
3604
How to upgrade modules in a specific file?
development modules
Avatar
0
Mar 24
2446
Trying to add fields to sale order form view give "AssertionError: Element openerp has extra content" Solved
development modules
Avatar
Avatar
2
Nov 16
6567
Error: External ID not found in the system Solved
development modules
Avatar
Avatar
Avatar
3
Feb 16
17436
How to prevent some modules from loading
development modules
Avatar
Avatar
Avatar
Avatar
3
Mar 15
10316
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now