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'
@subbarao
thank you again .
I tried but it still doesn't work.......
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........
@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?