[IMP] contract: Portal

This commit is contained in:
Víctor Martínez
2020-12-16 08:45:07 +01:00
committed by Pedro M. Baeza
parent acd664b6cd
commit e367d090c3
18 changed files with 490 additions and 1 deletions

View File

@@ -21,6 +21,7 @@ class ContractContract(models.Model):
"mail.activity.mixin",
"contract.abstract.contract",
"contract.recurrency.mixin",
"portal.mixin",
]
active = fields.Boolean(default=True,)
@@ -113,6 +114,19 @@ class ContractContract(models.Model):
track_visibility="onchange",
)
def _compute_access_url(self):
for record in self:
record.access_url = "/my/contracts/{}".format(record.id)
def action_preview(self):
"""Invoked when 'Preview' button in contract form view is clicked."""
self.ensure_one()
return {
"type": "ir.actions.act_url",
"target": "self",
"url": self.get_portal_url(),
}
def _inverse_partner_id(self):
for rec in self:
if not rec.invoice_partner_id: