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

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