Merge PR #612 into 12.0

Signed-off-by pedrobaeza
This commit is contained in:
OCA-git-bot
2021-01-19 09:57:45 +00:00
2 changed files with 7 additions and 1 deletions

View File

@@ -129,6 +129,12 @@ class ContractContract(models.Model):
string='Modifications',
)
def get_formview_id(self, access_uid=None):
if self.contract_type == "sale":
return self.env.ref("contract.contract_contract_customer_form_view").id
else:
return self.env.ref("contract.contract_contract_supplier_form_view").id
@api.model_create_multi
def create(self, vals_list):
records = super().create(vals_list)

View File

@@ -64,7 +64,7 @@
<template id="portal_contract_page" name="My Contract">
<t t-call="portal.portal_layout">
<t t-set="o_portal_fullwidth_alert">
<t t-set="o_portal_fullwidth_alert" groups="account.group_account_invoice">
<t t-call="portal.portal_back_in_edit_mode">
<t t-set="backend_url" t-value="'/web#return_label=Website&amp;model=contract.contract&amp;id=%s&amp;view_type=form' % (contract.id)"/>
</t>