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

Non-dict expression

Prenumeruoti

Get notified when there's activity on this post

This question has been flagged
buttonformview
2 Replies
3697 Rodiniai
Portretas
Guilherme

Hello guys, yesterday i've make a button in my odoo module and that button have the action created is .py file but the only code i put there was "return True;" just for me was able to see if the buttons is working or not, and until yesterday the button was working, today the button doesn't work give me the error "Non-dict expression"...




I'll post my code bellow:   


And the code in .py file is: 

def teste_butao(self):

    returnTrue;


Anyone can help me with this please? 

Appreciate your time and afford already, tks!

0
Portretas
Atmesti
loay elhaj

Could you copy & share full error message

Portretas
Guilherme
Autorius Best Answer

Remove the " attrs="required" " of "  " and solve the problem!

0
Portretas
Atmesti
Portretas
loay elhaj
Best Answer

Try to replace return True and add pass

1
Portretas
Atmesti
Guilherme
Autorius

@loay elhaj, the full error message is this(maybe the xml part will be executed but i edit my post and now i have a print of the xml part where it gives me an error):

Odoo Server Error
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 677, in _tag_root
f(rec)
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 580, in _tag_record
record = model._load_records([data], self.mode == 'update')
File "/usr/lib/python3/dist-packages/odoo/models.py", line 4220, in _load_records
data['record']._load_records_write(data['values'])
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 1841, in _load_records_write
super(View, self)._load_records_write(values)
File "/usr/lib/python3/dist-packages/odoo/models.py", line 4149, in _load_records_write
self.write(values)
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 500, in write
res = super(View, self).write(self._compute_defaults(vals))
File "/usr/lib/python3/dist-packages/odoo/models.py", line 3703, in write
fields[0].determine_inverse(real_recs)
File "/usr/lib/python3/dist-packages/odoo/fields.py", line 1187, in determine_inverse
getattr(records, self.inverse)()
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 300, in _inverse_arch
view.write(data)
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 500, in write
res = super(View, self).write(self._compute_defaults(vals))
File "/usr/lib/python3/dist-packages/odoo/models.py", line 3693, in write
real_recs._validate_fields(vals, inverse_fields)
File "/usr/lib/python3/dist-packages/odoo/models.py", line 1266, in _validate_fields
check(self)
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 411, in _check_xml
)).with_traceback(e.__traceback__) from None
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 391, in _check_xml
view.postprocess_and_fields(view_doc, validate=True)
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 850, in postprocess_and_fields
arch, name_manager = self._postprocess_view(node, model, validate=validate)
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 862, in _postprocess_view
self.postprocess(node, [], editable, name_manager)
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 962, in postprocess
self.postprocess(child, current_node_path, node_info['editable'], name_manager)
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 962, in postprocess
self.postprocess(child, current_node_path, node_info['editable'], name_manager)
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 962, in postprocess
self.postprocess(child, current_node_path, node_info['editable'], name_manager)
[Previous line repeated 1 more time]
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 954, in postprocess
self._validate_attrs(node, name_manager, node_info)
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 1301, in _validate_attrs
for key, val_ast in get_dict_asts(expr).items():
File "/usr/lib/python3/dist-packages/odoo/tools/view_validation.py", line 88, in get_dict_asts
raise ValueError("Non-dict expression")
odoo.exceptions.ValidationError: Error while validating view:

