How to show fields values in _constraints messages?
I want to show in the error messages the values of the fields that trigger the constraint, how to do this?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
How to show fields values in _constraints messages?
I want to show in the error messages the values of the fields that trigger the constraint, how to do this?
Hi,
Refer the code of base_vat module to show the value of field in constraint message:
"_construct_constraint_msg" method to show the message
_constraints = [(check_vat, _construct_constraint_msg, ["vat"])]
Hope this may help you.
Hi.
I think like the error messages: use string and edit it before shown
if not rout_id:
e_mess = "No rotuing there " + str(row) + " column"
raise osv.except_osv(_('Error in imported data'), _(e_mess))
The row is varaible of course in this case. U can use any field value as you want..
Bye.
Crie uma conta hoje mesmo para aproveitar os recursos exclusivos e interagir com nossa incrível comunidade!
Inscreva-sePublicações relacionadas | Respostas | Visualizações | Atividade | |
---|---|---|---|---|
Sql constraint for boolean field
Resolvido
|
|
2
set. 18
|
6944 | |
|
9
mar. 16
|
60798 | ||
|
1
mar. 15
|
4735 | ||
|
1
mar. 15
|
5489 | ||
|
0
nov. 24
|
7 |