تخطي للذهاب إلى المحتوى
أودو القائمة
  • تسجيل الدخول
  • جرب مجاناً
  • التطبيقات
    المالية
    • المحاسبة
    • فوترة
    • النفقات
    • جدول البيانات (BI)
    • المستندات
    • توقيع إلكتروني
    المبيعات
    • إدارة علاقات العملاء
    • المبيعات
    • نقطة البيع للمتاجر
    • نقطة البيع للمطاعم
    • الاشتراكات
    • تأجير
    المواقع الإلكترونية
    • أداة بناء المواقع الإلكترونية
    • متاجر إلكترونية
    • مدونة
    • المنتدى
    • دردشة مباشرة
    • التعليم الإلكتروني
    سلسلة التوريد
    • المستودعات
    • التصنيع
    • إدارة دورة حياة المنتج
    • المشتريات
    • الصيانة
    • الجودة
    الموارد البشرية
    • موظفون
    • التوظيف
    • إجازة عمل
    • التقييمات
    • الإحالات
    • تطبيق الأسطول
    التسويق
    • التسويق الإجتماعي
    • التسويق عبر البريد الإلكتروني
    • التسويق عبر الرسائل النصية
    • فعاليات
    • أتمتة التسويق
    • الاستطلاعات
    الخدمات
    • المشاريع
    • الجداول الزمنية
    • الخدمة الميدانية
    • مكتب المساعدة
    • التخطيط
    • مواعيد
    اﻹنتاجية
    • مناقشة
    • الموافقات
    • إنترنت الأشياء "IoT"
    • بروتوكول ربط المحادثات الصوتية عبر الإنترنت
    • المعرفة
    • WhatsApp
    التطبيقات الخارجية ستوديو أودو منصة أودو السحابية
  • قطاعات الأعمال
    البيع بالتجزئة
    • متجر كتب
    • متجر ملابس
    • متجر أثاث
    • متجر بقالة
    • متجر معدات
    • متجر ألعاب
    الطعام والضيافة
    • بار وحانة
    • المطعم
    • مطعم للوجبات السريعة
    • نزل للضيوف
    • موزّع مشروبات
    • فندق
    العقارات
    • وكالة عقارات
    • شركة هندسة معمارية
    • البناء
    • إدارة العقارات
    • العناية بالحدائق
    • اتحاد مُلاّك العقارات
    استشارة
    • مؤسسة محاسبية
    • شريك أودو
    • وكالة تسويقية
    • منشأة قانونية
    • استقطاب المواهب
    • التدقيق والتوثيق
    التصنيع
    • الأقمشة
    • معدني
    • الأثاث
    • الطعام
    • مصنع خمور
    • هدايا الشركات
    الصحة واللياقة البدنية
    • نادي رياضي
    • متجر نظارات
    • مركز لياقة بدنية
    • الممارسون الصحيون
    • صيدلية
    • صالون تصفيف الشعر
    التجارة
    • عامل صيانة
    • الأجهزة والمعدات التقنية ودعمها
    • أنظمة الطاقة الشمسية
    • صانع أحذية
    • خدمات التنظيف
    • خدمات التكييف (HVAC)
    غير ذلك
    • منظمة غير ربحية
    • وكالة بيئية
    • تأجير لوحات إعلانية
    • تصوير
    • تأجير دراجات
    • بائع وسيط للبرمجيات
    تصفح كافة قطاعات الأعمال
  • مجتمع أودو
    تعلم
    • دروس
    • التوثيق
    • شهادات
    • التدريب
    • مدونة
    • بودكاست
    قم بتعزيز التعليم
    • برنامج تعليم
    • Scale UP! لعبة الأعمال
    • قم بزيارة أودو
    احصل على البرنامج
    • تحميل
    • قارنْ الإصدارات
    • إطلاق
    تعاون
    • جيت هاب "Github"
    • المنتدى
    • فعاليات
    • الترجمات
    • كنْ شريكاً
    • خدمات الشركاء
    • سجل مكتب المحاسبة الخاص بك
    احصل على الخدمات
    • اعثر على شريك
    • اعثر على محاسب
    • قابل أحد مرشدي الأعمال
    • خدمات التنفيذ
    • مراجع العملاء
    • الدعم
    • الترقيات
    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
يجب أن تكون مسجلاً حتى تتفاعل مع المجتمع.
كافة المنشورات الأفراد الشارات
علامات التصنيف (عرض الكل)
odoo accounting v14 pos v15
حول هذا المنتدى
يجب أن تكون مسجلاً حتى تتفاعل مع المجتمع.
كافة المنشورات الأفراد الشارات
علامات التصنيف (عرض الكل)
odoo accounting v14 pos v15
حول هذا المنتدى
المساعدة

I need to know more about the Odoo 8 Reporting system (dashboards)

