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

[8.0] Aeroo Reports: report_aeroo_direct_print error: NameError: global name 'context' is not defined

S'inscrire

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

Cette question a été signalée
printreportaeroodirect
1 Répondre
7174 Vues
Avatar
Luke Branch

I've managed to setup CUPS and have installed my HP CM1415 printer in the Aeroo Reports direct printing configuration wizard.

Using my own ODS (input template format) / XLS (output format) i've created a report for sale.order. The report is stored in the database, and all other settings are default.

When I tick the Report Wizard option I get the following error:

NameError: global name 'context' is not defined

The full traceback is here for reference:

https://gist.github.com/lukebranch/6109989e6048ad313f63

I'm running on Ubuntu 14.04 with Odoo 8.0, using this installation method:

https://www.odoo.com/forum/help-1/question/8-0-how-can-i-install-the-official-aeroo-reports-alistek-for-odoo-version-8-solved-76044

Any insight or suggestions would be very much appreciated. I've opened a github issue on the Official Aeroo Reports repository here:

https://github.com/aeroo/aeroo_reports/issues/51

0
Avatar
Ignorer
Avatar
Temur
Meilleure réponse

most probably it's because  v7 code were not (or not completelly) ported to v8... in v8 context is replaced by recs.env.context (or recs._context as it's shortcut)

according the error log, you can try to replace following line:

ctx = context.copy()

with

ctx = recs.env.context.copy()


in File "/opt/odoo/custom/addons/report_aeroo_direct_print/report_aeroo_direct_print.py", line 289 


0
Avatar
Ignorer
Temur

You'll need to restart the odoo server after this change, in order to get it worked

Luke Branch
Auteur

@Temur,

Thank you! I'll try this and report back here to let you know if it's worked.

Luke Branch
Auteur

@Temur,

It worked, thanks for your help. I've just run into another issue. When going to: Settings >> Aeroo Reports >> Printers >> HP LaserJet CM1415fnw [Or Your Printer Model Here] > Switch to Form View > Click Refresh.

I've now run into the follow error message:

TypeError: write() got an unexpected keyword argument 'context'

The full traceback is here:

https://gist.github.com/lukebranch/ac1fa483f608ce5cb9fd

I think the line that is throwing the error is here:

File "/opt/odoo/custom/addons/report_aeroo_direct_print/report_aeroo_direct_print.py", line 163, in refresh r.write({'note':note}, context=context)

There have been a few other similar issues like this reported and they all seem to be quite similar. In your opinion, is this a good place to start to learn some of the changes between the old and new API: https://www.odoo.com/documentation/8.0/reference/orm.html Do you have a github account by the way? I'd like to submit a PR with your suggested changes to the official repository and want to make sure you're properly attributed in the commit messages.

Temur

regarding the error, replacing this line:

r.write({'note':note}, context=context)

with
r.write({'note':note})
may help
Temur

yes, good place. but if you're familiar with old (v7) API, then you may find it interesting: http://fr.slideshare.net/openobject/odoo-from-v7-to-v8-the-new-api

Temur

yes, I have couple of accounts on github, but I grant you all rights if you like to contribute to that project. these are really minor fixes and based on error log, I have not read the code anyway, it's not necessary to mention me.

Luke Branch
Auteur

@Temur,

Thank you for all of your help. I will be submitting the PR's today, and will comment back here with the links and attribute yourself and this post in the commit notes.

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é
how to add print report in OpenERP 7 using aeroo?
print report aeroo
Avatar
Avatar
1
mars 15
7258
Doubt when creating report using aeroo report in Openerp7(Adding Inherit fields)
report aeroo
Avatar
1
sept. 17
6444
How to print one2many field using aeroo report in openerp7?
report aeroo
Avatar
Avatar
2
sept. 17
6937
how to check if report has been printed
print report
Avatar
Avatar
1
nov. 16
5192
Aeroo Report on MacOSX
report aeroo
Avatar
0
mars 15
4069
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