Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
3210 Vizualizări

Hi,

Im tring to show an error pop up message when users enter bad data on a Many2one field. To do that, I override name_create method to verify data and if it bad, I raise a UserError exception. However, the front end instead of showing a message to the user, opens the Many2one relation model form.

Any idea?

Thanks

Imagine profil
Abandonează

Hi,

can you enlighten us with more details about what could be a 'bad data on a M2O' ?

I would recommand that you override the _search to control what data to show in a specific case. Then, the user has to choose one of the displayed data.

if the user can create data, i would recommand that you add a menu in configuration where you add views to that model and there only can data be created.

Hope this helps.

Autor Cel mai bun răspuns

Hi. Yes! I will try.

I want to verify what data Users are entering on M2O field before create record. Im talking when Users use quickcreate to do that. So I override name_create method to put a verification rutine and If something goes wrong I raise an UserError exception. This would have to  show a popup message to the users reporting what happend, but unfortunately instead of that, odoo pops up the view form of the M20 model.

Thanks in advance.
Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
iul. 25
2527
0
mai 23
2293
3
mar. 25
23902
1
nov. 22
2204
1
mai 22
5703