اشتراك

تسلم الإشعارات عندما يكون هناك نشاط في هذا المنشور

لقد تم الإبلاغ عن هذا السؤال
systemreportingdashboard
1 الرد
9591 أدوات العرض
الصورة الرمزية
TEIMI Yassine

I'm trying to develop custom human ressources evaluation dashboards using a custom module.

I took the existing hr_evaluation dashboard as a start, and try to do such developpement.

A- Python side : 

So I found that I have to create a report model, "hr_evaluation_report" that takes fields from models involved on the dashboard (here the hr_evaluation_evaluation and hr_evaluation_interview models), and if needed some fields used to display computed results on the dashboard (here the delay_date and overpass_delay), and this using depends, as the following code demonstrates : 

hr_evaluation_report.py 

In this file I found also a init method.

I need to know more about this init method :

1- Is it mandatory ?

2- Is it serving only for performing a sql request to make data available for the reporting model and then initialize it?

3- I see that it reacts on views displaying using tools.drop_view_if_exists, so what are all the purposes for using this method ?

B- View side :

On the hr_evaluation_view.xml 

We can see that :

1- Initializes the graph view

2- Making Filters and group by availables

3- Adding dashboard menuitem, and action allowing to open the corresponding view.

But I can't see :

How to customize the measure selectio box ?

Image showing the measures selection box 

And a final question about this button sequence :

Image showing the sequence button 

Does this buttons sequence come by default (using inheritance maybe) ? 

Every suggestion, tutorials, additions, hints will be welcome. 


------------------------------------------------- EDIT --------------------------------------------------------------------------------------------------------------------

@Axel Mendoza : 

I developped my custom module for reporting, without the init method, and I set _auto=True, so Odoo will create the sql table for me on the database. Here is the main module files : 

1. hr_evaluation_report_extension.py

On this new created model, I want to get the necessary fields needed to retrieve data, the purpose is to have the goals reaching percentage per employee, and having the ability to group by employee, department, job, ... , So the 'reach' field is the one measurable, because it's the only one with float type.

So I needed to put 3 models on the depends list, but there is no relationnal fields between the three, Is it necessary to have data consistency ? because on the example I followed, when using the init method, they did a LEFT JOIN to have data, what did I need in case I don't use the init method ?

from import openerp.osv fields, osv


class hr_evaluation_report_goals(osv.Model):
_name = "hr.evaluation.report.goals"
"Goals reaching Statistics"
_description = _auto = True

