Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

TypeError: 'Undefined' object is not callable

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
errormakoundefined
1 Răspunde
10823 Vizualizări
Imagine profil
Muaz

my report.py

import time
from openerp import report
 from openerp.osv import osv
import openerp.pooler
from openerp.report import report_sxw
from openerp.osv import osv,fields
from openerp.tools.translate import _
from openerp.tools import amount_to_text_en

 class iec_account_report_webkit(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
    super(iec_account_report_webkit, self).__init__(cr, uid, name, context=context)
    self.localcontext.update({
        'get_iec_accounts': self._get_iec_accounts,
        'time': time,
        'cr':cr,
        'uid': uid,
        })

def _get_iec_accounts(self, obj):

     payslip_line = self.pool.get('account_move_line')
     payslip_lines = []  
     res = []
     self.cr.execute("SELECT pl.account_id "\
                    "pl.sum(debit) as debit"\
                    "pl.sum(credit) as credit"\
                    "pl.name","pl.date"\
                    " from account_move_line as pl"\
                    "WHERE (date_from >= %s) AND (date_to <= %s)"\
                    "ORDER BY pl.account_id",
                    (self.date_from, self.date_to))
     payslip_lines = [x[0] for x in self.cr.fetchall()]
     for line in payslip_line.browse(self.cr, self.uid, payslip_lines):
        res.append({                
            'name': line.account_id.name

        })         
     return res

   report_sxw.report_sxw('report.iec.account.report.webkit',
                  'account.account',
                  '/addons/iec_report_account/report/iec_report_webkit.mako', parser=iec_account_report_webkit)
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

my mako template:

 <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.0 Transitional//EN”>
<html>
<head>
<style type="text/css">
    ${css}
   </style>

</head>
<body>
%for o in objects:
<table  width="100%">
        <tr>
            <td style="text-align:center;">
                <h3><b> Mako </b></h3>
            </td>
        </tr>
</table>

 <table width="100%" style="font-weight: bold ;font-size: 12px ;border-bottom:1px solid black;">  
    <tr>
        <td width="60%">
            ${_('Account Name') }
        </td>
        <td width="10%">
            ${_('Debit') }
        </td>
        <td width="10%">
            ${_('Credit') }
        </td>                      
    </tr>
  </table>


    %for account in (get_iec_accounts(o)):
    <tbody>
    <tr>

            <td width="60%" >${account['name']}</td>
            <td width="10%" style="text-align:right;">${account['debit']}</td>
            <td width="10%" style="text-align:right;">${account['credit']}</td>

    </tr>
    </tbody>
    %endfor 
</table> 
%endfor
 </body>
 </html>

when i print show this error:

 Webkit render!

     Traceback (most recent call last):
    File "C:\Program Files (x86)\OpenERP 7.0-20131206-         002433\Server\server\openerp\addons\report_webkit\webkit_report.py", line 273, in create_single_pdf

 File "mako\template.pyc", line 302, in render

File "mako\runtime.pyc", line 660, in _render

 File "mako\runtime.pyc", line 692, in _render_context

File "mako\runtime.pyc", line 718, in _exec_template

  File "memory:0x36872f0", line 34, in render_body
   %for account in (get_iec_accounts(o)):
  TypeError: 'Undefined' object is not callable
0
Imagine profil
Abandonează
Imagine profil
Serpent Consulting Services Pvt. Ltd.
Cel mai bun răspuns

Muaz,

Use %for account in get_iec_accounts(o):

I believe you even need not to pass any arg as you don't use in method!

Thanks.

0
Imagine profil
Abandonează
Muaz
Autor

pales help me, how can i pass arg to my method. i want to make report by range date

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

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

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
ERROR to Create Invoices: Uncaught TypeError: Cannot read property '1' of undefined
error undefined
Imagine profil
0
mar. 15
5509
Encountered a "Odoo client error", pls advise
javascript error client undefined
Imagine profil
Imagine profil
3
iul. 24
14685
?"Your country might be blocked by our hosting provider" error when I create new website
error
Imagine profil
0
oct. 25
533
Payment Page Return Error with Razorpay on Mobile Devices
error
Imagine profil
0
sept. 25
1153
Error after installing "purchase" app in Odoo version 18
error
Imagine profil
Imagine profil
1
dec. 24
6600
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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