Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Schvalování
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Food & Hospitality
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Guest House
    • Distributor nápojů
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Trades
    • Údržbář
    • IT hardware a podpora
    • Solar Energy Systems
    • Výrobce obuvi
    • Úklidové služby
    • HVAC Services
    Others
    • Nonprofit Organization
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Browse all Industries
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Services for Partners
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účetnictví
  • Sklad
  • PoS
  • Projekty
  • MRP
All apps
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

wizard and compute parameter

Odebírat

Get notified when there's activity on this post

This question has been flagged
wizardcomputeodoo10.0
4 Odpovědi
7573 Zobrazení
Avatar
Paul San

Hi all,


I'm new in Odoo.

I have this question about wizard and the "compute" parameter.

I have defined this simple custom wizard however the _get_login method is not called and I can't figured why.

Furthermore the rendered view don't have the login field.... ( https://ibb.co/7JCnmPH )

Is there anyone can help me?

Is possible to use compute with wizard???

from odoo import api, fields, models

class FooBarWizard(models.TransientModel):

_name = "foo.bar.wizard"

login = fields.Char(compute="_get_login")
password = fields.Char()
email = fields.Char()

def _get_login(self):
for item in self:
item.login='Foo'
0
Avatar
Zrušit
Paul San
Autor

@subbarao

thank you again .

I tried but it still doesn't work.......

Paul San
Autor

HI all,

Now my code is:

from odoo import api, fields, models

class FooBarWizard(models.TransientModel):

_name = "foo.bar.wizard"

@api.multi

def _get_login(self):

for item in self:

item.login = 'Foo'

login = fields.Char(compute="_get_login")

password = fields.Char()

email = fields.Char()

but it still doesn't work.

I putted a breakpoint in pycharm debugger on "_get_login" mehod but it's ignored.

I setted "item.login = 'Foo'" because at a later moment I want to replace it with a code that use environment variables........

Paul San
Autor

@Justin Chen

Thank you Justin now it work with default=get_login instead of compute.....

Is there anyone can tell me why compute in my case doesn't function?

Avatar
Cayprol
Nejlepší odpověď

Hi, Could you try define the "_get_login" method before the line you define field "login"?

And also, use the @api.multi decorator for "_get_login".

Btw, if what you are doing is to hard coding 'Foo' to the field, use default="_get_login", and make the method return 'Foo'.

1
Avatar
Zrušit
Avatar
Hazem Mahmoud (Rising Systems AG)
Nejlepší odpověď

Hi Paul

Have you called the function '_get_login' in the xml view?

some thing like the following

<record model="ir.ui.view" id="my_wizard_form_view">
            <field name="name">wizard.form</field>
            <field name="model">foo.bar.wizard</field>
            <field name="arch" type="xml">
                <form string="Wizard">
                    <group>
                        <field name="login"/>
                        <field name="password"/>
                    </group>
                    <footer>
                        <button name="_get_login" type="object" string="Login" class="oe_highlight"/>
                        <button special="cancel" string="Cancel"/>
                    </footer>
                </form>
            </field>
        </record>

0
Avatar
Zrušit
Avatar
subbarao
Nejlepší odpověď

Hello Paul San,

try this one 

@api.multi
def _get_login(self):
for item in self:
item.login='Foo'
0
Avatar
Zrušit
Enjoying the discussion? Don't just read, join in!

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

Přihlásit se
Related Posts Odpovědi Zobrazení Aktivita
How to find the sum of all record in the wizard and display in float field in odoo12 Vyřešeno
wizard compute odoo12
Avatar
Avatar
1
pro 19
5957
How to use sort option for computed fields not stored ?
compute fileds sorting odoo10.0
Avatar
Avatar
1
úno 24
12304
In odoo studio - Transform positive value Field into negative value Field Vyřešeno
compute
Avatar
Avatar
2
bře 24
2695
count number of records based on condition Vyřešeno
odoo10.0
Avatar
Avatar
1
lis 24
21031
How to install odoo 10 in ubuntu 20.04? Vyřešeno
odoo10.0
Avatar
Avatar
1
zář 23
3863
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة 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 je balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

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