_columns = {
'create_date': fields.datetime('Create Date', readonly=True),
        'plan_id': fields.many2one('hr_evaluation.plan','Plan' , readonly=True),
        'job_id': fields.many2one('hr.job','Job Title ),
        'department_id': fields.many2one('hr.department', 'Department'),
        'statut': fields.char('Statut', size=32),
        'name_related': fields.related('resource_id','name', type='char', string='Name', readonly=True, store=True),
        'reach': fields.float('Atteinte objectif global'),
        'state': fields.selection([
('draft''Draft', ),
('wait''Plan In Progress', ),
('progress''Final Validation', ),
('done''Done', ),
('cancel''Cancelled', ),
], 'Status', readonly=True),
}
_depends = {
'hr.employee': ['name_related','job_id','department_id','statut'],
        'survey.user_input': ['reach'],
        'hr_evaluation.evaluation': [
'create_date','plan_id','state'],
}


The problem is there is no data on the sql table created by Odoo :

Image showing the sql request result


2. hr_evaluation_report_extension_view.xml

On the view side I put on the graph tag the name_related (employee name) field on the rows, and create_date (employee evaluation create date) on the col, and the field reach as measure.

besides, I created the search view for filters and group by.

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

<record id="view_goals_reaching_graph" model="ir.ui.view">
<field name="name">hr.goals.reaching</field>
<field name="model">hr.evaluation.report.goals</field>
<field name="arch" type="xml">
<graph string="Goals reaching analysis" type="pivot" stacked="True">
<field name="name_related" type="row"/>
<field name="create_date" type="col"/>
<field name="reach" type="measure"/>
</graph>
</field>
</record>

<record id="view_goals_reaching_search" model="ir.ui.view">
<field name="name">hr.goals.search</field>
<field name="model">hr.evaluation.report.goals</field>
<field name="arch" type="xml">
<search string="Pourcentage atteinte globale des objectifs">
<filter string="En cours" domain="[('state', '=' ,'wait')]" help = "In progress Evaluations"/>
<filter string="Attente appréciation DRH" domain="[('state','=','progress')]" help = "Final Validation Evaluations"/>
<filter string="Terminé" domain="[('state','=','done')]"/>
<field name="name_related"/>
<field name="plan_id"/>
<group expand="0" string="Extended Filters...">
<field name="state"/>
<field name="create_date"/>
<field name="department_id"/>
<field name="job_id"/>
<field name="statut"/>
</group>
<group expand="1" string="Group By">
<filter string="Employé" name="employee" context="{'group_by':'name_related'}"/>
<filter string="Campagne" context="{'group_by':'plan_id'}"/>
<filter string="Direction" context="{'group_by':'department_id'}"/>
<filter string="Fonction" context="{'group_by':'job_id'}"/>
<filter string="statut" context="{'group_by':'statut'}"/>
<separator/>
<filter string="Month" context="{'group_by':'create_date:month'}" help="Mois de création"/>
</group>
</search>
</field>
</record>

<record id="action_evaluation_goals_reaching" model="ir.actions.act_window">
<field name="name">Atteinte des objectifs</field>
<field name="res_model">hr.evaluation.report.goals</field>
<field name="view_type">form</field>
<field name="view_mode">graph</field>
<field name="search_view_id" ref="view_goals_reaching_search"/>
</record>

<menuitem action="action_evaluation_goals_reaching" id="menu_evaluation_goals_reaching" parent="hr.menu_hr_reporting" sequence="3" groups="base.group_hr_manager"/>

</data>
</openerp>

-------------------------------------------------------------------EDIT 2-------------------------------------------------------------------------------------------------

Here after the report model : 

class hr_evaluation_report_goals(osv.Model):
_name = "hr.evaluation.report.goals"
_description = "Goals reaching"
_auto = False

_columns = {
'evaluation_plan_id': fields.many2one('hr_evaluation.plan , 'Appraisal Plan' ),
        'job_id': fields.many2one('hr.job', 'Job Title'),
        'department_id': fields.many2one('hr.department', 'Department'),
        'statut': fields.char('Statut', size=32),
        'name_related': fields.related('resource_id', 'name' , type='char', string='Name', readonly=True, store=True),
        'reach': fields.float('Atteinte objectif global'),
    }
_depends = {
'hr.employee': ['id','name_related','job_id','department_id','statut','evaluation_plan_id'],
        'survey.user_input': ['reach']
    }

Here is my init method : 

def init(self, cr):
tools.drop_view_if_exists(cr, 'hr_evaluation_report_goals')
cr.execute("""
create or replace view hr_evaluation_report_goals as (
select
min(e.id) as id,
e.name_related,
e.evaluation_plan_id,
e.department_id,
e.job_id,
e.statut,
s.reach
from
survey_user_input s
INNER JOIN
hr_employee e on (e.id=s.employee_id)
GROUP BY
e.name_related,
e.evaluation_plan_id,
e.department_id,
e.job_id,
e.statut
)
"""
)


I get this error :

ProgrammingError: column "s.reach" must appear in the GROUP BY clause or be used in an aggregate function

LINE 10: s.reach

How to store my goals reaching value in the sql view, if it's not syntaxclty correct ? 


0
الصورة الرمزية
إهمال
Axel Mendoza

You don't need an SQL view for your report, you could directly use the model survey.user_input that contains all the data you need, just add the necessary related fields and you could delete the model hr.evaluation.report.goals that you are creating. That's the scenario that I describe before when you could access all the data to display in the report by using a low level model that have the many2one relations to fit your needs

TEIMI Yassine
الكاتب

Ah okay! So I have to add all relationnal fields from hr.employee model to the survey.user_input model (the one I should base my report on), and override the survey.user_input create method to insert data into relationnal fields columns, and thats 'all I have all necessary data on the survey.user_input to base my report on, correct me if I'm wrong please. Gracias!

TEIMI Yassine
الكاتب

I meant related fields not relationnal fields ...

TEIMI Yassine
الكاتب

Axel, For testing purposes, I used the sql request, and it worked, I know there is no need to do so, using just the survey.user_input model with relationnal fields from hr.employee would be enough (I'll wait to complete my discussion with you about that), so it worked but I need to do some little adjustments, details here : https://www.odoo.com/forum/help-1/question/odoo-8-reporting-get-data-average-instead-of-data-sum-94558 Thanks a lot Axel for your help.

Axel Mendoza

Looking at your query you just need to have inserted the employee_id to be able to access the data from hr.employee, the rest of the data could be accessed using related fields that don't need to be inserted by you

الصورة الرمزية
Axel Mendoza
أفضل إجابة

@Yassine TEIMI

I will try to explain all your questions.

First that's not what it's called dashboards or boards in Odoo, those are a group of several actions/views that are shows in columns for the same menu.

Your case is a graph view of the model hr.evaluation.report. That model will not create an SQL table due to the _auto = False, it get the data from on an SQL view, that's why it need to use the init method that it's called when installing or updating the module to create the tables or views to use for the model. The init method is just called if it's defined for the model, and it's needed if you define _auto = False because that means that Odoo will not create the table for you. The init method only get the database cursor and you could do what you need to do in that method. The statement tools.drop_view_if_exists it's just an utility method that execute:

cr.execute("DROP view IF EXISTS %s CASCADE" % (viewname,))

that could be done in the same view creation using the "create or replace view". The purpose is to update the view always when the module is updated

In the view part, the measure select box it will use all the fields defined as integer or float in the model, I've done some extensions to be able to use others kind of fields to create a kind of cross-table using this type of graph pivot view but it will require to override the read_group method, by default in Odoo only works for integer or float fields.
The buttons sequence are part of the graph widget of Odoo, the first button group in the image is for the types of graph that you can switch to.
Hope this helps

***Update for completeness***

Two more details:

When Odoo create the table for you(_auto = True by default) and not using an SQL view, you need to insert the data to use it using the way you prefers, direclty insert records via UI form, sql or etl operations, python model create calls, XMLRPC calls to model create method, etc

When you set _auto = False and create an SQL view to use as the model table, you need to specify an unique id field value as a return for your SQL view query, it's mandatory since Odoo will performs search for those ids before select the real data.


 

1
الصورة الرمزية
إهمال
TEIMI Yassine
الكاتب

Thanks a lot for your explainations, it's helpfull. Now I get the picture, I'll try to develop my extension, and post the result here.

TEIMI Yassine
الكاتب

I have one more question, when Odoo creates the sql table for you, does it require something to be able fill data on the sql table created ? When _auto is set to false, you perform the sql request via the init method, but when it's not set to false what does it requires so as to get data correctly on the sql table created on database by Odoo ? This is my main question, I'll fill all details on y question EDIT. Thanks Axel.

Axel Mendoza

That was something I think to write you but I don't do it, I post an update explaining that and another detail that I just left out

TEIMI Yassine
الكاتب

Thanks a lot, I get the picture now, I think it will be too painfull for me to automate data creation on the "real" sql table created by Odoo, So I think I'll use the _auto=False, and use the init method. What do you think is the best solution in my case ?

Axel Mendoza

Normally you should base your report in a model that contains the most low level data, to be able to navigate to the upper levels through many2one fields. For example if you wanna make a report for product sales you need to put your report in the sale.order.line model because it will contains the low level of the sale data with the possibility to use the product_id, sale_id, sale_id.partner_id or reach the data you need though many2one relations fields, if you don't have a low level data model that have the needed relations to access the data you need to display it's a perfect scenario to create an SQL view to retrieve all the data you need to display with the special concern of the id field I referred in the answer

TEIMI Yassine
الكاتب

Okay Axel, Thanks for this explainations, So I used the init method, and I've got an sql error, I updated my question (see EDIT 2) for error details. Thanks.

هل أعجبك النقاش؟ لا تكن مستمعاً فقط. شاركنا!

أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!

تسجيل
المنشورات ذات الصلة الردود أدوات العرض النشاط
Sales Reporting by Customer تم الحل
sales reporting dashboard
الصورة الرمزية
الصورة الرمزية
1
أكتوبر 25
3341
Reports on Dashboards - Version 8
reporting dashboard version8
الصورة الرمزية
0
أكتوبر 17
3565
what's best add-one for odoo 11 CE to handle reports and charts in dashboard
chart reporting dashboard statistics
الصورة الرمزية
الصورة الرمزية
1
أبريل 19
5149
View today's sales orders under dashboard in v7? تم الحل
reporting dashboard report sales_order
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
6
يونيو 15
8020
Dashboard / Bi Cube date filter Help
qweb reporting invoices dashboard
الصورة الرمزية
0
مايو 15
4399
المجتمع
  • دروس
  • التوثيق
  • المنتدى
مصدر مفتوح
  • تحميل
  • جيت هاب "Github"
  • المشغل الآلي رنبوت
  • الترجمات
خدماتنا
  • استضافة أودو إس إتش
  • الدعم
  • الترقية
  • التطويرات المخصصة
  • التعليم
  • اعثر على محاسب
  • اعثر على شريك
  • كنْ شريكاً
معلومات عنا
  • شركتنا
  • أصول العلامة التجارية
  • اتصلْ بنا
  • الوظائف
  • فعاليات
  • بودكاست
  • مدونة
  • عملاء
  • قانوني • الخصوصية
  • الحماية
الْعَرَبيّة 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

أودو هو عبارة عن مجموعة من تطبيقات الأعمال مفتوحة المصدر التي تغطي جميع احتياجات شركتك، مثل: إدارة علاقات العملاء والتجارة الإلكترونية والمحاسبة والمخزون ونقاط البيع وإدارة المشاريع وما إلى ذلك.

ما يجعل من أودو مميزاً هو هدفه بأن يكون سهل الاستخدام للغاية ومتكاملاً تمامًا في الوقت ذاته.

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