Skip to Content
Odoo मेन्यू
  • Sign in
  • मुफ़्त में आज़माएं
  • ऐप्लिकेशन
    फ़ाइनेंस
    • अकाउंटिंग
    • इनवॉइसिंग
    • एक्सपेंस
    • स्प्रेडशीट (बीआई)
    • डॉक्यूमेंट्स
    • साइन
    सेल्स
    • सीआरएम
    • सेल्स
    • पीओएस शॉप
    • पीओएस रेस्टोरेंट
    • सब्सक्रिप्शन
    • रेंटल
    वेबसाइट
    • वेबसाइट बिल्डर
    • ई-कॉमर्स
    • ब्लॉग
    • फ़ोरम
    • लाइव चैट
    • ई-लर्निंग
    सप्लाई चेन
    • इन्वेंट्री
    • मैन्युफ़ैक्चरिंग
    • पीएलएम
    • परचेज़
    • मेंटेनेंस
    • क्वालिटी
    मानव संसाधन
    • कर्मचारी
    • रिक्रूटमेंट
    • टाइम ऑफ़
    • अप्रेज़ल
    • रेफ़रल
    • फ़्लीट
    मार्केटिंग
    • सोशल मार्केटिंग
    • ईमेल मार्केटिंग
    • एसएमएस मार्केटिंग
    • इवेंट
    • मार्केटिंग ऑटोमेशन
    • सर्वे
    सेवाएं
    • प्रोजेक्ट
    • टाइमशीट
    • फ़ील्ड सर्विस
    • हेल्पडेस्क
    • प्लानिंग
    • अपॉइंटमेंट
    प्रॉडक्टिविटी
    • डिस्कस
    • अप्रूवल
    • आईओटी
    • वीओआईपी
    • नॉलेज
    • WhatsApp
    तीसरे पक्ष के ऐप्लिकेशन Odoo स्टूडियो Odoo क्लाउड प्लेटफ़ॉर्म
  • इंडस्ट्री
    रीटेल
    • बुक स्टोर
    • क्लोदिंग स्टोर
    • फ़र्नीचर स्टोर
    • ग्रॉसरी स्टोर
    • हार्डवेयर स्टोर
    • टॉय स्टोर
    Food & Hospitality
    • बार और पब
    • रेस्टोरेंट
    • फ़ास्ट फ़ूड
    • Guest House
    • बेवरिज डिस्ट्रीब्यूटर
    • होटल
    रियल एस्टेट
    • Real Estate Agency
    • आर्किटेक्चर फ़र्म
    • कंसट्रक्शन
    • एस्टेट मैनेजमेंट
    • गार्ड्निंग
    • प्रॉपर्टी ओनर असोसिएशन
    कंसल्टिंग
    • अकाउंटिंग फ़र्म
    • Odoo पार्टनर
    • मार्केटिंग एजेंसी
    • लॉ फ़र्म
    • टैलेंट ऐक्विज़िशन
    • ऑडिट & सर्टिफ़िकेशन
    मैन्युफ़ैक्चरिंग
    • टेक्सटाइल
    • Metal
    • फ़र्नीचर
    • फ़ूड
    • Brewery
    • कॉर्पोरेट गिफ़्ट
    हेल्थ & फिटनेस
    • स्पोर्ट्स क्लब
    • आईवियर स्टोर
    • फिटनेस सेंटर
    • वेलनेस प्रैक्टिशनर
    • फॉर्मेसी
    • हेयर सैलून
    Trades
    • Handyman
    • आईटी हॉर्डवेयर और सपोर्ट
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    अन्य
    • Nonprofit Organization
    • एन्वायरमेंटल एजेंसी
    • बिलबोर्ड रेंटल
    • फ़ोटोग्राफी
    • बाइक लीजिंग
    • सॉफ़्टवेयर रीसेलर
    Browse all Industries
  • कम्यूनिटी
    सीखें
    • ट्यूटोरियल्स
    • दस्तावेज़
    • सर्टिफ़िकेशन
    • ट्रेनिंग
    • ब्लॉग
    • पॉडकास्ट
    शिक्षा को बढ़ावा दें
    • एजुकेशन प्रोग्राम
    • स्केल अप! बिजनेस गेम
    • Odoo के ऑफ़िस में आएं
    सॉफ़्टवेयर पाएं
    • डाउनलोड
    • वर्शन की तुलना करें
    • रिलीज़
    साथ मिलकर काम करें
    • Github
    • फ़ोरम
    • इवेंट
    • अनुवाद
    • पार्टनर बनें
    • Services for Partners
    • अपना अकाउंटिंग फ़र्म रजिस्टर करें
    सेवाएं पाएं
    • पार्टनर ढूंढें
    • अकाउंटेंट खोजें
    • सलाहकार की मदद लें
    • इम्प्लिमेंटेशन सेवाएं
    • कस्टमर रेफ़रेंस
    • सहायता
    • अपग्रेड
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    डेमो देखें
  • कीमत
  • सहायता

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

  • सीआरएम
  • e-Commerce
  • लेखांकन
  • इन्वेंटरी
  • PoS
  • प्रोजेक्ट
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
टैग (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
टैग (View all)
odoo accounting v14 pos v15
About this forum
Help

How to create report with init method and graph view?

Subscribe

Get notified when there's activity on this post

This question has been flagged
postgresqlodooV8
1 Reply
11340 Views
Avatar
Mohammad Adnan

I create new model for report. this model get its data form other models using select statement in init method. And I use graph view to show this model.

the problem is no data selected.

and graph view show:

No data to display.

No data available for this graph. Try to add some records, or make sure that there is at least one measure and no active filter in the search bar.


please can you help me


doctor_call_report.py

# -*- coding: utf-8 -*-

from openerp import fields, models, api, tools

class dz_all_report(models.Model):

_name = 'dz.all.report'

user_id = fields.Many2one('res.users', ondelete = 'set null', string='Salesperson', index=True)

doctor_id = fields.Many2one('res.partner', ondelete = 'set null', string='Doctor', index=True)

date = fields.Date(string='Date')

nbr_planned_call = fields.Integer(string='Planned Calls')

# nbr_created_call = fields.Integer(string='Created Calls')

def init(self, cr):

tools.drop_view_if_exists(cr, 'dz_all_report_graph')

cr.execute("""

create or replace view dz_all_report_graph as (

select

a.date as date,

a.user_id as user_id,

a.doctor_id as doctor_id,

a.nbr_planned_call as nbr_planned_call

from

dz_calltable a

)""")


doctor_call_report_view.xml

<?xml version="1.0" encoding="utf-8"?>

<openerp>

<data>

<record id="dz_all_report_search" model="ir.ui.view">

<field name="name">dz.call.table.report.search</field>

<field name="model">dz.all.report</field>

<field name="arch" type="xml">

<search string="Analytic Entries Analysis">

<field name="date"/>

<field name="doctor_id" />

<field name="user_id"/>

<group expand="0" string="Group By">

<filter string="SalesPersons" context="{'group_by':'user_id'}"/>

<filter string="Doctors" name="Doctors" context="{'group_by':'doctor_id'}" />

<separator/>

<filter string="Month" name="Month" context="{'group_by':'date:month'}"/>

</group>

</search>

</field>

</record>

<record id="dz_all_report_graph" model="ir.ui.view">

<field name="name">dz.report.graph.view</field>

<field name="model">dz.all.report</field>

<field name="arch" type="xml">

<graph string="Analytic Report" type="pivot">

<field name="user_id" type="row"/>

<field name="date" interval="month" type="col"/>

<field name="nbr_planned_call" type="measure"/>

</graph>

</field>

</record>

<record id="dz_all_report_tree" model="ir.ui.view">

<field name="name">dz.report.tree.view</field>

<field name="model">dz.all.report</field>

<field name="arch" type="xml">

<tree string="Tree view" editable="top">

<field name="user_id"/>

<field name="doctor_id" options="{'no_create': True}"/>

<field name="date" widget="date" interval="month"/>

<field name="nbr_planned_call" widget="integer" width="10%"/>

</tree>

</field>

</record>

<record id="dz_all_report_action" model="ir.actions.act_window">

<field name="name">Doctor Call report</field>

<field name="res_model">dz.all.report</field>

<field name="view_type">form</field>

<field name="view_mode">graph,tree</field>

<!--<field name="search_view_id" ref="view_analytic_entries_report_search"/>-->

<!--<field name="context">{'group_by_no_leaf':1, 'search_default_Account':1, 'group_by':[]}</field>-->

<field name="help">Doctor Call Report</field>

</record>

<menuitem action="dz_all_report_action"

id="dz_all_report_menu"

groups="base.group_sale_manager"

parent="base.next_id_64" name="Doctor Call Plan"/>

</data>

</openerp>

0
Avatar
Discard
Avatar
Axel Mendoza
Best Answer

The data you need is taken from the table dz_calltable, if that table is empty your view will see no data when created or accessed. You need to populate that table to see a result

1
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
How to know how many users are currently logged?
postgresql logging odooV8
Avatar
Avatar
Avatar
2
नव॰ 15
10153
CONFIGURACION DE CORREO PROPIO POR PRUMERA VEZ
odooV8
Avatar
0
मार्च 25
2000
When Odoo 14 connects to PostgreSQL 15.7, the connection is idle but cannot be released
postgresql
Avatar
0
फ़र॰ 25
2818
psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: fe_sendauth: no password supplied
postgresql
Avatar
Avatar
Avatar
2
जन॰ 25
9957
How to remove model if not in the py files anymore
odooV8
Avatar
0
जन॰ 25
4256
कम्यूनिटी
  • ट्यूटोरियल्स
  • दस्तावेज़
  • फ़ोरम
ओपन सोर्स
  • डाउनलोड
  • Github
  • रनबॉट
  • अनुवाद
सेवाएं
  • Odoo.sh Hosting
  • सहायता
  • अपग्रेड
  • कस्टम डेवलपमेंट्स
  • शिक्षा
  • अकाउंटेंट खोजें
  • पार्टनर ढूंढें
  • पार्टनर बनें
हमारे बारे में
  • हमारी कंपनी
  • ब्रांड ऐसेट
  • संपर्क करें
  • नौकरियां
  • इवेंट
  • पॉडकास्ट
  • ब्लॉग
  • ग्राहक
  • लीगल • गोपनीयता
  • सुरक्षा
الْعَرَبيّة 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, बिज़नेस से जुड़े ऐप्लिकेशन का एक कलेक्शन है जो ओपन सोर्स पर आधारित है. इसमें आपकी कंपनी की हर ज़रूरत के लिए ऐप्लिकेशन हैं. जैसे, सीआरएम, ई-कॉमर्स, अकाउंटिंग, इन्वेंट्री, पॉइंट ऑफ़ सेल, प्रोजेक्ट मैनेजमेंट वगैरह.

Odoo की सबसे बड़ी खासियत है कि यह इस्तेमाल करने में बहुत आसान है और यह पूरी तरह से इंटिग्रेट किया हुआ है.

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