mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[IMP] contract: Portal
This commit is contained in:
committed by
Christopher Rogos
parent
c228e52167
commit
1a1d301251
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user