[IMP][9.0] Change Requests and workflow improvements on documents (#155)

* [IMP] Refactor document_page_approval to always use states, and a few code improvements
* [IMP] Add QWeb report to print document pages
* Categories don't save content
* FIX Last Contributor (uid and date). Use related fields instead of computed where possible.
Fix search views, store some fields to make them searchable, added filters
* Add api.depends on computed diff
This commit is contained in:
Iván Todorovich
2018-04-12 19:27:32 -03:00
committed by Maxime Chambreuil
parent 17d757fd95
commit 96256b9872
34 changed files with 1136 additions and 777 deletions

View File

@@ -1,15 +1,13 @@
<?xml version="1.0"?>
<odoo>
<!-- Allow user to make upgrade-proof customizations to email template -->
<data noupdate="1">
<!-- If user wants to make upgrade-proof customizations to email templates, he should edit ir.model.data and check noupdate himself -->
<data>
<record id="email_template_new_draft_need_approval" model="mail.template">
<field name="name">Automated new draft need approval Notification Mail</field>
<field name="email_from">${object.create_uid.company_id.email or 'noreply@localhost.com'}</field>
<field name="subject">New version of "${object.page_id.name}" to approve</field>
<field name="email_to">${object.get_approvers_email}</field>
<field name="subject">New version of ${object.display_name} needs your approval</field>
<field name="model_id" ref="model_document_page_history"/>
<field name="auto_delete" eval="True"/>
<field name="lang">${object.create_uid.partner_id.lang}</field>
@@ -17,13 +15,29 @@
<![CDATA[
<p>Hello,</p>
<p>The page "${object.page_id.name}" has been modified and need your approval.</p>
<p>${object.create_uid.name} submited a new Change Request for <b>${object.page_id.name}</b> and it needs your approval.</p>
<p>You can review the new version here : <a href="${object.get_page_url}">${object.get_page_url}</a></p>
<h1><a href="${object.page_url}">${object.display_name}</a></h1>
<p>
<b>Modified by:</b> ${object.create_uid.name}<br/>
<b>Date:</b> ${object.create_date}<br>
</p>
% if object.summary:
<h3>Summary</h3>
<p>${object.summary}</p>
% endif
<h3>Diff</h3>
<div style="overflow-x:scroll; font-size:0.85em; margin-bottom:2em;">
${object.diff|safe}
</div>
<p>Have a great day.</p>
<p>Have a great day.<br/>
--<br/>
Odoo</p>]]>
<p>Odoo</p>
]]>
</field>
</record>