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
472 B

  1. # Copyright 2019 Creu Blanca
  2. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  3. from odoo import api, models
  4. class Base(models.AbstractModel):
  5. _inherit = 'base'
  6. @api.multi
  7. def get_quick_access_code(self):
  8. self.ensure_one()
  9. rule = self.env['document.quick.access.rule'].search([
  10. ('model_id.model', '=', self._name)
  11. ], limit=1)
  12. if not rule:
  13. return False
  14. return rule.get_code(self)