[FIX] contract: Fix modifications layout

On the migration to v16, the primary layout view was incorrectly
removed. It's needed because of 2 reasons:

- It's referenced in the following template doing a t-call. Well, this
  one can be avoided calling the new layout upstream template, but...
- This layout is done for placing some extra content (the modifications
  table), as part of the layout that is not shown in the chatter for
  avoiding noise.

We recreate this template inheriting the new layout template, and
adapting it properly.

TT45646
This commit is contained in:
Pedro M. Baeza
2024-03-14 13:08:42 +01:00
parent 6c900c92cf
commit 9c28cc3d71

View File

@@ -1,5 +1,14 @@
<?xml version="1.0" ?> <?xml version="1.0" ?>
<odoo> <odoo>
<template
id="mail_notification_contract"
inherit_id="mail.mail_notification_layout"
primary="True"
>
<xpath expr="//div[@t-out='message.body']" position="after">
<t t-raw="0" />
</xpath>
</template>
<template id="template_contract_modification" name="Contract Modification"> <template id="template_contract_modification" name="Contract Modification">
<t t-call="contract.mail_notification_contract"> <t t-call="contract.mail_notification_contract">
<table border="1" align="center"> <table border="1" align="center">
@@ -12,10 +21,10 @@
<tbody> <tbody>
<t t-foreach="record.modification_ids" t-as="modification"> <t t-foreach="record.modification_ids" t-as="modification">
<tr t-if="not modification.sent"> <tr t-if="not modification.sent">
<td name="td_date"> <td name="td_date" style="padding: 10px">
<span t-field="modification.date" /> <span t-field="modification.date" />
</td> </td>
<td name="td_description"> <td name="td_description" style="padding: 10px">
<div t-field="modification.description" /> <div t-field="modification.description" />
</td> </td>
</tr> </tr>