Skip to Content
Odoo Menu
  • Zaloguj się
  • Wypróbuj za darmo
  • Aplikacje
    Finanse
    • Księgowość
    • Fakturowanie
    • Wydatki
    • Arkusz kalkulacyjny (BI)
    • Dokumenty
    • Podpisy
    Sprzedaż
    • CRM
    • Sprzedaż
    • PoS Sklep
    • PoS Restauracja
    • Subskrypcje
    • Wypożyczalnia
    Strony Internetowe
    • Kreator Stron Internetowych
    • eCommerce
    • Blog
    • Forum
    • Czat na Żywo
    • eLearning
    Łańcuch dostaw
    • Magazyn
    • Produkcja
    • PLM
    • Zakupy
    • Konserwacja
    • Jakość
    Zasoby Ludzkie
    • Pracownicy
    • Rekrutacja
    • Urlopy
    • Ocena pracy
    • Polecenia Pracownicze
    • Flota
    Marketing
    • Marketing Społecznościowy
    • E-mail Marketing
    • SMS Marketing
    • Wydarzenia
    • Automatyzacja Marketingu
    • Ankiety
    Usługi
    • Projekt
    • Ewidencja czasu pracy
    • Usługi Terenowe
    • Helpdesk
    • Planowanie
    • Spotkania
    Produktywność
    • Dyskusje
    • Zatwierdzenia
    • IoT
    • VoIP
    • Baza wiedzy
    • WhatsApp
    Aplikacje trzecich stron Studio Odoo Odoo Cloud Platform
  • Branże
    Sprzedaż detaliczna
    • Księgarnia
    • Sklep odzieżowy
    • Sklep meblowy
    • Sklep spożywczy
    • Sklep z narzędziami
    • Sklep z zabawkami
    Żywienie i hotelarstwo
    • Bar i Pub
    • Restauracja
    • Fast Food
    • Pensjonat
    • Dystrybutor napojów
    • Hotel
    Agencja nieruchomości
    • Agencja nieruchomości
    • Biuro architektoniczne
    • Budowa
    • Zarządzanie nieruchomościami
    • Ogrodnictwo
    • Stowarzyszenie właścicieli nieruchomości
    Doradztwo
    • Biuro księgowe
    • Partner Odoo
    • Agencja marketingowa
    • Kancelaria prawna
    • Agencja rekrutacyjna
    • Audyt i certyfikacja
    Produkcja
    • Tekstylia
    • Metal
    • Meble
    • Jedzenie
    • Browar
    • Prezenty firmowe
    Zdrowie & Fitness
    • Klub sportowy
    • Salon optyczny
    • Centrum fitness
    • Praktycy Wellness
    • Apteka
    • Salon fryzjerski
    Transakcje
    • Złota rączka
    • Wsparcie Sprzętu IT
    • Systemy energii słonecznej
    • Szewc
    • Firma sprzątająca
    • Usługi HVAC
    Inne
    • Organizacja non-profit
    • Agencja Środowiskowa
    • Wynajem billboardów
    • Fotografia
    • Leasing rowerów
    • Sprzedawca oprogramowania
    Przeglądaj wszystkie branże
  • Community
    Ucz się
    • Samouczki
    • Dokumentacja
    • Certyfikacje
    • Szkolenie
    • Blog
    • Podcast
    Pomóż w nauce innym
    • Program Edukacyjny
    • Scale Up! Gra biznesowa
    • Odwiedź Odoo
    Skorzystaj z oprogramowania
    • Pobierz
    • Porównaj edycje
    • Wydania
    Współpracuj
    • Github
    • Forum
    • Wydarzenia
    • Tłumaczenia
    • Zostań partnerem
    • Usługi dla partnerów
    • Zarejestruj swoją firmę rachunkową
    Skorzystaj z usług
    • Znajdź partnera
    • Znajdź księgowego
    • Spotkaj się z doradcą
    • Usługi wdrożenia
    • Opinie klientów
    • Wsparcie
    • Aktualizacje
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Zaplanuj demo
  • Cennik
  • Pomoc

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

  • CRM
  • e-Commerce
  • Księgowość
  • Zapasy
  • PoS
  • Projekt
  • MRP
All apps
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Pomoc

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

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
serveremailopenerp7parsing
2 Odpowiedzi
9817 Widoki
Awatar
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
Awatar
Odrzuć
Awatar
Ivan
Autor Najlepsza odpowiedź

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
Awatar
Odrzuć
Awatar
Med Said BARA
Najlepsza odpowiedź

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
Awatar
Odrzuć
Ivan
Autor

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.

Podoba Ci się ta dyskusja? Dołącz do niej!

Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!

Zarejestruj się
Powiązane posty Odpowiedzi Widoki Czynność
[v7] Unable to start properly the openerp server
server openerp7
Awatar
0
gru 15
3731
Incoming mail marked as read by openerp
email openerp7
Awatar
Awatar
7
mar 15
7303
Setting up Gmail as External Incoming Mail Server - How to confirm catchall forwarding address Rozwiązane
server email catchall
Awatar
Awatar
Awatar
Awatar
3
sty 25
8627
Server Action Email sent in plain text Rozwiązane
server email actions
Awatar
Awatar
1
lip 24
9248
Email Alignments not working properly
email openerp7 decode
Awatar
0
lut 20
3190
Społeczność
  • Samouczki
  • Dokumentacja
  • Forum
Open Source
  • Pobierz
  • Github
  • Runbot
  • Tłumaczenia
Usługi
  • Hosting Odoo.sh
  • Wsparcie
  • Aktualizacja
  • Indywidualne rozwiązania
  • Edukacja
  • Znajdź księgowego
  • Znajdź partnera
  • Zostań partnerem
O nas
  • Nasza firma
  • Zasoby marki
  • Skontaktuj się z nami
  • Oferty pracy
  • Wydarzenia
  • Podcast
  • Blog
  • Klienci
  • Informacje prawne • Prywatność
  • Bezpieczeństwo Odoo
الْعَرَبيّة 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 to pakiet aplikacji biznesowych typu open source, które zaspokoją wszystkie potrzeby Twojej firmy: CRM, eCommerce, księgowość, inwentaryzacja, punkt sprzedaży, zarządzanie projektami itp.

Unikalną wartością Odoo jest to, że jest jednocześnie bardzo łatwe w użyciu i w pełni zintegrowane.

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