Non-dict expression

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_http.py", line 237, in _dispatch
result = request.dispatch()
File "/usr/lib/python3/dist-packages/odoo/http.py", line 683, in dispatch
result = self._call_function(**self.params)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 359, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 94, in wrapper
return f(dbname, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 347, in checked_call
result = self.endpoint(*a, **kw)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 912, in __call__
return self.method(*args, **kw)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 531, in response_wrap
response = f(*args, **kw)
File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 1398, in call_button
action = self._call_kw(model, method, args, kwargs)
File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 1386, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/usr/lib/python3/dist-packages/odoo/api.py", line 399, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/usr/lib/python3/dist-packages/odoo/api.py", line 386, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "<decorator-gen-78>", line 2, in button_immediate_upgrade
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_module.py", line 74, in check_and_log
return method(self, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_module.py", line 654, in button_immediate_upgrade
return self._button_immediate_function(type(self).button_upgrade)
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_module.py", line 593, in _button_immediate_function
modules.registry.Registry.new(self._cr.dbname, update_module=True)
File "/usr/lib/python3/dist-packages/odoo/modules/registry.py", line 89, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 457, in load_modules
force, status, report, loaded_modules, update_module, models_to_check)
File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 349, in load_marked_modules
perform_checks=perform_checks, models_to_check=models_to_check
File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 222, in load_module_graph
load_data(cr, idref, mode, kind='data', package=package)
File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 69, in load_data
tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind)
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 733, in convert_file
convert_xml_import(cr, module, fp, idref, mode, noupdate)
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 799, in convert_xml_import
obj.parse(doc.getroot())
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 719, in parse
self._tag_root(de)
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 685, in _tag_root
)) from e
Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/http.py", line 639, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 315, in _handle_exception
raise exception.with_traceback(None) from new_cause
odoo.tools.convert.ParseError: while parsing /mnt/extra-addons/insurance/views/prospect_view.xml:3, near
<record id="view_prospect_form" model="ir.ui.view">
<field name="name">prospect.form</field>
<field name="model">prospect</field>
<field name="arch" type="xml">
<form create="false">
<sheet>
<h1>Prospeção nº <field name="num_prospect"/> </h1>
<group>
<group>
<!--What appears when you click for more information-->
<field name="name" attrs="required"/>
<field name="email_client"/>
<field name="tlm_client"/>

</group>
<group>
<field name="num_prospect"/>
<field name="ent_prospect"/>
<field name="situation"/>
</group>
</group>

<notebook name="notebook"> <!-- attrs="{'invisible': [('name', '=', 'null')]}" -->
<page string="Produto">
<p><h3>Dados de Risco</h3></p>
<group>
<group>
<field name="insurance_type"/>
</group>
<group>
</group>
<group>
<p attrs="{'invisible': [('insurance_type', '!=', 'option2'), ('insurance_type', '!=', 'option3'), ('insurance_type', '!=', 'option4')]}">
Página ainda em desenvolvimento...
</p>

<field name="a_id" attrs="{'invisible': [('insurance_type', '!=', 'option1')]}"/>
<field name="license" attrs="{'invisible': [('insurance_type', '!=', 'option1')]}"/>
<field name="month_year_license" attrs="{'invisible': [('insurance_type', '!=', 'option1')]}"/>
</group>
<group>
<field name="brand" attrs="{'invisible': [('insurance_type', '!=', 'option1')]}"/>
<field name="model" attrs="{'invisible': [('insurance_type', '!=', 'option1')]}"/>
<field name="version" attrs="{'invisible': [('insurance_type', '!=', 'option1')]}"/>
</group>
</group>
<group>
<field name="results" attrs="{'invisible': [('insurance_type', '!=', 'option1')]}"/>
</group>
<group>
<button name="teste_butao" string="Adicionar Simulação"/>
</group>
</page>
</notebook>
</sheet>
</form>
</field>
</record>

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
Process a file using JS on client
javascript button formview
Portretas
0
kov. 24
1946
Show a button in form view, when in view mode, and hide in edit mode Solved
hide button formview
Portretas
Portretas
Portretas
Portretas
3
saus. 24
15295
How to display form or tree view with some fields when click is made on button?
treeview button formview
Portretas
Portretas
2
kov. 15
8061
V17 Tree, Form view Solved
formview
Portretas
1
kov. 25
2841
Create new record by opening a new form on a button click Solved
form button formview odoo12
Portretas
Portretas
Portretas
2
liep. 23
786
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