diff --git a/document_page/README.rst b/document_page/README.rst index bbf73730..997c90dc 100644 --- a/document_page/README.rst +++ b/document_page/README.rst @@ -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 `_. 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 `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -78,6 +78,9 @@ Contributors * Jose Maria Alzaga * Lois Rilo * Simone Orsi +* `Tecnativa `_: + + * 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 `_ project on GitHub. +This module is part of the `OCA/knowledge `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/document_page/__manifest__.py b/document_page/__manifest__.py index eca674e3..1a6e8698 100644 --- a/document_page/__manifest__.py +++ b/document_page/__manifest__.py @@ -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": [ diff --git a/document_page/demo/document_page.xml b/document_page/demo/document_page.xml index 799dfbee..b0b5b4e1 100644 --- a/document_page/demo/document_page.xml +++ b/document_page/demo/document_page.xml @@ -7,7 +7,7 @@ - OpenERP Features + Odoo Features category Summary of the feature @@ -22,28 +22,28 @@ Additional ressources - OpenERP 6.1. Functional Demo + Odoo 13.0 Functional Demo
-The news is out, OpenERP's latest version 6.1. is here. It's more
+The news is out, Odoo's latest version 13.0 is here. It's more
user-friendly, even more business oriented and efficient to manage your company

-How to discover the latest version 6.1.?
+How to discover the latest version 13.0?

-Demo :
-Online:
-Download:
+Demo :
+Online:
+Download:

-We have also put together a functional demo that presents 6.1. Watch this video
-to learn directly from us what OpenERP 6.1. can do for you. Share it in your
+We have also put together a functional demo that presents 13.0. Watch this video
+to learn directly from us what Odoo 13.0 can do for you. Share it in your
company, with your clients and implement it now for your business.

Watch on Youtube!



-
+


]]> @@ -56,9 +56,8 @@ company, with your clients and implement it now for your business.
-You like OpenERP, but feel like you want to personalise it more? Now, OpenERP
-goes a step further and lets you customize your dashboard. Thanks to a new
-feature that allows you to customize your dashboard by adding new boards of any
+You like Odoo, but feel like you want to personalise it more? You can customize your +dashboard by adding new boards of any
search view.

How is it done?


@@ -77,11 +76,11 @@ application's dashboard "Purchases to Approve". After I access the search view Purchase dashboard.

-
+Add to dashboard

In less than a minute, the search view is visible on the dashboard

-
+Dashboard

Of course, you are free to delete what you don't need or like, but just in case
you change your mind there is a reset button to return to the default view.
@@ -97,13 +96,13 @@ you change your mind there is a reset button to return to the default view.
-The brand new OpenERP touchscreen point of sale available with 6.1 allows you
+The Odoo touchscreen point of sale available with 13.0 allows you
to manage your shop sales very easily. It's fully web based so that you don't
have to install or deploy any software and all the sales shops can be easily
consolidated. It works in connected and disconnected modes so that you can
continue to sell if you lose your internet connection.

-
+Point of Sale

Here's a summary of its main features and benefits:



diff --git a/document_page/models/document_page.py b/document_page/models/document_page.py index 25feeaec..5e714ba8 100644 --- a/document_page/models/document_page.py +++ b/document_page/models/document_page.py @@ -13,6 +13,8 @@ class DocumentPage(models.Model): _description = "Document Page" _order = "name" + _HTML_WIDGET_DEFAULT_VALUE = "


" + 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 += ["
  • " + subpage._get_page_index() + "
  • "] + index = [ + "
  • " + subpage._get_page_index() + "
  • " for subpage in self.child_ids + ] r = "" if link: r = '{}'.format(self.backend_url, self.name) @@ -131,7 +130,6 @@ class DocumentPage(models.Model): r += "
      " + "".join(index) + "
    " 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 = "


    " + 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 == "


    ": - 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() diff --git a/document_page/models/document_page_history.py b/document_page/models/document_page_history.py index bb27a204..d580186a 100644 --- a/document_page/models/document_page_history.py +++ b/document_page/models/document_page_history.py @@ -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] diff --git a/document_page/readme/CONTRIBUTORS.rst b/document_page/readme/CONTRIBUTORS.rst index 2061bdb5..f9997fbb 100644 --- a/document_page/readme/CONTRIBUTORS.rst +++ b/document_page/readme/CONTRIBUTORS.rst @@ -4,3 +4,6 @@ * Jose Maria Alzaga * Lois Rilo * Simone Orsi +* `Tecnativa `_: + + * Ernesto Tejeda diff --git a/document_page/static/description/index.html b/document_page/static/description/index.html index e432c655..9d1c16fa 100644 --- a/document_page/static/description/index.html +++ b/document_page/static/description/index.html @@ -367,7 +367,7 @@ ul.auto-toc { !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

    Beta License: AGPL-3 OCA/knowledge Translate me on Weblate Try me on Runbot

    +

    Beta License: AGPL-3 OCA/knowledge Translate me on Weblate Try me on Runbot

    This module allows you to write web pages for internal documentation.

    Table of contents

    @@ -407,7 +407,7 @@ ul.auto-toc {

    Bugs are tracked on GitHub 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.

    +feedback.

    Do not contact contributors directly about support or help with technical issues.

    @@ -427,6 +427,10 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
  • Jose Maria Alzaga <jose.alzaga@aselcis.com>
  • Lois Rilo <lois.rilo@eficent.com>
  • Simone Orsi <simone.orsi@camptocamp.com>
  • +
  • Tecnativa:
      +
    • Ernesto Tejeda
    • +
    +
  • @@ -444,7 +448,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome

    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 project on GitHub.

    +

    This module is part of the OCA/knowledge project on GitHub.

    You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

    diff --git a/document_page/static/src/css/document_page.css b/document_page/static/src/css/document_page.css deleted file mode 100644 index 071c5446..00000000 --- a/document_page/static/src/css/document_page.css +++ /dev/null @@ -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 -} diff --git a/document_page/static/src/img/POS.png b/document_page/static/src/img/POS.png new file mode 100644 index 00000000..4d84a21d Binary files /dev/null and b/document_page/static/src/img/POS.png differ diff --git a/document_page/static/src/img/add_to_dashboard.png b/document_page/static/src/img/add_to_dashboard.png new file mode 100644 index 00000000..c099664d Binary files /dev/null and b/document_page/static/src/img/add_to_dashboard.png differ diff --git a/document_page/static/src/img/dashboard.png b/document_page/static/src/img/dashboard.png new file mode 100644 index 00000000..88519fad Binary files /dev/null and b/document_page/static/src/img/dashboard.png differ diff --git a/document_page/static/src/scss/document_page.scss b/document_page/static/src/scss/document_page.scss new file mode 100644 index 00000000..3755f59d --- /dev/null +++ b/document_page/static/src/scss/document_page.scss @@ -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 + } +} diff --git a/document_page/tests/__init__.py b/document_page/tests/__init__.py index 8f1890ad..4718f42c 100644 --- a/document_page/tests/__init__.py +++ b/document_page/tests/__init__.py @@ -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 diff --git a/document_page/tests/test_document_page_create_menu.py b/document_page/tests/test_document_page_create_menu.py index 82dbf378..dc7c38e8 100644 --- a/document_page/tests/test_document_page_create_menu.py +++ b/document_page/tests/test_document_page_create_menu.py @@ -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") diff --git a/document_page/views/document_page.xml b/document_page/views/document_page.xml index 63477914..b5b6e02f 100644 --- a/document_page/views/document_page.xml +++ b/document_page/views/document_page.xml @@ -39,11 +39,8 @@
    -
    - -
    + +

    @@ -63,9 +60,9 @@ - - - + + + @@ -132,7 +129,6 @@ document.page [('type','=','content')] {'default_type': 'content'} - form tree,form @@ -170,14 +166,4 @@ action="action_page" sequence="20"/> - - - diff --git a/document_page/views/document_page_assets.xml b/document_page/views/document_page_assets.xml index b85b0e06..bf52fe87 100644 --- a/document_page/views/document_page_assets.xml +++ b/document_page/views/document_page_assets.xml @@ -3,7 +3,7 @@ diff --git a/document_page/views/document_page_category.xml b/document_page/views/document_page_category.xml old mode 100755 new mode 100644 index 83e7f242..f71ce59e --- a/document_page/views/document_page_category.xml +++ b/document_page/views/document_page_category.xml @@ -1,4 +1,4 @@ - + @@ -76,7 +76,6 @@ document.page [('type','=','category')] {'default_type': 'category'} - form tree,form diff --git a/document_page/views/document_page_history.xml b/document_page/views/document_page_history.xml old mode 100755 new mode 100644 index d1bb819a..eaa75649 --- a/document_page/views/document_page_history.xml +++ b/document_page/views/document_page_history.xml @@ -68,7 +68,6 @@ Page history document.page.history - form tree,form @@ -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"/> diff --git a/document_page/views/report_document_page.xml b/document_page/views/report_document_page.xml old mode 100755 new mode 100644 diff --git a/document_page/wizard/document_page_create_menu.py b/document_page/wizard/document_page_create_menu.py index e7b61b13..a54f5ecd 100644 --- a/document_page/wizard/document_page_create_menu.py +++ b/document_page/wizard/document_page_create_menu.py @@ -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, diff --git a/document_page/wizard/document_page_create_menu.xml b/document_page/wizard/document_page_create_menu.xml index 0bc325a2..b3c26396 100644 --- a/document_page/wizard/document_page_create_menu.xml +++ b/document_page/wizard/document_page_create_menu.xml @@ -25,15 +25,12 @@ - - - - Create Menu - document.page.create.menu - form - new - - + diff --git a/document_page/wizard/document_page_show_diff.py b/document_page/wizard/document_page_show_diff.py index bc018aa0..705ab856 100644 --- a/document_page/wizard/document_page_show_diff.py +++ b/document_page/wizard/document_page_show_diff.py @@ -1,9 +1,8 @@ # Copyright (C) 2004-2010 Tiny SPRL (). # 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): diff --git a/document_page/wizard/document_page_show_diff.xml b/document_page/wizard/document_page_show_diff.xml index c933ac64..19c3e1d3 100644 --- a/document_page/wizard/document_page_show_diff.xml +++ b/document_page/wizard/document_page_show_diff.xml @@ -15,27 +15,13 @@ - - - - Difference - ir.actions.act_window - wizard.document.page.history.show_diff - form - form - new - - - + target="new"/>