[MIG] document_page: Migration to 13.0

This commit is contained in:
ernesto 2019-11-07 15:26:37 -05:00 committed by Justine Doutreloux
parent 4cf81af527
commit c181491259
23 changed files with 108 additions and 150 deletions

View File

@ -14,13 +14,13 @@ Document Page
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fknowledge-lightgray.png?logo=github
:target: https://github.com/OCA/knowledge/tree/12.0/document_page
:target: https://github.com/OCA/knowledge/tree/13.0/document_page
:alt: OCA/knowledge
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/knowledge-12-0/knowledge-12-0-document_page
:target: https://translation.odoo-community.org/projects/knowledge-13-0/knowledge-13-0-document_page
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/118/12.0
:target: https://runbot.odoo-community.org/runbot/118/13.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
@ -57,7 +57,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/knowledge/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/knowledge/issues/new?body=module:%20document_page%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/knowledge/issues/new?body=module:%20document_page%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
@ -78,6 +78,9 @@ Contributors
* Jose Maria Alzaga <jose.alzaga@aselcis.com>
* Lois Rilo <lois.rilo@eficent.com>
* Simone Orsi <simone.orsi@camptocamp.com>
* `Tecnativa <https://www.tecnativa.com>`_:
* Ernesto Tejeda
Other credits
~~~~~~~~~~~~~
@ -100,6 +103,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
This module is part of the `OCA/knowledge <https://github.com/OCA/knowledge/tree/12.0/document_page>`_ project on GitHub.
This module is part of the `OCA/knowledge <https://github.com/OCA/knowledge/tree/13.0/document_page>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@ -4,7 +4,7 @@
{
"name": "Document Page",
"version": "12.0.1.1.0",
"version": "13.0.1.0.0",
"category": "Knowledge Management",
"author": "OpenERP SA, Odoo Community Association (OCA)",
"images": [

View File

@ -7,7 +7,7 @@
</record>
<record id="demo_category1" model="document.page">
<field name="name">OpenERP Features</field>
<field name="name">Odoo Features</field>
<field name="type">category</field>
<field name="template">
Summary of the feature
@ -22,28 +22,28 @@ Additional ressources
</record>
<record id="demo_page1" model="document.page">
<field name="name">OpenERP 6.1. Functional Demo</field>
<field name="name">Odoo 13.0 Functional Demo</field>
<field name="parent_id" ref="demo_category1"/>
<field name="content">
<![CDATA[
<br>
<br>
The news is out, OpenERP's latest version 6.1. is here. It's more<br>
The news is out, Odoo's latest version 13.0 is here. It's more<br>
user-friendly, even more business oriented and efficient to manage your company<br>
<br>
How to discover the latest version 6.1.?<br>
How to discover the latest version 13.0?<br>
<br>
Demo : <a target="http://demo.openerp.com" href="http://demo.openerp.com" style="background: url(&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFZJREFUeF59z4EJADEIQ1F36k7u5E7ZKXeUQPACJ3wK7UNokVxVk9kHnQH7bY9hbDyDhNXgjpRLqFlo4M2GgfyJHhjq8V4agfrgPQX3JtJQGbofmCHgA/nAKks+JAjFAAAAAElFTkSuQmCC&quot;) no-repeat scroll right center transparent;padding-right: 13px;"></a><br>
Online: <a target="http://openerp.com/online" href="http://openerp.com/online" style="background: url(&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFZJREFUeF59z4EJADEIQ1F36k7u5E7ZKXeUQPACJ3wK7UNokVxVk9kHnQH7bY9hbDyDhNXgjpRLqFlo4M2GgfyJHhjq8V4agfrgPQX3JtJQGbofmCHgA/nAKks+JAjFAAAAAElFTkSuQmCC&quot;) no-repeat scroll right center transparent;padding-right: 13px;"></a><br>
Download: <a target="http://openerp.com/downloads" href="http://openerp.com/downloads" style="background: url(&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFZJREFUeF59z4EJADEIQ1F36k7u5E7ZKXeUQPACJ3wK7UNokVxVk9kHnQH7bY9hbDyDhNXgjpRLqFlo4M2GgfyJHhjq8V4agfrgPQX3JtJQGbofmCHgA/nAKks+JAjFAAAAAElFTkSuQmCC&quot;) no-repeat scroll right center transparent;padding-right: 13px;"></a><br>
Demo : <a target="https://demo.odoo.com" href="https://demo.odoo.com" style="background: url(&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFZJREFUeF59z4EJADEIQ1F36k7u5E7ZKXeUQPACJ3wK7UNokVxVk9kHnQH7bY9hbDyDhNXgjpRLqFlo4M2GgfyJHhjq8V4agfrgPQX3JtJQGbofmCHgA/nAKks+JAjFAAAAAElFTkSuQmCC&quot;) no-repeat scroll right center transparent;padding-right: 13px;"></a><br>
Online: <a target="https://www.odoo.com/trial" href="https://www.odoo.com/trial" style="background: url(&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFZJREFUeF59z4EJADEIQ1F36k7u5E7ZKXeUQPACJ3wK7UNokVxVk9kHnQH7bY9hbDyDhNXgjpRLqFlo4M2GgfyJHhjq8V4agfrgPQX3JtJQGbofmCHgA/nAKks+JAjFAAAAAElFTkSuQmCC&quot;) no-repeat scroll right center transparent;padding-right: 13px;"></a><br>
Download: <a target="https://www.odoo.com/page/download" href="https://www.odoo.com/page/download" style="background: url(&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFZJREFUeF59z4EJADEIQ1F36k7u5E7ZKXeUQPACJ3wK7UNokVxVk9kHnQH7bY9hbDyDhNXgjpRLqFlo4M2GgfyJHhjq8V4agfrgPQX3JtJQGbofmCHgA/nAKks+JAjFAAAAAElFTkSuQmCC&quot;) no-repeat scroll right center transparent;padding-right: 13px;"></a><br>
<br>
We have also put together a functional demo that presents 6.1. Watch this video<br>
to learn directly from us what OpenERP 6.1. can do for you. Share it in your<br>
We have also put together a functional demo that presents 13.0. Watch this video<br>
to learn directly from us what Odoo 13.0 can do for you. Share it in your<br>
company, with your clients and implement it now for your business.<br>
<br>
<h3>Watch on Youtube!</h3><br>
<br>
<iframe width="480" height="390" src="http://www.youtube.com/embed/7jES2jxKMso " frameborder="0" allowfullscreen=""></iframe><br>
<iframe width="480" height="390" src="https://www.youtube.com/embed/zLSgpQM_tms" frameborder="0" allowfullscreen=""></iframe><br>
<br>
<br>
]]>
@ -56,9 +56,8 @@ company, with your clients and implement it now for your business.<br>
<field name="content">
<![CDATA[
<br>
You like OpenERP, but feel like you want to personalise it more? Now, OpenERP<br>
goes a step further and lets you customize your dashboard. Thanks to a new<br>
feature that allows you to customize your dashboard by adding new boards of any<br>
You like Odoo, but feel like you want to personalise it more? You can customize your
dashboard by adding new boards of any<br>
search view.<br>
<br>
<h3>How is it done?</h3><br>
@ -77,11 +76,11 @@ application's dashboard "Purchases to Approve". After I access the search view<b
and apply the filter for "Purchases to Approve", I can add it immediately to my<br>
Purchase dashboard.<br>
<br>
<img src="http://www.openerp.com/sites/default/files/fileattach/dashboard2_1(1).png" alt=""><br>
<img src="/document_page/static/src/img/add_to_dashboard.png" alt="Add to dashboard" width="500"><br>
<br>
In less than a minute, the search view is visible on the dashboard<br>
<br>
<img src="http://www.openerp.com/sites/default/files/fileattach/dashboard2_2.png" alt=""><br>
<img src="/document_page/static/src/img/dashboard.png" alt="Dashboard" width="500"><br>
<br>
Of course, you are free to delete what you don't need or like, but just in case<br>
you change your mind there is a reset button to return to the default view.<br>
@ -97,13 +96,13 @@ you change your mind there is a reset button to return to the default view.<br>
<field name="content">
<![CDATA[
<br>
The brand new OpenERP touchscreen point of sale available with 6.1 allows you<br>
The Odoo touchscreen point of sale available with 13.0 allows you<br>
to manage your shop sales very easily. It's fully web based so that you don't<br>
have to install or deploy any software and all the sales shops can be easily<br>
consolidated. It works in connected and disconnected modes so that you can<br>
continue to sell if you lose your internet connection.<br>
<br>
<img src="http://www.openerp.com/sites/default/files/fileattach/POS(2).png" alt=""><br>
<img src="/document_page/static/src/img/POS.png" alt="Point of Sale" width="500"><br>
<br>
<h3>Here's a summary of its main features and benefits:</h3><br>
<br>

View File

@ -13,6 +13,8 @@ class DocumentPage(models.Model):
_description = "Document Page"
_order = "name"
_HTML_WIDGET_DEFAULT_VALUE = "<p><br></p>"
name = fields.Char("Title", required=True)
type = fields.Selection(
[("content", "Content"), ("category", "Category")],
@ -33,20 +35,18 @@ class DocumentPage(models.Model):
required=True,
)
# no-op computed field
draft_name = fields.Char(
string="Name",
help="Name for the changes made",
compute=lambda x: x,
inverse=lambda x: x,
related="history_head.name",
readonly=False,
)
# no-op computed field
draft_summary = fields.Char(
string="Summary",
help="Describe the changes made",
compute=lambda x: x,
inverse=lambda x: x,
related="history_head.summary",
readonly=False,
)
template = fields.Html(
@ -117,13 +117,12 @@ class DocumentPage(models.Model):
if not self._check_recursion():
raise ValidationError(_("You cannot create recursive categories."))
@api.multi
def _get_page_index(self, link=True):
"""Return the index of a document."""
self.ensure_one()
index = []
for subpage in self.child_ids:
index += ["<li>" + subpage._get_page_index() + "</li>"]
index = [
"<li>" + subpage._get_page_index() + "</li>" for subpage in self.child_ids
]
r = ""
if link:
r = '<a href="{}">{}</a>'.format(self.backend_url, self.name)
@ -131,7 +130,6 @@ class DocumentPage(models.Model):
r += "<ul>" + "".join(index) + "</ul>"
return r
@api.multi
@api.depends("history_head")
def _compute_content(self):
for rec in self:
@ -142,46 +140,42 @@ class DocumentPage(models.Model):
rec.content = rec.history_head.content
else:
# html widget's default, so it doesn't trigger ghost save
rec.content = "<p><br></p>"
rec.content = self._HTML_WIDGET_DEFAULT_VALUE
@api.multi
def _inverse_content(self):
vals = []
for rec in self:
if rec.type == "content" and rec.content != rec.history_head.content:
rec._create_history(
vals.append(
{
"page_id": rec.id,
"name": rec.draft_name,
"summary": rec.draft_summary,
"content": rec.content,
}
)
self.env["document.page.history"].create(vals)
@api.multi
def _search_content(self, operator, value):
return [("history_head.content", operator, value)]
@api.multi
@api.depends("history_ids")
def _compute_history_head(self):
for rec in self:
if rec.history_ids:
rec.history_head = rec.history_ids[0]
@api.multi
def _create_history(self, vals):
self.ensure_one()
history = self.env["document.page.history"]
vals["page_id"] = self.id
return history.create(vals)
else:
rec.history_head = False
@api.onchange("parent_id")
def _onchange_parent_id(self):
"""We Set it the right content to the new parent."""
if not self.content or self.content == "<p><br></p>":
if self.parent_id and self.parent_id.type == "category":
self.content = self.parent_id.template
if (
self.content in (False, self._HTML_WIDGET_DEFAULT_VALUE)
and self.parent_id.type == "category"
):
self.content = self.parent_id.template
@api.multi
def unlink(self):
menus = self.mapped("menu_id")
res = super().unlink()

View File

@ -3,8 +3,7 @@
import difflib
from odoo import api, fields, models
from odoo.tools.translate import _
from odoo import _, api, fields, models
class DocumentPageHistory(models.Model):
@ -30,7 +29,6 @@ class DocumentPageHistory(models.Model):
readonly=True,
)
@api.multi
def _compute_diff(self):
"""Shows a diff between this version and the previous version"""
history = self.env["document.page.history"]
@ -43,10 +41,7 @@ class DocumentPageHistory(models.Model):
limit=1,
order="create_date DESC",
)
if prev:
rec.diff = self._get_diff(prev.id, rec.id)
else:
rec.diff = self._get_diff(False, rec.id)
rec.diff = self._get_diff(prev.id, rec.id)
@api.model
def _get_diff(self, v1, v2):
@ -71,10 +66,5 @@ class DocumentPageHistory(models.Model):
context=True,
)
@api.multi
def name_get(self):
result = []
for rec in self:
name = "%s #%i" % (rec.page_id.name, rec.id)
result.append((rec.id, name))
return result
return [(rec.id, "%s #%i" % (rec.page_id.name, rec.id)) for rec in self]

View File

@ -4,3 +4,6 @@
* Jose Maria Alzaga <jose.alzaga@aselcis.com>
* Lois Rilo <lois.rilo@eficent.com>
* Simone Orsi <simone.orsi@camptocamp.com>
* `Tecnativa <https://www.tecnativa.com>`_:
* Ernesto Tejeda

