Skip to Content
Odoo Menu
  • Prijavi
  • Try it free
  • Aplikacije
    Finance
    • Knjigovodstvo
    • Obračun
    • Stroški
    • Spreadsheet (BI)
    • Dokumenti
    • Podpisovanje
    Prodaja
    • CRM
    • Prodaja
    • POS Shop
    • POS Restaurant
    • Naročnine
    • Najem
    Spletne strani
    • Website Builder
    • Spletna trgovina
    • Blog
    • Forum
    • Pogovor v živo
    • eUčenje
    Dobavna veriga
    • Zaloga
    • Proizvodnja
    • PLM
    • Nabava
    • Vzdrževanje
    • Kakovost
    Kadri
    • Kadri
    • Kadrovanje
    • Odsotnost
    • Ocenjevanja
    • Priporočila
    • Vozni park
    Marketing
    • Družbeno Trženje
    • Email Marketing
    • SMS Marketing
    • Dogodki
    • Avtomatizacija trženja
    • Ankete
    Storitve
    • Projekt
    • Časovnice
    • Storitve na terenu
    • Služba za pomoč
    • Načrtovanje
    • Termini
    Produktivnost
    • Razprave
    • Odobritve
    • IoT
    • Voip
    • Znanje
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industrije
    Trgovina na drobno
    • Book Store
    • Trgovina z oblačili
    • Trgovina s pohištvom
    • Grocery Store
    • Trgovina s strojno opremo računalnikov
    • Trgovina z igračami
    Food & Hospitality
    • Bar and Pub
    • Restavracija
    • Hitra hrana
    • Guest House
    • Beverage Distributor
    • Hotel
    Nepremičnine
    • Real Estate Agency
    • Arhitekturno podjetje
    • Gradbeništvo
    • Estate Management
    • Vrtnarjenje
    • Združenje lastnikov nepremičnin
    Svetovanje
    • Računovodsko podjetje
    • Odoo Partner
    • Marketinška agencija
    • Law firm
    • Pridobivanje talentov
    • Audit & Certification
    Proizvodnja
    • Tekstil
    • Metal
    • Pohištvo
    • Hrana
    • Brewery
    • Poslovna darila
    Health & Fitness
    • Športni klub
    • Trgovina z očali
    • Fitnes center
    • Wellness Practitioners
    • Lekarna
    • Frizerski salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Sistemi sončne energije
    • Izdelovalec čevljev
    • Čistilne storitve
    • HVAC Services
    Ostali
    • Neprofitna organizacija
    • Agencija za okolje
    • Najem oglasnih panojev
    • Fotografija
    • Najem koles
    • Prodajalec programske opreme
    Browse all Industries
  • Skupnost
    Learn
    • Tutorials
    • Dokumentacija
    • Certifikati
    • Šolanje
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Prenesi
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Dogodki
    • Prevodi
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Sklici kupca
    • Podpora
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Določanje cen
  • Pomoč

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

  • CRM
  • e-Commerce
  • Knjigovodstvo
  • Zaloga
  • PoS
  • Projekt
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
Pomoč

Odoo Qweb Reports problems

Naroči se

Get notified when there's activity on this post

This question has been flagged
3 Odgovori
5843 Prikazi
Avatar
Mostafa Mohamed Abdel Monaem

Hi there i need help here grin emoticon

i need to get values from function get_timetable but when i want to print the report it says
QWebException: "'NoneType' object is not callable" while evaluating
'get_timetable(o)'

