Overslaan naar inhoud
Odoo Menu
  • Aanmelden
  • Probeer het gratis
  • Apps
    Financiën
    • Boekhouding
    • Facturatie
    • Onkosten
    • Spreadsheet (BI)
    • Documenten
    • Ondertekenen
    Verkoop
    • CRM
    • Verkoop
    • Kassasysteem winkel
    • Kassasysteem Restaurant
    • Abonnementen
    • Verhuur
    Websites
    • Websitebouwer
    • E-commerce
    • Blog
    • Forum
    • Live Chat
    • E-learning
    Bevoorradingsketen
    • Voorraad
    • Productie
    • PLM
    • Inkoop
    • Onderhoud
    • Kwaliteit
    Personeelsbeheer
    • Werknemers
    • Werving & Selectie
    • Verlof
    • Evaluaties
    • Aanbevelingen
    • Wagenpark
    Marketing
    • Sociale media-marketing
    • E-mailmarketing
    • Sms-marketing
    • Evenementen
    • Marketingautomatisering
    • Enquêtes
    Diensten
    • Project
    • Urenstaten
    • Buitendienst
    • Helpdesk
    • Planning
    • Afspraken
    Productiviteit
    • Chat
    • Goedkeuringen
    • IoT
    • VoIP
    • Kennis
    • WhatsApp
    Apps van derden Odoo Studio Odoo Cloud Platform
  • Bedrijfstakken
    Detailhandel
    • Boekhandel
    • kledingwinkel
    • Meubelzaak
    • Supermarkt
    • Bouwmarkt
    • Speelgoedwinkel
    Horeca & Hospitality
    • Bar en café
    • Restaurant
    • Fastfood
    • Gastenverblijf
    • Drankenhandelaar
    • Hotel
    Vastgoed
    • Makelaarskantoor
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van mede-eigenaren
    Consulting
    • Accountantskantoor
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textiel
    • Metaal
    • Meubels
    • Eten
    • Brouwerij
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Diensten
    • Klusjesman
    • IT-hardware & ondersteuning
    • Zonne-energiesystemen
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC-diensten
    Andere
    • Non-profitorganisatie
    • Milieuagentschap
    • Verhuur van Billboards
    • Fotograaf
    • Fietsleasing
    • Softwareverkoper
    Alle bedrijfstakken bekijken
  • Community
    Leren
    • Tutorials
    • Documentatie
    • Certificeringen
    • Training
    • Blog
    • Podcast
    Versterk het onderwijs
    • Onderwijsprogramma
    • Scale Up! Business Game
    • Odoo bezoeken
    Download de Software
    • Downloaden
    • Vergelijk edities
    • Releases
    Werk samen
    • Github
    • Forum
    • Evenementen
    • Vertalingen
    • Partner worden
    • Diensten voor partners
    • Registreer je accountantskantoor
    Diensten
    • Vind een partner
    • Vind een boekhouder
    • Een adviseur ontmoeten
    • Implementatiediensten
    • Klantreferenties
    • Ondersteuning
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Vraag een demo aan
  • Prijzen
  • Help
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Help

TypeError: 'str' object is not callable

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
pdferrorxmlstrodoo10e
3 Antwoorden
15681 Weergaven
Avatar
Daniel Medina

Hello my project was working well a few hours ago, no errors and was printing my pdf correctly, but suddenly I get this error


You can find my module here: https://github.com/dan18fan/dan


thanks!

0
Avatar
Annuleer
Nikhil Krishnan

Daniel, please provide the code here. that more essay for other developers. give more details for your module like odoo version, what change you made, etc.

Avatar
Nikhil Krishnan
Beste antwoord

HI Daniel Medina,
     i just check your code and it seem that there is no function print_work_order.

so you just write a function to print the report.

And one think i noticed that in the " orden_trabajo.py"

class reporte_ot_pdf(osv.AbstractModel):
_name = "report.orden_trabajo.orden_de_trabajo"
_inherit = "report.abstract_report"
_template = "orden_trabajo.orden_de_trabajo"
_wrapped_report_class = reporte_ot

try this code.
Thanks.

2
Avatar
Annuleer
Avatar
Daniel Medina
Auteur Beste antwoord

HI Daniel Medina,
     i just check your code and it seem that there is no function print_work_order.

so you just write a function to print the report.

And one think i noticed that in the " orden_trabajo.py"

class reporte_ot_pdf(osv.AbstractModel):
_name = "report.orden_trabajo.orden_de_trabajo"
_inherit = "report.abstract_report"
_template = "orden_trabajo.orden_de_trabajo"
_wrapped_report_class = reporte_ot

try this code.
Thanks.


Hello, thanks for your help


I modifyied my orden_trabajo.py as you said nothing seemed to change drastically, the reason why there is no print_work_order function in my module it's because I added that function on the sale's module sale.py located in models folder, I just tried deleting that function from sale's .py file and added it to my module in the file button_model.py located in the models folder


Now I'm getting the following error:

AttributeError: type object 'sale.order' has no attribute 'print_work_order'

Not sure if its a inheritance issue :(

# -*- coding: utf-8 -*-
from odoo import models, api

class boton_orden_trabajo(models.Model):
_name = 'boton.ot'
_inherit = 'sale.order'

@api.multi
def print_work_order(self):
return self.env['report'].get_action(self, 'orden_trabajo.orden_de_trabajo')    

0
Avatar
Annuleer
Nikhil Krishnan

you do one think, you just replace the by this.

class boton_orden_trabajo(models.Model):

_inherit = 'sale.order'

it will work fine.

Daniel Medina
Auteur

Not working..

AttributeError: type object 'sale.order' has no attribute 'print_work_order'

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

from odoo import models, api, _

class boton_orden_trabajo(models.Model):

_inherit = "sale.order"

@api.multi

def print_work_order(self):

return self.env['report'].get_action(self, 'orden_trabajo.orden_de_trabajo')

Daniel Medina
Auteur

Nevermind it works now, I had to restart the server :)

Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!

Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!

Aanmelden
Gerelateerde posts Antwoorden Weergaven Activiteit
XMLSyntaxError when installing custom module
error xml mail.template
Avatar
0
dec. 25
3
PDF in Peppol Opgelost
pdf xml PEPPOL
Avatar
1
nov. 25
987
Error while creating template for pdf
pdf xml v15
Avatar
Avatar
1
mei 25
4632
Error with external_layout_striped in Odoo 17
pdf error layout.xml
Avatar
Avatar
Avatar
2
jul. 24
3917
odoo server error
views error xml
Avatar
Avatar
1
dec. 19
4840
Community
  • Tutorials
  • Documentatie
  • Forum
Open Source
  • Downloaden
  • Github
  • Runbot
  • Vertalingen
Diensten
  • Odoo.sh Hosting
  • Ondersteuning
  • Upgrade
  • Gepersonaliseerde ontwikkelingen
  • Onderwijs
  • Vind een boekhouder
  • Vind een partner
  • Partner worden
Over ons
  • Ons bedrijf
  • Merkelementen
  • Neem contact met ons op
  • Vacatures
  • Evenementen
  • Podcast
  • Blog
  • Klanten
  • Juridisch • Privacy
  • Beveiliging
الْعَرَبيّة 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 Svenska ภาษาไทย Türkçe українська Tiếng Việt

Odoo is een suite van open source zakelijke apps die aan al je bedrijfsbehoeften voldoet: CRM, E-commerce, boekhouding, inventaris, kassasysteem, projectbeheer, enz.

Odoo's unieke waardepropositie is om tegelijkertijd zeer gebruiksvriendelijk en volledig geïntegreerd te zijn.

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