Passa al contenuto
Odoo Menu
  • Accedi
  • Provalo gratis
  • App
    Finanze
    • Contabilità
    • Fatturazione
    • Note spese
    • Fogli di calcolo (BI)
    • Documenti
    • Firma
    Vendite
    • CRM
    • Vendite
    • Punto vendita Negozio
    • Punto vendita Ristorante
    • Abbonamenti
    • Noleggi
    Siti web
    • Configuratore sito web
    • E-commerce
    • Blog
    • Forum
    • Live chat
    • E-learning
    Supply chain
    • Magazzino
    • Produzione
    • PLM
    • Acquisti
    • Manutenzione
    • Qualità
    Risorse umane
    • Dipendenti
    • Assunzioni
    • Ferie
    • Valutazioni
    • Referral dipendenti
    • Parco veicoli
    Marketing
    • Social marketing
    • E-mail marketing
    • SMS marketing
    • Eventi
    • Marketing automation
    • Sondaggi
    Servizi
    • Progetti
    • Fogli ore
    • Assistenza sul campo
    • Helpdesk
    • Pianificazione
    • Appuntamenti
    Produttività
    • Comunicazioni
    • Approvazioni
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    App di terze parti Odoo Studio Piattaforma cloud Odoo
  • Settori
    Retail
    • Libreria
    • Negozio di abbigliamento
    • Negozio di arredamento
    • Alimentari
    • Ferramenta
    • Negozio di giocattoli
    Cibo e ospitalità
    • Bar e pub
    • Ristorante
    • Fast food
    • Pensione
    • Grossista di bevande
    • Hotel
    Agenzia immobiliare
    • Agenzia immobiliare
    • Studio di architettura
    • Edilizia
    • Gestione immobiliare
    • Impresa di giardinaggio
    • Associazione di proprietari immobiliari
    Consulenza
    • Società di contabilità
    • Partner Odoo
    • Agenzia di marketing
    • Studio legale
    • Selezione del personale
    • Audit e certificazione
    Produzione
    • Tessile
    • Metallo
    • Arredamenti
    • Alimentare
    • Birrificio
    • Ditta di regalistica aziendale
    Benessere e sport
    • Club sportivo
    • Negozio di ottica
    • Centro fitness
    • Centro benessere
    • Farmacia
    • Parrucchiere
    Commercio
    • Tuttofare
    • Hardware e assistenza IT
    • Ditta di installazione di pannelli solari
    • Calzolaio
    • Servizi di pulizia
    • Servizi di climatizzazione
    Altro
    • Organizzazione non profit
    • Ente per la tutela ambientale
    • Agenzia di cartellonistica pubblicitaria
    • Studio fotografico
    • Punto noleggio di biciclette
    • Rivenditore di software
    Carica tutti i settori
  • Community
    Apprendimento
    • Tutorial
    • Documentazione
    • Certificazioni 
    • Formazione
    • Blog
    • Podcast
    Potenzia la tua formazione
    • Programma educativo
    • Scale Up! Business Game
    • Visita Odoo
    Ottieni il software
    • Scarica
    • Versioni a confronto
    • Note di versione
    Collabora
    • Github
    • Forum
    • Eventi
    • Traduzioni
    • Diventa nostro partner
    • Servizi per partner
    • Registra la tua società di contabilità
    Ottieni servizi
    • Trova un partner
    • Trova un contabile
    • Incontra un esperto
    • Servizi di implementazione
    • Testimonianze dei clienti
    • Supporto
    • Aggiornamenti
    GitHub Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Richiedi una demo
  • Prezzi
  • Aiuto

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

  • CRM
  • e-Commerce
  • Contabilità
  • Magazzino
  • PoS
  • Progetti
  • MRP
All apps
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
Assistenza

opcode STORE_FAST not allowed ('lambda') error when Incoming Server's Server Action is set with Python code that is writing to a browse object

Iscriviti

Ricevi una notifica quando c'è un'attività per questo post

La domanda è stata contrassegnata
serveremailopenerp7parsing
2 Risposte
9820 Visualizzazioni
Avatar
Ivan

We are getting opcode STORE_FAST not allowed ('lambda') error when Incoming Server's Server Action is set with Python code that is writing to a browse object.

We are using python version 2.7.3. OpenERP 7.0 server revno 5281.

