mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-14 01:41:26 -06:00
[MIG] document_page: Migration to 13.0
This commit is contained in:
parent
4cf81af527
commit
c181491259
@ -14,13 +14,13 @@ Document Page
|
|||||||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||||
:alt: License: AGPL-3
|
:alt: License: AGPL-3
|
||||||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fknowledge-lightgray.png?logo=github
|
.. |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
|
:alt: OCA/knowledge
|
||||||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
.. |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
|
:alt: Translate me on Weblate
|
||||||
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
|
.. |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
|
:alt: Try me on Runbot
|
||||||
|
|
||||||
|badge1| |badge2| |badge3| |badge4| |badge5|
|
|badge1| |badge2| |badge3| |badge4| |badge5|
|
||||||
@ -57,7 +57,7 @@ Bug Tracker
|
|||||||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/knowledge/issues>`_.
|
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.
|
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
|
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.
|
Do not contact contributors directly about support or help with technical issues.
|
||||||
|
|
||||||
@ -78,6 +78,9 @@ Contributors
|
|||||||
* Jose Maria Alzaga <jose.alzaga@aselcis.com>
|
* Jose Maria Alzaga <jose.alzaga@aselcis.com>
|
||||||
* Lois Rilo <lois.rilo@eficent.com>
|
* Lois Rilo <lois.rilo@eficent.com>
|
||||||
* Simone Orsi <simone.orsi@camptocamp.com>
|
* Simone Orsi <simone.orsi@camptocamp.com>
|
||||||
|
* `Tecnativa <https://www.tecnativa.com>`_:
|
||||||
|
|
||||||
|
* Ernesto Tejeda
|
||||||
|
|
||||||
Other credits
|
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
|
mission is to support the collaborative development of Odoo features and
|
||||||
promote its widespread use.
|
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.
|
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
"name": "Document Page",
|
"name": "Document Page",
|
||||||
"version": "12.0.1.1.0",
|
"version": "13.0.1.0.0",
|
||||||
"category": "Knowledge Management",
|
"category": "Knowledge Management",
|
||||||
"author": "OpenERP SA, Odoo Community Association (OCA)",
|
"author": "OpenERP SA, Odoo Community Association (OCA)",
|
||||||
"images": [
|
"images": [
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="demo_category1" model="document.page">
|
<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="type">category</field>
|
||||||
<field name="template">
|
<field name="template">
|
||||||
Summary of the feature
|
Summary of the feature
|
||||||
@ -22,28 +22,28 @@ Additional ressources
|
|||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="demo_page1" model="document.page">
|
<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="parent_id" ref="demo_category1"/>
|
||||||
<field name="content">
|
<field name="content">
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
<br>
|
<br>
|
||||||
<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>
|
user-friendly, even more business oriented and efficient to manage your company<br>
|
||||||
<br>
|
<br>
|
||||||
How to discover the latest version 6.1.?<br>
|
How to discover the latest version 13.0?<br>
|
||||||
<br>
|
<br>
|
||||||
Demo : <a target="http://demo.openerp.com" href="http://demo.openerp.com" style="background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFZJREFUeF59z4EJADEIQ1F36k7u5E7ZKXeUQPACJ3wK7UNokVxVk9kHnQH7bY9hbDyDhNXgjpRLqFlo4M2GgfyJHhjq8V4agfrgPQX3JtJQGbofmCHgA/nAKks+JAjFAAAAAElFTkSuQmCC") 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("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFZJREFUeF59z4EJADEIQ1F36k7u5E7ZKXeUQPACJ3wK7UNokVxVk9kHnQH7bY9hbDyDhNXgjpRLqFlo4M2GgfyJHhjq8V4agfrgPQX3JtJQGbofmCHgA/nAKks+JAjFAAAAAElFTkSuQmCC") 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("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFZJREFUeF59z4EJADEIQ1F36k7u5E7ZKXeUQPACJ3wK7UNokVxVk9kHnQH7bY9hbDyDhNXgjpRLqFlo4M2GgfyJHhjq8V4agfrgPQX3JtJQGbofmCHgA/nAKks+JAjFAAAAAElFTkSuQmCC") 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("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFZJREFUeF59z4EJADEIQ1F36k7u5E7ZKXeUQPACJ3wK7UNokVxVk9kHnQH7bY9hbDyDhNXgjpRLqFlo4M2GgfyJHhjq8V4agfrgPQX3JtJQGbofmCHgA/nAKks+JAjFAAAAAElFTkSuQmCC") 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("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFZJREFUeF59z4EJADEIQ1F36k7u5E7ZKXeUQPACJ3wK7UNokVxVk9kHnQH7bY9hbDyDhNXgjpRLqFlo4M2GgfyJHhjq8V4agfrgPQX3JtJQGbofmCHgA/nAKks+JAjFAAAAAElFTkSuQmCC") 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("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFZJREFUeF59z4EJADEIQ1F36k7u5E7ZKXeUQPACJ3wK7UNokVxVk9kHnQH7bY9hbDyDhNXgjpRLqFlo4M2GgfyJHhjq8V4agfrgPQX3JtJQGbofmCHgA/nAKks+JAjFAAAAAElFTkSuQmCC") no-repeat scroll right center transparent;padding-right: 13px;"></a><br>
|
||||||
<br>
|
<br>
|
||||||
We have also put together a functional demo that presents 6.1. Watch this video<br>
|
We have also put together a functional demo that presents 13.0. Watch this video<br>
|
||||||
to learn directly from us what OpenERP 6.1. can do for you. Share it in your<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>
|
company, with your clients and implement it now for your business.<br>
|
||||||
<br>
|
<br>
|
||||||
<h3>Watch on Youtube!</h3><br>
|
<h3>Watch on Youtube!</h3><br>
|
||||||
<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>
|
||||||
<br>
|
<br>
|
||||||
]]>
|
]]>
|
||||||
@ -56,9 +56,8 @@ company, with your clients and implement it now for your business.<br>
|
|||||||
<field name="content">
|
<field name="content">
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
<br>
|
<br>
|
||||||
You like OpenERP, but feel like you want to personalise it more? Now, OpenERP<br>
|
You like Odoo, but feel like you want to personalise it more? You can customize your
|
||||||
goes a step further and lets you customize your dashboard. Thanks to a new<br>
|
dashboard by adding new boards of any<br>
|
||||||
feature that allows you to customize your dashboard by adding new boards of any<br>
|
|
||||||
search view.<br>
|
search view.<br>
|
||||||
<br>
|
<br>
|
||||||
<h3>How is it done?</h3><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>
|
and apply the filter for "Purchases to Approve", I can add it immediately to my<br>
|
||||||
Purchase dashboard.<br>
|
Purchase dashboard.<br>
|
||||||
<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>
|
<br>
|
||||||
In less than a minute, the search view is visible on the dashboard<br>
|
In less than a minute, the search view is visible on the dashboard<br>
|
||||||
<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>
|
<br>
|
||||||
Of course, you are free to delete what you don't need or like, but just in case<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>
|
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">
|
<field name="content">
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
<br>
|
<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>
|
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>
|
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>
|
consolidated. It works in connected and disconnected modes so that you can<br>
|
||||||
continue to sell if you lose your internet connection.<br>
|
continue to sell if you lose your internet connection.<br>
|
||||||
<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>
|
<br>
|
||||||
<h3>Here's a summary of its main features and benefits:</h3><br>
|
<h3>Here's a summary of its main features and benefits:</h3><br>
|
||||||
<br>
|
<br>
|
||||||
|
@ -13,6 +13,8 @@ class DocumentPage(models.Model):
|
|||||||
_description = "Document Page"
|
_description = "Document Page"
|
||||||
_order = "name"
|
_order = "name"
|
||||||
|
|
||||||
|
_HTML_WIDGET_DEFAULT_VALUE = "<p><br></p>"
|
||||||
|
|
||||||
name = fields.Char("Title", required=True)
|
name = fields.Char("Title", required=True)
|
||||||
type = fields.Selection(
|
type = fields.Selection(
|
||||||
[("content", "Content"), ("category", "Category")],
|
[("content", "Content"), ("category", "Category")],
|
||||||
@ -33,20 +35,18 @@ class DocumentPage(models.Model):
|
|||||||
required=True,
|
required=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
# no-op computed field
|
|
||||||
draft_name = fields.Char(
|
draft_name = fields.Char(
|
||||||
string="Name",
|
string="Name",
|
||||||
help="Name for the changes made",
|
help="Name for the changes made",
|
||||||
compute=lambda x: x,
|
related="history_head.name",
|
||||||
inverse=lambda x: x,
|
readonly=False,
|
||||||
)
|
)
|
||||||
|
|
||||||
# no-op computed field
|
|
||||||
draft_summary = fields.Char(
|
draft_summary = fields.Char(
|
||||||
string="Summary",
|
string="Summary",
|
||||||
help="Describe the changes made",
|
help="Describe the changes made",
|
||||||
compute=lambda x: x,
|
related="history_head.summary",
|
||||||
inverse=lambda x: x,
|
readonly=False,
|
||||||
)
|
)
|
||||||
|
|
||||||
template = fields.Html(
|
template = fields.Html(
|
||||||
@ -117,13 +117,12 @@ class DocumentPage(models.Model):
|
|||||||
if not self._check_recursion():
|
if not self._check_recursion():
|
||||||
raise ValidationError(_("You cannot create recursive categories."))
|
raise ValidationError(_("You cannot create recursive categories."))
|
||||||
|
|
||||||
@api.multi
|
|
||||||
def _get_page_index(self, link=True):
|
def _get_page_index(self, link=True):
|
||||||
"""Return the index of a document."""
|
"""Return the index of a document."""
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
index = []
|
index = [
|
||||||
for subpage in self.child_ids:
|
"<li>" + subpage._get_page_index() + "</li>" for subpage in self.child_ids
|
||||||
index += ["<li>" + subpage._get_page_index() + "</li>"]
|
]
|
||||||
r = ""
|
r = ""
|
||||||
if link:
|
if link:
|
||||||
r = '<a href="{}">{}</a>'.format(self.backend_url, self.name)
|
r = '<a href="{}">{}</a>'.format(self.backend_url, self.name)
|
||||||
@ -131,7 +130,6 @@ class DocumentPage(models.Model):
|
|||||||
r += "<ul>" + "".join(index) + "</ul>"
|
r += "<ul>" + "".join(index) + "</ul>"
|
||||||
return r
|
return r
|
||||||
|
|
||||||
@api.multi
|
|
||||||
@api.depends("history_head")
|
@api.depends("history_head")
|
||||||
def _compute_content(self):
|
def _compute_content(self):
|
||||||
for rec in self:
|
for rec in self:
|
||||||
@ -142,46 +140,42 @@ class DocumentPage(models.Model):
|
|||||||
rec.content = rec.history_head.content
|
rec.content = rec.history_head.content
|
||||||
else:
|
else:
|
||||||
# html widget's default, so it doesn't trigger ghost save
|
# 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):
|
def _inverse_content(self):
|
||||||
|
vals = []
|
||||||
for rec in self:
|
for rec in self:
|
||||||
if rec.type == "content" and rec.content != rec.history_head.content:
|
if rec.type == "content" and rec.content != rec.history_head.content:
|
||||||
rec._create_history(
|
vals.append(
|
||||||
{
|
{
|
||||||
|
"page_id": rec.id,
|
||||||
"name": rec.draft_name,
|
"name": rec.draft_name,
|
||||||
"summary": rec.draft_summary,
|
"summary": rec.draft_summary,
|
||||||
"content": rec.content,
|
"content": rec.content,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
self.env["document.page.history"].create(vals)
|
||||||
|
|
||||||
@api.multi
|
|
||||||
def _search_content(self, operator, value):
|
def _search_content(self, operator, value):
|
||||||
return [("history_head.content", operator, value)]
|
return [("history_head.content", operator, value)]
|
||||||
|
|
||||||
@api.multi
|
|
||||||
@api.depends("history_ids")
|
@api.depends("history_ids")
|
||||||
def _compute_history_head(self):
|
def _compute_history_head(self):
|
||||||
for rec in self:
|
for rec in self:
|
||||||
if rec.history_ids:
|
if rec.history_ids:
|
||||||
rec.history_head = rec.history_ids[0]
|
rec.history_head = rec.history_ids[0]
|
||||||
|
else:
|
||||||
@api.multi
|
rec.history_head = False
|
||||||
def _create_history(self, vals):
|
|
||||||
self.ensure_one()
|
|
||||||
history = self.env["document.page.history"]
|
|
||||||
vals["page_id"] = self.id
|
|
||||||
return history.create(vals)
|
|
||||||
|
|
||||||
@api.onchange("parent_id")
|
@api.onchange("parent_id")
|
||||||
def _onchange_parent_id(self):
|
def _onchange_parent_id(self):
|
||||||
"""We Set it the right content to the new parent."""
|
"""We Set it the right content to the new parent."""
|
||||||
if not self.content or self.content == "<p><br></p>":
|
if (
|
||||||
if self.parent_id and self.parent_id.type == "category":
|
self.content in (False, self._HTML_WIDGET_DEFAULT_VALUE)
|
||||||
self.content = self.parent_id.template
|
and self.parent_id.type == "category"
|
||||||
|
):
|
||||||
|
self.content = self.parent_id.template
|
||||||
|
|
||||||
@api.multi
|
|
||||||
def unlink(self):
|
def unlink(self):
|
||||||
menus = self.mapped("menu_id")
|
menus = self.mapped("menu_id")
|
||||||
res = super().unlink()
|
res = super().unlink()
|
||||||
|
@ -3,8 +3,7 @@
|
|||||||
|
|
||||||
import difflib
|
import difflib
|
||||||
|
|
||||||
from odoo import api, fields, models
|
from odoo import _, api, fields, models
|
||||||
from odoo.tools.translate import _
|
|
||||||
|
|
||||||
|
|
||||||
class DocumentPageHistory(models.Model):
|
class DocumentPageHistory(models.Model):
|
||||||
@ -30,7 +29,6 @@ class DocumentPageHistory(models.Model):
|
|||||||
readonly=True,
|
readonly=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
@api.multi
|
|
||||||
def _compute_diff(self):
|
def _compute_diff(self):
|
||||||
"""Shows a diff between this version and the previous version"""
|
"""Shows a diff between this version and the previous version"""
|
||||||
history = self.env["document.page.history"]
|
history = self.env["document.page.history"]
|
||||||
@ -43,10 +41,7 @@ class DocumentPageHistory(models.Model):
|
|||||||
limit=1,
|
limit=1,
|
||||||
order="create_date DESC",
|
order="create_date DESC",
|
||||||
)
|
)
|
||||||
if prev:
|
rec.diff = self._get_diff(prev.id, rec.id)
|
||||||
rec.diff = self._get_diff(prev.id, rec.id)
|
|
||||||
else:
|
|
||||||
rec.diff = self._get_diff(False, rec.id)
|
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def _get_diff(self, v1, v2):
|
def _get_diff(self, v1, v2):
|
||||||
@ -71,10 +66,5 @@ class DocumentPageHistory(models.Model):
|
|||||||
context=True,
|
context=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
@api.multi
|
|
||||||
def name_get(self):
|
def name_get(self):
|
||||||
result = []
|
return [(rec.id, "%s #%i" % (rec.page_id.name, rec.id)) for rec in self]
|
||||||
for rec in self:
|
|
||||||
name = "%s #%i" % (rec.page_id.name, rec.id)
|
|
||||||
result.append((rec.id, name))
|
|
||||||
return result
|
|
||||||
|
@ -4,3 +4,6 @@
|
|||||||
* Jose Maria Alzaga <jose.alzaga@aselcis.com>
|
* Jose Maria Alzaga <jose.alzaga@aselcis.com>
|
||||||
* Lois Rilo <lois.rilo@eficent.com>
|
* Lois Rilo <lois.rilo@eficent.com>
|
||||||
* Simone Orsi <simone.orsi@camptocamp.com>
|
* Simone Orsi <simone.orsi@camptocamp.com>
|
||||||
|
* `Tecnativa <https://www.tecnativa.com>`_:
|
||||||
|
|
||||||
|
* Ernesto Tejeda
|
||||||
|
@ -367,7 +367,7 @@ ul.auto-toc {
|
|||||||
!! This file is generated by oca-gen-addon-readme !!
|
!! This file is generated by oca-gen-addon-readme !!
|
||||||
!! changes will be overwritten. !!
|
!! 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>This module allows you to write web pages for internal documentation.</p>
|
||||||
<p><strong>Table of contents</strong></p>
|
<p><strong>Table of contents</strong></p>
|
||||||
<div class="contents local topic" id="contents">
|
<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>.
|
<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.
|
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
|
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>
|
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="section" id="credits">
|
<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 <<a class="reference external" href="mailto:jose.alzaga@aselcis.com">jose.alzaga@aselcis.com</a>></li>
|
<li>Jose Maria Alzaga <<a class="reference external" href="mailto:jose.alzaga@aselcis.com">jose.alzaga@aselcis.com</a>></li>
|
||||||
<li>Lois Rilo <<a class="reference external" href="mailto:lois.rilo@eficent.com">lois.rilo@eficent.com</a>></li>
|
<li>Lois Rilo <<a class="reference external" href="mailto:lois.rilo@eficent.com">lois.rilo@eficent.com</a>></li>
|
||||||
<li>Simone Orsi <<a class="reference external" href="mailto:simone.orsi@camptocamp.com">simone.orsi@camptocamp.com</a>></li>
|
<li>Simone Orsi <<a class="reference external" href="mailto:simone.orsi@camptocamp.com">simone.orsi@camptocamp.com</a>></li>
|
||||||
|
<li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:<ul>
|
||||||
|
<li>Ernesto Tejeda</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="section" id="other-credits">
|
<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
|
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
|
||||||
mission is to support the collaborative development of Odoo features and
|
mission is to support the collaborative development of Odoo features and
|
||||||
promote its widespread use.</p>
|
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>
|
<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>
|
||||||
</div>
|
</div>
|
||||||
|
@ -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
|
|
||||||
}
|
|
BIN
document_page/static/src/img/POS.png
Normal file
BIN
document_page/static/src/img/POS.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 206 KiB |
BIN
document_page/static/src/img/add_to_dashboard.png
Normal file
BIN
document_page/static/src/img/add_to_dashboard.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 47 KiB |
BIN
document_page/static/src/img/dashboard.png
Normal file
BIN
document_page/static/src/img/dashboard.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 35 KiB |
28
document_page/static/src/scss/document_page.scss
Normal file
28
document_page/static/src/scss/document_page.scss
Normal 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
|
||||||
|
}
|
||||||
|
}
|
@ -2,4 +2,5 @@
|
|||||||
|
|
||||||
from . import test_document_page
|
from . import test_document_page
|
||||||
from . import test_document_page_create_menu
|
from . import test_document_page_create_menu
|
||||||
|
from . import test_document_page_history
|
||||||
from . import test_document_page_show_diff
|
from . import test_document_page_show_diff
|
||||||
|
@ -26,4 +26,4 @@ class TestDocumentPageCreateMenu(common.TransactionCase):
|
|||||||
active_id=[self.ref("document_page.demo_page1")]
|
active_id=[self.ref("document_page.demo_page1")]
|
||||||
).default_get(fields_list)
|
).default_get(fields_list)
|
||||||
|
|
||||||
self.assertEqual(res["menu_name"], "OpenERP 6.1. Functional Demo")
|
self.assertEqual(res["menu_name"], "Odoo 13.0 Functional Demo")
|
||||||
|
@ -39,11 +39,8 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="Document Page">
|
<form string="Document Page">
|
||||||
<sheet>
|
<sheet>
|
||||||
<div class="oe_button_box" name="button_box">
|
<widget name="web_ribbon" text="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
|
||||||
<button name="toggle_active" type="object" groups="document_page.group_document_manager" class="oe_stat_button" icon="fa-archive">
|
<field name="active" invisible="1"/>
|
||||||
<field name="active" widget="boolean_button" options="{'terminology': 'archive'}"/>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<field name="type" invisible="1"/>
|
<field name="type" invisible="1"/>
|
||||||
<h1>
|
<h1>
|
||||||
<field name="name" placeholder="Name"/>
|
<field name="name" placeholder="Name"/>
|
||||||
@ -63,9 +60,9 @@
|
|||||||
<field name="content_date"/>
|
<field name="content_date"/>
|
||||||
<field name="menu_id" readonly="1" attrs="{'invisible': [('menu_id','=',False)]}"/>
|
<field name="menu_id" readonly="1" attrs="{'invisible': [('menu_id','=',False)]}"/>
|
||||||
</group>
|
</group>
|
||||||
<group string="Revision" class="oe_edit_only">
|
<group string="Revision">
|
||||||
<field name="draft_name" placeholder="Rev 01" class="oe_edit_only" />
|
<field name="draft_name" placeholder="Rev 01" />
|
||||||
<field name="draft_summary" placeholder="eg: Changed ... for ..." class="oe_edit_only" />
|
<field name="draft_summary" placeholder="eg: Changed ... for ..." />
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
</page>
|
</page>
|
||||||
@ -132,7 +129,6 @@
|
|||||||
<field name="res_model">document.page</field>
|
<field name="res_model">document.page</field>
|
||||||
<field name="domain">[('type','=','content')]</field>
|
<field name="domain">[('type','=','content')]</field>
|
||||||
<field name="context">{'default_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_mode">tree,form</field>
|
||||||
<field name="view_id" ref="view_wiki_tree"/>
|
<field name="view_id" ref="view_wiki_tree"/>
|
||||||
<field name="search_view_id" ref="view_wiki_filter"/>
|
<field name="search_view_id" ref="view_wiki_filter"/>
|
||||||
@ -170,14 +166,4 @@
|
|||||||
action="action_page"
|
action="action_page"
|
||||||
sequence="20"/>
|
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>
|
</odoo>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
<template id="assets_backend" name="document_page assets" inherit_id="web.assets_backend">
|
<template id="assets_backend" name="document_page assets" inherit_id="web.assets_backend">
|
||||||
<xpath expr="." position="inside">
|
<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>
|
</xpath>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
3
document_page/views/document_page_category.xml
Executable file → Normal file
3
document_page/views/document_page_category.xml
Executable file → Normal file
@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<odoo>
|
<odoo>
|
||||||
|
|
||||||
<!-- Category Views -->
|
<!-- Category Views -->
|
||||||
@ -76,7 +76,6 @@
|
|||||||
<field name="res_model">document.page</field>
|
<field name="res_model">document.page</field>
|
||||||
<field name="domain">[('type','=','category')]</field>
|
<field name="domain">[('type','=','category')]</field>
|
||||||
<field name="context">{'default_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_mode">tree,form</field>
|
||||||
<field name="view_id" ref="view_category_tree"/>
|
<field name="view_id" ref="view_category_tree"/>
|
||||||
<field name="search_view_id" ref="view_document_category_filter"/>
|
<field name="search_view_id" ref="view_document_category_filter"/>
|
||||||
|
3
document_page/views/document_page_history.xml
Executable file → Normal file
3
document_page/views/document_page_history.xml
Executable file → Normal file
@ -68,7 +68,6 @@
|
|||||||
<record model="ir.actions.act_window" id="action_history">
|
<record model="ir.actions.act_window" id="action_history">
|
||||||
<field name="name">Page history</field>
|
<field name="name">Page history</field>
|
||||||
<field name="res_model">document.page.history</field>
|
<field name="res_model">document.page.history</field>
|
||||||
<field name="view_type">form</field>
|
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
@ -84,7 +83,7 @@
|
|||||||
domain="[('page_id','=',active_id)]"
|
domain="[('page_id','=',active_id)]"
|
||||||
name="Page History"
|
name="Page History"
|
||||||
res_model="document.page.history"
|
res_model="document.page.history"
|
||||||
src_model="document.page"/>
|
binding_model="document.page"/>
|
||||||
|
|
||||||
|
|
||||||
</odoo>
|
</odoo>
|
||||||
|
0
document_page/views/report_document_page.xml
Executable file → Normal file
0
document_page/views/report_document_page.xml
Executable file → Normal file
@ -16,14 +16,13 @@ class DocumentPageCreateMenu(models.TransientModel):
|
|||||||
@api.model
|
@api.model
|
||||||
def default_get(self, fields_list):
|
def default_get(self, fields_list):
|
||||||
"""Get Page name of the menu."""
|
"""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")
|
page_id = self.env.context.get("active_id")
|
||||||
obj_page = self.env["document.page"]
|
obj_page = self.env["document.page"]
|
||||||
page = obj_page.browse(page_id)
|
page = obj_page.browse(page_id)
|
||||||
res["menu_name"] = page.name
|
res["menu_name"] = page.name
|
||||||
return res
|
return res
|
||||||
|
|
||||||
@api.multi
|
|
||||||
def document_page_menu_create(self):
|
def document_page_menu_create(self):
|
||||||
"""Menu creation."""
|
"""Menu creation."""
|
||||||
obj_page = self.env["document.page"]
|
obj_page = self.env["document.page"]
|
||||||
@ -39,7 +38,6 @@ class DocumentPageCreateMenu(models.TransientModel):
|
|||||||
)[1]
|
)[1]
|
||||||
value = {
|
value = {
|
||||||
"name": "Document Page",
|
"name": "Document Page",
|
||||||
"view_type": "form",
|
|
||||||
"view_mode": "form,tree",
|
"view_mode": "form,tree",
|
||||||
"res_model": "document.page",
|
"res_model": "document.page",
|
||||||
"view_id": view_id,
|
"view_id": view_id,
|
||||||
|
@ -25,15 +25,12 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<act_window
|
||||||
<!-- Create Server Action -->
|
id="action_related_page_create_menu"
|
||||||
<record id="action_wiki_create_menu" model="ir.actions.act_window">
|
name="Create Menu"
|
||||||
<field name="name">Create Menu</field>
|
res_model="document.page.create.menu"
|
||||||
<field name="res_model">document.page.create.menu</field>
|
target="new"
|
||||||
<field name="view_mode">form</field>
|
view_mode="form"
|
||||||
<field name="target">new</field>
|
binding_model="document.page"/>
|
||||||
<field name="binding_model_id"
|
|
||||||
ref="document_page.model_document_page"/>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
</odoo>
|
</odoo>
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# 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.exceptions import UserError
|
||||||
from odoo.tools.translate import _
|
|
||||||
|
|
||||||
|
|
||||||
class DocumentPageShowDiff(models.TransientModel):
|
class DocumentPageShowDiff(models.TransientModel):
|
||||||
|
@ -15,27 +15,13 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</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 -->
|
<!-- Create Index Action Window -->
|
||||||
<act_window
|
<act_window
|
||||||
id="action_view_wiki_show_diff_values"
|
id="action_view_wiki_show_diff_values"
|
||||||
key2="client_action_multi"
|
|
||||||
name="Difference"
|
name="Difference"
|
||||||
res_model="wizard.document.page.history.show_diff"
|
res_model="wizard.document.page.history.show_diff"
|
||||||
src_model="document.page.history"
|
binding_model="document.page.history"
|
||||||
view_mode="form"
|
view_mode="form"
|
||||||
target="new"
|
target="new"/>
|
||||||
view_type="form"/>
|
|
||||||
|
|
||||||
</odoo>
|
</odoo>
|
||||||
|
Loading…
Reference in New Issue
Block a user