mirror of
https://github.com/OCA/knowledge.git
synced 2025-08-28 10:16:13 -06:00
[MIG] document_page_reference: Migration to 16.0
[UPD] Update document_page_reference.pot [UPD] README.rst Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: knowledge-16.0/knowledge-16.0-document_page_reference Translate-URL: https://translation.odoo-community.org/projects/knowledge-16-0/knowledge-16-0-document_page_reference/
This commit is contained in:
parent
a56bfe992c
commit
a17b133f09
@ -2,10 +2,13 @@
|
|||||||
Document Page Reference
|
Document Page Reference
|
||||||
=======================
|
=======================
|
||||||
|
|
||||||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
..
|
||||||
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
!! 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. !!
|
||||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
!! source digest: sha256:5d292a9a2801b240d48e191b17add731644b0c0d2516df16ddc0f08267295fba
|
||||||
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
|
||||||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
||||||
:target: https://odoo-community.org/page/development-status
|
:target: https://odoo-community.org/page/development-status
|
||||||
@ -14,16 +17,16 @@ Document Page Reference
|
|||||||
: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/15.0/document_page_reference
|
:target: https://github.com/OCA/knowledge/tree/16.0/document_page_reference
|
||||||
: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-15-0/knowledge-15-0-document_page_reference
|
:target: https://translation.odoo-community.org/projects/knowledge-16-0/knowledge-16-0-document_page_reference
|
||||||
: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/runboat-Try%20me-875A7B.png
|
||||||
:target: https://runbot.odoo-community.org/runbot/118/15.0
|
:target: https://runboat.odoo-community.org/builds?repo=OCA/knowledge&target_branch=16.0
|
||||||
:alt: Try me on Runbot
|
:alt: Try me on Runboat
|
||||||
|
|
||||||
|badge1| |badge2| |badge3| |badge4| |badge5|
|
|badge1| |badge2| |badge3| |badge4| |badge5|
|
||||||
|
|
||||||
This module allows to add a reference name on documents and simplifies the link
|
This module allows to add a reference name on documents and simplifies the link
|
||||||
between document pages.
|
between document pages.
|
||||||
@ -45,8 +48,8 @@ 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 to smash it by providing a detailed and welcomed
|
||||||
`feedback <https://github.com/OCA/knowledge/issues/new?body=module:%20document_page_reference%0Aversion:%2015.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_reference%0Aversion:%2016.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.
|
||||||
|
|
||||||
@ -84,6 +87,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
|
|||||||
|
|
||||||
|maintainer-etobella|
|
|maintainer-etobella|
|
||||||
|
|
||||||
This module is part of the `OCA/knowledge <https://github.com/OCA/knowledge/tree/15.0/document_page_reference>`_ project on GitHub.
|
This module is part of the `OCA/knowledge <https://github.com/OCA/knowledge/tree/16.0/document_page_reference>`_ 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.
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
"name": "Document Page Reference",
|
"name": "Document Page Reference",
|
||||||
"summary": """
|
"summary": """
|
||||||
Include references on document pages""",
|
Include references on document pages""",
|
||||||
"version": "15.0.1.1.0",
|
"version": "16.0.1.0.0",
|
||||||
"license": "AGPL-3",
|
"license": "AGPL-3",
|
||||||
"author": "Creu Blanca,Odoo Community Association (OCA)",
|
"author": "Creu Blanca,Odoo Community Association (OCA)",
|
||||||
"website": "https://github.com/OCA/knowledge",
|
"website": "https://github.com/OCA/knowledge",
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#
|
#
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Odoo Server 15.0\n"
|
"Project-Id-Version: Odoo Server 16.0\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"Last-Translator: \n"
|
"Last-Translator: \n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
@ -29,12 +29,14 @@ msgid "Reference"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: document_page_reference
|
#. module: document_page_reference
|
||||||
|
#. odoo-python
|
||||||
#: code:addons/document_page_reference/models/document_page.py:0
|
#: code:addons/document_page_reference/models/document_page.py:0
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Reference is not valid"
|
msgid "Reference is not valid"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: document_page_reference
|
#. module: document_page_reference
|
||||||
|
#. odoo-python
|
||||||
#: code:addons/document_page_reference/models/document_page.py:0
|
#: code:addons/document_page_reference/models/document_page.py:0
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Reference must be unique"
|
msgid "Reference must be unique"
|
||||||
|
@ -32,12 +32,14 @@ msgid "Reference"
|
|||||||
msgstr "Riferimento"
|
msgstr "Riferimento"
|
||||||
|
|
||||||
#. module: document_page_reference
|
#. module: document_page_reference
|
||||||
|
#. odoo-python
|
||||||
#: code:addons/document_page_reference/models/document_page.py:0
|
#: code:addons/document_page_reference/models/document_page.py:0
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Reference is not valid"
|
msgid "Reference is not valid"
|
||||||
msgstr "Il riferimento non è valido"
|
msgstr "Il riferimento non è valido"
|
||||||
|
|
||||||
#. module: document_page_reference
|
#. module: document_page_reference
|
||||||
|
#. odoo-python
|
||||||
#: code:addons/document_page_reference/models/document_page.py:0
|
#: code:addons/document_page_reference/models/document_page.py:0
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Reference must be unique"
|
msgid "Reference must be unique"
|
||||||
|
@ -135,16 +135,16 @@ class DocumentPage(models.Model):
|
|||||||
def get_raw_content(self):
|
def get_raw_content(self):
|
||||||
return self.with_context(raw_reference=True).get_content()
|
return self.with_context(raw_reference=True).get_content()
|
||||||
|
|
||||||
@api.model
|
@api.model_create_multi
|
||||||
def create(self, vals):
|
def create(self, vals_list):
|
||||||
if not vals.get("reference"):
|
for vals in vals_list:
|
||||||
# Propose a default reference
|
if not vals.get("reference"):
|
||||||
reference = slugify(vals.get("name")).replace("-", "_")
|
# Propose a default reference
|
||||||
try:
|
reference = slugify(vals.get("name")).replace("-", "_")
|
||||||
self._validate_reference(reference=reference)
|
try:
|
||||||
vals["reference"] = reference
|
self._validate_reference(reference=reference)
|
||||||
except ValidationError: # pylint: disable=W7938
|
vals["reference"] = reference
|
||||||
# Do not fill reference.
|
except ValidationError: # pylint: disable=W7938
|
||||||
pass
|
# Do not fill reference.
|
||||||
|
pass
|
||||||
return super(DocumentPage, self).create(vals)
|
return super(DocumentPage, self).create(vals_list)
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
|
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
|
||||||
<title>Document Page Reference</title>
|
<title>Document Page Reference</title>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
|
|
||||||
/*
|
/*
|
||||||
:Author: David Goodger (goodger@python.org)
|
:Author: David Goodger (goodger@python.org)
|
||||||
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
|
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
|
||||||
:Copyright: This stylesheet has been placed in the public domain.
|
:Copyright: This stylesheet has been placed in the public domain.
|
||||||
|
|
||||||
Default cascading style sheet for the HTML output of Docutils.
|
Default cascading style sheet for the HTML output of Docutils.
|
||||||
|
|
||||||
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
|
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
|
||||||
customize this style sheet.
|
customize this style sheet.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -366,61 +366,63 @@ 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. !!
|
||||||
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
!! source digest: sha256:5d292a9a2801b240d48e191b17add731644b0c0d2516df16ddc0f08267295fba
|
||||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||||
<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/15.0/document_page_reference"><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-15-0/knowledge-15-0-document_page_reference"><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/15.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 image-reference" 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 image-reference" 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 image-reference" href="https://github.com/OCA/knowledge/tree/16.0/document_page_reference"><img alt="OCA/knowledge" src="https://img.shields.io/badge/github-OCA%2Fknowledge-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/knowledge-16-0/knowledge-16-0-document_page_reference"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/knowledge&target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
|
||||||
<p>This module allows to add a reference name on documents and simplifies the link
|
<p>This module allows to add a reference name on documents and simplifies the link
|
||||||
between document pages.</p>
|
between document pages.</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">
|
||||||
<ul class="simple">
|
<ul class="simple">
|
||||||
<li><a class="reference internal" href="#usage" id="id1">Usage</a></li>
|
<li><a class="reference internal" href="#usage" id="toc-entry-1">Usage</a></li>
|
||||||
<li><a class="reference internal" href="#bug-tracker" id="id2">Bug Tracker</a></li>
|
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-2">Bug Tracker</a></li>
|
||||||
<li><a class="reference internal" href="#credits" id="id3">Credits</a><ul>
|
<li><a class="reference internal" href="#credits" id="toc-entry-3">Credits</a><ul>
|
||||||
<li><a class="reference internal" href="#authors" id="id4">Authors</a></li>
|
<li><a class="reference internal" href="#authors" id="toc-entry-4">Authors</a></li>
|
||||||
<li><a class="reference internal" href="#contributors" id="id5">Contributors</a></li>
|
<li><a class="reference internal" href="#contributors" id="toc-entry-5">Contributors</a></li>
|
||||||
<li><a class="reference internal" href="#maintainers" id="id6">Maintainers</a></li>
|
<li><a class="reference internal" href="#maintainers" id="toc-entry-6">Maintainers</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="section" id="usage">
|
<div class="section" id="usage">
|
||||||
<h1><a class="toc-backref" href="#id1">Usage</a></h1>
|
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
|
||||||
<p>When editing a document page add elements like ${XXX} where XXX is the reference
|
<p>When editing a document page add elements like ${XXX} where XXX is the reference
|
||||||
of another page. Now, when viewing the document, it will link directly to the page.
|
of another page. Now, when viewing the document, it will link directly to the page.
|
||||||
Also, the name will be parsed as the display name.</p>
|
Also, the name will be parsed as the display name.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="section" id="bug-tracker">
|
<div class="section" id="bug-tracker">
|
||||||
<h1><a class="toc-backref" href="#id2">Bug Tracker</a></h1>
|
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
|
||||||
<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 to smash it by providing a detailed and welcomed
|
||||||
<a class="reference external" href="https://github.com/OCA/knowledge/issues/new?body=module:%20document_page_reference%0Aversion:%2015.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_reference%0Aversion:%2016.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">
|
||||||
<h1><a class="toc-backref" href="#id3">Credits</a></h1>
|
<h1><a class="toc-backref" href="#toc-entry-3">Credits</a></h1>
|
||||||
<div class="section" id="authors">
|
<div class="section" id="authors">
|
||||||
<h2><a class="toc-backref" href="#id4">Authors</a></h2>
|
<h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
|
||||||
<ul class="simple">
|
<ul class="simple">
|
||||||
<li>Creu Blanca</li>
|
<li>Creu Blanca</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="section" id="contributors">
|
<div class="section" id="contributors">
|
||||||
<h2><a class="toc-backref" href="#id5">Contributors</a></h2>
|
<h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
|
||||||
<ul class="simple">
|
<ul class="simple">
|
||||||
<li>Enric Tobella <<a class="reference external" href="mailto:etobella@creublanca.es">etobella@creublanca.es</a>></li>
|
<li>Enric Tobella <<a class="reference external" href="mailto:etobella@creublanca.es">etobella@creublanca.es</a>></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="section" id="maintainers">
|
<div class="section" id="maintainers">
|
||||||
<h2><a class="toc-backref" href="#id6">Maintainers</a></h2>
|
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
|
||||||
<p>This module is maintained by the OCA.</p>
|
<p>This module is maintained by the OCA.</p>
|
||||||
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
|
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
|
||||||
<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>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
|
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
|
||||||
<p><a class="reference external" href="https://github.com/etobella"><img alt="etobella" src="https://github.com/etobella.png?size=40px" /></a></p>
|
<p><a class="reference external image-reference" href="https://github.com/etobella"><img alt="etobella" src="https://github.com/etobella.png?size=40px" /></a></p>
|
||||||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/knowledge/tree/15.0/document_page_reference">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/16.0/document_page_reference">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>
|
||||||
|
@ -6,14 +6,15 @@ from odoo.tests.common import TransactionCase
|
|||||||
|
|
||||||
|
|
||||||
class TestDocumentReference(TransactionCase):
|
class TestDocumentReference(TransactionCase):
|
||||||
def setUp(self):
|
@classmethod
|
||||||
super().setUp()
|
def setUpClass(cls):
|
||||||
self.page_obj = self.env["document.page"]
|
super(TestDocumentReference, cls).setUpClass()
|
||||||
self.history_obj = self.env["document.page.history"]
|
cls.page_obj = cls.env["document.page"]
|
||||||
self.page1 = self.page_obj.create(
|
cls.history_obj = cls.env["document.page.history"]
|
||||||
|
cls.page1 = cls.page_obj.create(
|
||||||
{"name": "Test Page 1", "content": "${r2}", "reference": "R1"}
|
{"name": "Test Page 1", "content": "${r2}", "reference": "R1"}
|
||||||
)
|
)
|
||||||
self.page2 = self.page_obj.create(
|
cls.page2 = cls.page_obj.create(
|
||||||
{"name": "Test Page 1", "content": "${r1}", "reference": "r2"}
|
{"name": "Test Page 1", "content": "${r1}", "reference": "r2"}
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -55,3 +56,23 @@ class TestDocumentReference(TransactionCase):
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
self.assertFalse(new_page_duplicated_name.reference)
|
self.assertFalse(new_page_duplicated_name.reference)
|
||||||
|
|
||||||
|
def test_get_formview_action(self):
|
||||||
|
res = self.page1.get_formview_action()
|
||||||
|
view_id = self.env.ref("document_page.view_wiki_form").id
|
||||||
|
expected_result = {
|
||||||
|
"type": "ir.actions.act_window",
|
||||||
|
"context": {},
|
||||||
|
"res_model": "document.page",
|
||||||
|
"res_id": self.page1.id,
|
||||||
|
"view_mode": "form",
|
||||||
|
"view_type": "form",
|
||||||
|
"target": "current",
|
||||||
|
"views": [(view_id, "form")],
|
||||||
|
}
|
||||||
|
self.assertEqual(res, expected_result)
|
||||||
|
|
||||||
|
def test_compute_content_parsed(self):
|
||||||
|
self.page1.content = "<p>"
|
||||||
|
self.page1._compute_content_parsed()
|
||||||
|
self.assertEqual(str(self.page1.content_parsed), "<p></p>")
|
||||||
|
Loading…
Reference in New Issue
Block a user