fci_time_table_report.py


    import time
    from openerp import  osv
    from openerp.report import report_sxw
    
    class timetable_info(report_sxw.rml2sxw):
        def __init__(self, cr, uid, name, context=None):
            super(timetable_info, self).__init__(cr, uid, name, context=context)
            self.localcontext.update({
                'time': time,
                'get_timetable':self._get_timetable,
            })
    
        def _get_timetable(self, timetable_id):
            timetable_detail=[]
            
            self.cr.execute(" select t.start_time,t.end_time,s.name,week_day,r.name as"
                            " teacher from fci_time_table_line t, fci_subject_subject s, resource_resource r, "
                            "hr_employee hr where t.subject_id= s.id and t.teacher_id= hr.id  and "
                            "hr.resource_id = r.id  and table_id = %d group by start_time,end_time,s.name,week_day,r.name"
                            " order by start_time"%(timetable_id.id))
            res = self.cr.dictfetchall()
            self.cr.execute("select start_time,end_time from fci_time_table_line where table_id=%d group by start_time,end_time  order by start_time"%(timetable_id.id))
            time_data = self.cr.dictfetchall()
            for time_detail in time_data:
                for data in res:
                    if time_detail['start_time']==data['start_time'] and time_detail['end_time']==data['end_time']:
                        if (data['name']=='Recess'):
                            time_detail[data['week_day']] = data['name']
                        else:
                            time_detail[data['week_day']] = data['name']+ '\n(' +data['teacher']+')'
                timetable_detail.append(time_detail)
            return timetable_detail
    class report_time_table(osv.AbstractModel):
        _name = 'FCI_ERP.timetable_report_document'
        _inherit = 'report.abstract_report'
        _template = 'FCI_ERP.timetable_report_document'
        _wrapped_report_class = timetable_info

and here it is my report view in XML

   
     <table class="gridtable center">
    <tr t-foreach="get_timetable(o)" t-as="a">
    
    <td>
    <span t-esc=" a['start_time'] - a['end_time']"/>
    </td>
    
    <td>
    <span t-esc="a['saturday'] "/>
    </td>
    <td>
    <span t-esc="o['sunday']"/>
    </td>
    </tr>
    </table>

 

0
Avatar
Opusti
Mostafa Mohamed Abdel Monaem
Avtor

Edited any help ?

Zbik

your depends in __openerp__.py?

Mostafa Mohamed Abdel Monaem
Avtor

hr

Mostafa Mohamed Abdel Monaem
Avtor

ok thanks ,, i have another question,,i'm new and i don't know what i do write or not in xml ? to get the values by this function,,thanks in advance

Mostafa Mohamed Abdel Monaem
Avtor

@Emipro Technologies Pvt. Ltd. it still same error :( QWebException: "'NoneType' object is not callable" while evaluating 'get_timetable(o)'

Avatar
Zbik
Best Answer

In __openerp__.py, try this

'depends': ['hr','report']

1
Avatar
Opusti
Avatar
Mostafa Mohamed Abdel Monaem
Avtor Best Answer

Still same problem :(

QWebException: "'NoneType' object is not callable" while evaluating
'get_timetable(o)'

 

0
Avatar
Opusti
Zbik

1) you enable debug and verify execution timetable_info(). Executed or no? 2) report call definition in xml? 3) v7 or v8?

Mostafa Mohamed Abdel Monaem
Avtor

No i don't enable debug mode i edit the code and upgrade if the module still have same error i reinstall and so... yea i follow that guide http://blog.emiprotechnologies.com/create-qweb-report-odoo/... odoo-V8

Alaa Ahmed

so did you find the solution ??

Avatar
Emipro Technologies Pvt. Ltd.
Best Answer

Hi,

You just need to change one thing as like below.

class timetable_info(report_sxw.rml_parse):
        def __init__(self, cr, uid, name, context=None):
            super(timetable_info, self).__init__(cr, uid, name, context=context)
            self.localcontext.update({
                'time': time,
                'get_timetable':self._get_timetable,
            })

Here you just need to change inherited class name. I hope it will work.

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

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

Prijavi
Community
  • Tutorials
  • Dokumentacija
  • Forum
Open Source
  • Prenesi
  • Github
  • Runbot
  • Prevodi
Services
  • Odoo.sh Hosting
  • Podpora
  • Nadgradnja
  • Custom Developments
  • Izobraževanje
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Sredstva blagovne znamke
  • Kontakt
  • Zaposlitve
  • Dogodki
  • Podcast
  • Blog
  • Stranke
  • Pravno • Zasebnost
  • Varnost
الْعَرَبيّة 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