View File

@ -367,7 +367,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/knowledge/tree/12.0/document_page"><img alt="OCA/knowledge" src="https://img.shields.io/badge/github-OCA%2Fknowledge-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/knowledge-12-0/knowledge-12-0-document_page"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/118/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/knowledge/tree/13.0/document_page"><img alt="OCA/knowledge" src="https://img.shields.io/badge/github-OCA%2Fknowledge-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/knowledge-13-0/knowledge-13-0-document_page"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/118/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module allows you to write web pages for internal documentation.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
@ -407,7 +407,7 @@ ul.auto-toc {
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/knowledge/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/knowledge/issues/new?body=module:%20document_page%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/knowledge/issues/new?body=module:%20document_page%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
@ -427,6 +427,10 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<li>Jose Maria Alzaga &lt;<a class="reference external" href="mailto:jose.alzaga&#64;aselcis.com">jose.alzaga&#64;aselcis.com</a>&gt;</li>
<li>Lois Rilo &lt;<a class="reference external" href="mailto:lois.rilo&#64;eficent.com">lois.rilo&#64;eficent.com</a>&gt;</li>
<li>Simone Orsi &lt;<a class="reference external" href="mailto:simone.orsi&#64;camptocamp.com">simone.orsi&#64;camptocamp.com</a>&gt;</li>
<li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:<ul>
<li>Ernesto Tejeda</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="other-credits">
@ -444,7 +448,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/knowledge/tree/12.0/document_page">OCA/knowledge</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/knowledge/tree/13.0/document_page">OCA/knowledge</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>

View File

@ -1,28 +0,0 @@
table.diff {
font-family: Courier;
border: medium;
}
table.diff .diff_header {
background-color: #e0e0e0
}
table.diff td.diff_header {
text-align: right
}
table.diff .diff_next {
background-color:#c0c0c0
}
table.diff .diff_add {
background-color:#aaffaa
}
table.diff .diff_chg {
background-color:#ffff77
}
table.diff .diff_sub {
background-color:#ffaaaa
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

View File

@ -0,0 +1,28 @@
table.diff {
font-family: Courier;
border: medium;
.diff_header {
background-color: #e0e0e0
}
td.diff_header {
text-align: right
}
.diff_next {
background-color:#c0c0c0
}
.diff_add {
background-color:#aaffaa
}
.diff_chg {
background-color:#ffff77
}
.diff_sub {
background-color:#ffaaaa
}
}

View File

@ -2,4 +2,5 @@
from . import test_document_page
from . import test_document_page_create_menu
from . import test_document_page_history
from . import test_document_page_show_diff

View File

@ -26,4 +26,4 @@ class TestDocumentPageCreateMenu(common.TransactionCase):
active_id=[self.ref("document_page.demo_page1")]
).default_get(fields_list)
self.assertEqual(res["menu_name"], "OpenERP 6.1. Functional Demo")
self.assertEqual(res["menu_name"], "Odoo 13.0 Functional Demo")

View File

@ -39,11 +39,8 @@
<field name="arch" type="xml">
<form string="Document Page">
<sheet>
<div class="oe_button_box" name="button_box">
<button name="toggle_active" type="object" groups="document_page.group_document_manager" class="oe_stat_button" icon="fa-archive">
<field name="active" widget="boolean_button" options="{'terminology': 'archive'}"/>
</button>
</div>
<widget name="web_ribbon" text="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
<field name="active" invisible="1"/>
<field name="type" invisible="1"/>
<h1>
<field name="name" placeholder="Name"/>
@ -63,9 +60,9 @@
<field name="content_date"/>
<field name="menu_id" readonly="1" attrs="{'invisible': [('menu_id','=',False)]}"/>
</group>
<group string="Revision" class="oe_edit_only">
<field name="draft_name" placeholder="Rev 01" class="oe_edit_only" />
<field name="draft_summary" placeholder="eg: Changed ... for ..." class="oe_edit_only" />
<group string="Revision">
<field name="draft_name" placeholder="Rev 01" />
<field name="draft_summary" placeholder="eg: Changed ... for ..." />
</group>
</group>
</page>
@ -132,7 +129,6 @@
<field name="res_model">document.page</field>
<field name="domain">[('type','=','content')]</field>
<field name="context">{'default_type': 'content'}</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_wiki_tree"/>
<field name="search_view_id" ref="view_wiki_filter"/>
@ -170,14 +166,4 @@
action="action_page"
sequence="20"/>
<act_window
id="action_related_page_create_menu"
name="Create Menu"
res_model="document.page.create.menu"
target="new"
view_type="form"
view_mode="form"
src_model="document.page"/>
</odoo>

View File

@ -3,7 +3,7 @@
<template id="assets_backend" name="document_page assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<link rel="stylesheet" href="/document_page/static/src/css/document_page.css"/>
<link rel="stylesheet" type="text/scss" href="/document_page/static/src/scss/document_page.scss"/>
</xpath>
</template>

3
document_page/views/document_page_category.xml Executable file → Normal file
View File

@ -1,4 +1,4 @@
<?xml version="1.0"?>
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<!-- Category Views -->
@ -76,7 +76,6 @@
<field name="res_model">document.page</field>
<field name="domain">[('type','=','category')]</field>
<field name="context">{'default_type': 'category'}</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_category_tree"/>
<field name="search_view_id" ref="view_document_category_filter"/>

3
document_page/views/document_page_history.xml Executable file → Normal file
View File

@ -68,7 +68,6 @@
<record model="ir.actions.act_window" id="action_history">
<field name="name">Page history</field>
<field name="res_model">document.page.history</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
@ -84,7 +83,7 @@
domain="[('page_id','=',active_id)]"
name="Page History"
res_model="document.page.history"
src_model="document.page"/>
binding_model="document.page"/>
</odoo>

0
document_page/views/report_document_page.xml Executable file → Normal file
View File

View File

@ -16,14 +16,13 @@ class DocumentPageCreateMenu(models.TransientModel):
@api.model
def default_get(self, fields_list):
"""Get Page name of the menu."""
res = super(DocumentPageCreateMenu, self).default_get(fields_list)
res = super().default_get(fields_list)
page_id = self.env.context.get("active_id")
obj_page = self.env["document.page"]
page = obj_page.browse(page_id)
res["menu_name"] = page.name
return res
@api.multi
def document_page_menu_create(self):
"""Menu creation."""
obj_page = self.env["document.page"]
@ -39,7 +38,6 @@ class DocumentPageCreateMenu(models.TransientModel):
)[1]
value = {
"name": "Document Page",
"view_type": "form",
"view_mode": "form,tree",
"res_model": "document.page",
"view_id": view_id,

View File

@ -25,15 +25,12 @@
</field>
</record>
<!-- Create Server Action -->
<record id="action_wiki_create_menu" model="ir.actions.act_window">
<field name="name">Create Menu</field>
<field name="res_model">document.page.create.menu</field>
<field name="view_mode">form</field>
<field name="target">new</field>
<field name="binding_model_id"
ref="document_page.model_document_page"/>
</record>
<act_window
id="action_related_page_create_menu"
name="Create Menu"
res_model="document.page.create.menu"
target="new"
view_mode="form"
binding_model="document.page"/>
</odoo>

View File

@ -1,9 +1,8 @@
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
from odoo import _, fields, models
from odoo.exceptions import UserError
from odoo.tools.translate import _
class DocumentPageShowDiff(models.TransientModel):

View File

@ -15,27 +15,13 @@
</field>
</record>
<!-- Create Index Action -->
<record id="action_view_wiki_show_diff" model="ir.actions.act_window">
<field name="name">Difference</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">wizard.document.page.history.show_diff</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<!-- Create Index Action Window -->
<act_window
id="action_view_wiki_show_diff_values"
key2="client_action_multi"
name="Difference"
res_model="wizard.document.page.history.show_diff"
src_model="document.page.history"
binding_model="document.page.history"
view_mode="form"
target="new"
view_type="form"/>
target="new"/>
</odoo>