Skip to Content
Odoo Menu
  • Prisijungti
  • Išbandykite nemokamai
  • Programėlės
    Finansai
    • Apskaita
    • Pateikimas apmokėjimui
    • Sąnaudos
    • Skaičiuoklė (BI)
    • Dokumentai
    • Pasirašymas
    Pardavimai
    • CRM
    • Pardavimai
    • Kasų sistema - Parduotuvė
    • Kasų sistema - Restoranas
    • Prenumeratos
    • Nuoma
    Svetainės
    • Svetainių kūrėjimo įrankis
    • El. Prekyba
    • Internetinis Tinklaraštis
    • Forumas
    • Tiesioginis pokalbis
    • eMokymasis
    Tiekimo grandinė
    • Atsarga
    • Gamyba
    • PLM
    • Įsigijimai
    • Priežiūra
    • Kokybė
    Žmogaus ištekliai
    • Darbuotojai
    • Įdarbinimas
    • Atostogos
    • Įvertinimai
    • Rekomendacijos
    • Transporto priemonės
    Rinkodara
    • Socialinė rinkodara
    • Rinkodara el. paštu
    • SMS rinkodara
    • Renginiai
    • Rinkodaros automatizavimas
    • Apklausos
    Paslaugos
    • Projektas
    • Darbo laiko žiniaraščiai
    • Priežiūros tarnyba
    • Pagalbos tarnyba
    • Planavimas
    • Rezervacijos
    Produktyvumas
    • Diskucija
    • Patvirtinimai
    • IoT
    • VoIP
    • Žinių biblioteka
    • WhatsApp
    Trečiųjų šalių programos Odoo Studija Odoo debesijos platforma
  • Pramonės šakos
    Mažmeninė prekyba
    • Knygynas
    • Drabužių parduotuvė
    • Baldų parduotuvė
    • Maisto prekių parduotuvė
    • Techninės įrangos parduotuvė
    • Žaislų parduotuvė
    Food & Hospitality
    • Barai ir pub'ai
    • Restoranas
    • Greitasis maistas
    • Guest House
    • Gėrimų platintojas
    • Hotel
    Nekilnojamasis turtas
    • Real Estate Agency
    • Architektūros įmonė
    • Konstrukcija
    • Estate Managament
    • Sodininkauti
    • Turto savininkų asociacija
    Konsultavimas
    • Accounting Firm
    • Odoo Partneris
    • Marketing Agency
    • Teisinė firma
    • Talentų paieška
    • Auditai & sertifikavimas
    Gamyba
    • Textile
    • Metal
    • Furnitures
    • Maistas
    • Brewery
    • Įmonių dovanos
    Sveikata & Fitnesas
    • Sporto klubas
    • Akinių parduotuvė
    • Fitneso Centras
    • Sveikatos praktikai
    • Vaistinė
    • Kirpėjas
    Trades
    • Handyman
    • IT įranga ir palaikymas
    • Saulės energijos sistemos
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Kiti
    • Nonprofit Organization
    • Aplinkos agentūra
    • Reklaminių stendų nuoma
    • Fotografavimas
    • Dviračių nuoma
    • Programinės įrangos perpardavėjas
    Browse all Industries
  • Bendrija
    Mokykitės
    • Mokomosios medžiagos
    • Dokumentacija
    • Sertifikatai
    • Mokymai
    • Internetinis Tinklaraštis
    • Tinklalaidės
    Skatinkite švietinimą
    • Švietimo programa
    • Scale Up! Verslo žaidimas
    • Aplankykite Odoo
    Gaukite programinę įrangą
    • Atsisiųsti
    • Palyginkite versijas
    • Leidimai
    Bendradarbiauti
    • Github
    • Forumas
    • Renginiai
    • Vertimai
    • Tapkite partneriu
    • Services for Partners
    • Registruokite jūsų apskaitos įmonę
    Gaukite paslaugas
    • Susiraskite partnerį
    • Susirask buhalterį
    • Susitikti su konsultantu
    • Diegimo paslaugos
    • Klientų rekomendavimas
    • Palaikymas
    • Atnaujinimai
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Gaukite demo
  • Kainodara
  • Pagalba

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

  • CRM
  • e-Commerce
  • Apskaita
  • Atsarga
  • PoS
  • Projektas
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
Pagalba

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

Prenumeruoti

Get notified when there's activity on this post

This question has been flagged
serveremailopenerp7parsing
2 Replies
9836 Rodiniai
Portretas
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
Portretas
Atmesti
Portretas
Ivan
Autorius Best Answer

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
Portretas
Atmesti
Portretas
Med Said BARA
Best Answer

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
Portretas
Atmesti
Ivan
Autorius

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.

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

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

Registracija
Related Posts Replies Rodiniai Veikla
[v7] Unable to start properly the openerp server
server openerp7
Portretas
0
gruod. 15
3733
Incoming mail marked as read by openerp
email openerp7
Portretas
Portretas
7
kov. 15
7307
Setting up Gmail as External Incoming Mail Server - How to confirm catchall forwarding address Solved
server email catchall
Portretas
Portretas
Portretas
Portretas
3
saus. 25
8634
Server Action Email sent in plain text Solved
server email actions
Portretas
Portretas
1
liep. 24
9261
Email Alignments not working properly
email openerp7 decode
Portretas
0
vas. 20
3197
Bendrija
  • Mokomosios medžiagos
  • Dokumentacija
  • Forumas
Atvirasis kodas
  • Atsisiųsti
  • Github
  • Runbot
  • Vertimai
Paslaugos
  • Odoo.sh talpinimas
  • Palaikymas
  • Atnaujinti
  • Pritaikytas programavimo kūrimas
  • Švietimas
  • Susirask buhalterį
  • Susiraskite partnerį
  • Tapkite partneriu
Apie mus
  • Mūsų įmonė
  • Prekės ženklo turtas
  • Susisiekite su mumis
  • Darbo pasiūlymai
  • Renginiai
  • Tinklalaidės
  • Internetinis Tinklaraštis
  • Klientai
  • Teisinis • Privatumas
  • Saugumas
الْعَرَبيّة 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 yra atvirojo kodo verslo programų rinkinys, kuris apima visas įmonės poreikius: CRM, El. Prekybą, Apskaitą, Atsargų, Kasų sistemą, Projektų valdymą ir kt.

Unikali Odoo vertės pasiūla – būti tuo pačiu metu labai lengvai naudojama ir visiškai integruota sistema.

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