4

Can i have a custom title in validation error/warning in odoo,I don't want Odoo in the title.

I have tried this code

raise odoo.osv.osv.except_osv('title', 'description')

But the title gets ignored.

ashvin
  • 135
  • 7
maharshi
  • 586
  • 12
  • 30

2 Answers2

5

If I know well, by default you can not. However Odoo developers kept backward compatibility. When you use except_orm, then it will show your title text.

In my opinion this is not enough beauty solution.

from odoo import exceptions, _
...
raise exceptions.except_orm(_('My Title), _('My message + lorem ipsum'))

Result popup window: enter image description here

Döme
  • 835
  • 11
  • 23
1

You can simply do this by this way,

  1. Import the library
  2. Generate error through following code,

    from odoo.osv import osv

    raise osv.except_osv((Error Condition), (Error Description))