Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Validations
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Épicerie
    • Quincaillerie
    • Magasin de jouets
    Food & Hospitality
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Maison d’hôtes
    • Distributeur de boissons
    • Hôtel
    Immobilier
    • Agence immobilière
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consultance
    • Cabinet d'expertise comptable
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Métal
    • Meubles
    • Alimentation
    • Brewery
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Trades
    • Bricoleur
    • Matériel informatique et support
    • Systèmes photovoltaïques
    • Cordonnier
    • Services de nettoyage
    • Services CVC
    Autres
    • Organisation à but non lucratif
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Browse all Industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenez partenaire
    • Services for Partners
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide

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

  • CRM
  • e-Commerce
  • Comptabilité
  • Inventaire
  • PoS
  • Projet
  • MRP
All apps
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

TypeError: 'Undefined' object is not callable

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
errormakoundefined
1 Répondre
10810 Vues
Avatar
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
Avatar
Ignorer
Avatar
Serpent Consulting Services Pvt. Ltd.
Meilleure réponse

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
Avatar
Ignorer
Muaz
Auteur

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

Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
ERROR to Create Invoices: Uncaught TypeError: Cannot read property '1' of undefined
error undefined
Avatar
0
mars 15
5503
Encountered a "Odoo client error", pls advise
javascript error client undefined
Avatar
Avatar
3
juil. 24
14684
?"Your country might be blocked by our hosting provider" error when I create new website
error
Avatar
0
oct. 25
529
Payment Page Return Error with Razorpay on Mobile Devices
error
Avatar
0
sept. 25
1146
Error after installing "purchase" app in Odoo version 18
error
Avatar
Avatar
1
déc. 24
6595
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenez partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

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