You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
696 B

  1. # -*- coding: utf-8 -*-
  2. # Copyright 2015-2018 Therp BV <https://therp.nl>
  3. # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
  4. from odoo.exceptions import ValidationError
  5. from odoo.tests.common import TransactionCase
  6. from odoo.tools import mute_logger
  7. class TestWebMenuNavbarNeedaction(TransactionCase):
  8. def test_web_menu_navbar_needaction(self):
  9. main_menus = self.env['ir.ui.menu'].search([('parent_id', '=', False)])
  10. data = main_menus.get_navbar_needaction_data()
  11. self.assertEqual(len(main_menus), len(data))
  12. with mute_logger('odoo.models'), self.assertRaises(ValidationError):
  13. main_menus[:1].write({'needaction_domain': '['})