bemade-addons/bemade_documents_portal/models/documents.py
Benoît Vézina fb301db2b3 for migration
2023-11-16 09:01:22 -05:00

17 lines
No EOL
548 B
Python

from odoo import models, fields
class Document(models.Model):
_name = 'documents.document'
_inherit = ['documents.document', 'portal.mixin']
def _compute_access_url(self):
super()._compute_access_url()
for document in self:
document.access_url = f'/my/documents/{document.id}'
def _get_portal_return_action(self):
""" Return the action used to display documents when returning from customer
portal."""
self.ensure_one()
return self.env.ref('documents.document_action')