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.

18 lines
523 B

  1. # Copyright 2021 Quartile Limited
  2. # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
  3. from odoo import api, fields, models
  4. class ResUsers(models.Model):
  5. _inherit = "res.users"
  6. unrestrict_model_update = fields.Boolean(
  7. "Unrestrict Model Update",
  8. help="Set to true and the user can update restricted model.",
  9. )
  10. @api.multi
  11. def toggle_unrestrict_model_update(self):
  12. for record in self:
  13. record.unrestrict_model_update = not record.unrestrict_model_update