From what we have tested, if the Server Action does not call any ORM's write method, the action will be executed OK.  But once it call the write method, although if an empty dictionary is passed to the method, the above error message is raised from line 140 of server/openerp/tools/safe_eval.py (where server is the OpenERP's server directory).

Appreciate if anybody can provide insight to this.

0
Avatar
Abbandona
Avatar
Ivan
Autore Risposta migliore

Hi Med Said, thank you for your response.  The following is the Python Code we put into the Server Action:

def parse_description(description):
    fields=['name','company','address','phone','mobile','email','message']
    _dict={}
    description=description.lower()
    for line in description.split('\n'):
        for field in fields:
            if field in line:
                split_line=line.split(':')
                if len(split_line)>1:
                    _dict[field]=line.split(':')[1]
    return _dict

lead=self.browse(cr,uid,context['active_id'],context=context)
description=lead['description']
_dict=parse_description(description)
self.write(cr,uid,context['active_id'],{
                        'name':_dict.get('name'),
                        'partner_name':_dict.get('company'),
                        'phone':_dict.get('phone'),
                        'mobile':_dict.get('mobile'),
                        'contact_name':_dict.get('name'),
                        'email_from':_dict.get('email'),
                        'street':_dict.get('address'),
                        'description':_dict.get('message')}, context=context)

We are not sure which part is causing the STORE_FAST opcode.  We have tested to compile the same string under normal python and the dis of the compile code does not list STORE_FAST either.

 

EDIT:

After further testing, we found out that if the code in Python code contains a named method, it raises the said error.  Further reading into the openerp/tools/safe_eval.py file in OpenERP server lines 143 and 144 seems to support the suspicion.  Any way, refactoring the method from the Python Code (making it into normal calls without methods) seems to resolve the issue.

Also it seems that STORE_FAST, along with LOAD_FAST and DELETE_FAST has been listed as allowable opcode since revno 5290 in launchpad or revision 4836354 in github (28 Apr 2014).

 

0
Avatar
Abbandona
Avatar
Med Said BARA
Risposta migliore

Your code is considered as unsafe, probably you've provided a name with two underscore (__name__).

Can you post an example of your code ?

(added after response from John Doe)

The only thing i see in your code that can be related to "dunder" is: _dict=parse_description (maybe putting a space before and after = can resolve this ...).

Another important thing is at line 10: Why are you splitting a second time ? This is done 2 lines above, try to replace with: _dict[field]=split.line[1]

0
Avatar
Abbandona
Ivan
Autore

Med Said BARA, Thank you for your further edits. I've also edited by Questions and the problem does not seems to be from names with underscores. Also thank you for the split hint. Yes, we should've use split _dict[field]=line[1] instead.

Med Said BARA

I will try to test on my side, using your code to see if the error is reproducible.

Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!

Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!

Registrati
Post correlati Risposte Visualizzazioni Attività
[v7] Unable to start properly the openerp server
server openerp7
Avatar
0
dic 15
3731
Incoming mail marked as read by openerp
email openerp7
Avatar
Avatar
7
mar 15
7303
Setting up Gmail as External Incoming Mail Server - How to confirm catchall forwarding address Risolto
server email catchall
Avatar
Avatar
Avatar
Avatar
3
gen 25
8627
Server Action Email sent in plain text Risolto
server email actions
Avatar
Avatar
1
lug 24
9249
Email Alignments not working properly
email openerp7 decode
Avatar
0
feb 20
3192
Community
  • Tutorial
  • Documentazione
  • Forum
Open source
  • Scarica
  • Github
  • Runbot
  • Traduzioni
Servizi
  • Hosting Odoo.sh
  • Supporto
  • Aggiornamenti
  • Sviluppi personalizzati
  • Formazione
  • Trova un contabile
  • Trova un partner
  • Diventa nostro partner
Chi siamo
  • La nostra azienda
  • Branding
  • Contattaci
  • Lavora con noi
  • Eventi
  • Podcast
  • Blog
  • Clienti
  • Note legali • Privacy
  • Sicurezza
الْعَرَبيّة 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 è un gestionale di applicazioni aziendali open source pensato per coprire tutte le esigenze della tua azienda: CRM, Vendite, E-commerce, Magazzino, Produzione, Fatturazione elettronica, Project Management e molto altro.

Il punto di forza di Odoo è quello di offrire un ecosistema unico di app facili da usare, intuitive e completamente integrate tra loro.

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