Odoo Help


Equivalent javascript onLoad() - it is possible when form is loaded?

on 2/9/15, 4:11 PM 2,769 views

This question is related to my previous question: conditional, dynamic field domain.


<field name="xxx"/>
<field name="yyy_ids" widget="many2many" domain="....DOMAIN......">

I know how to change the domain for yyy_ids when signal change is generated 

def do_xxx(self):

.... here code to change DOMAIN...

return {'domain': {'yyy_ids': ....DOMAIN_VALUE....}}

but how generate onchange signal, at the start, when form will be loaded?

Thanks, I will check soon.

on 2/11/15, 3:25 PM


| 6 5 7
Lodz, Poland

On 2/12/15, 4:44 AM

@Mariusz, PARTLY SOLVED :(. Yes, we now have a new system behavior. Method onchage is fired when a record is created, but if record already exist onchange is not fired, regardless of the default and the new contents of the field xxx.

Any workaround on that? I have the same challenge and I don't know what to do yet :(

Mathieu Laflamme
on 2/26/16, 3:55 PM

I have no new messages. See: https://github.com/odoo/odoo/issues/5199

on 2/27/16, 7:18 AM

Mariusz Mizgier

--Mariusz Mizgier--
| 4 1 7
SOPOT, Poland
--Mariusz Mizgier--

OpenERP developer

Mariusz Mizgier
On 2/12/15, 4:43 AM

Did you try: 1. apply this patch - https://github.com/odoo/odoo/commit/2067a206ecba9a8dbf7f76a55926be964e580e7e 2. move your xxx before yyy_ids in form view 3. set _defaults for xxx to False Didn't check that, but that should work - if not, maybe change in logic (defaults = True) so that this field does change it's value.

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 2/9/15, 4:11 PM
Seen: 2769 times
Last updated: 3/16/15, 8:10 AM