From f46168f4bb2dccedf329bc642ec288399271f003 Mon Sep 17 00:00:00 2001 From: Marcel Savegnago Date: Thu, 19 Dec 2019 03:13:58 -0300 Subject: [PATCH] [MIG] document_page_tags: Migration to 12.0 --- document_page_tags/README.rst | 10 ++- document_page_tags/__init__.py | 1 - document_page_tags/__manifest__.py | 6 +- document_page_tags/models/__init__.py | 1 - document_page_tags/models/document_page.py | 3 +- .../models/document_page_tag.py | 5 +- .../security/ir.model.access.csv | 7 +- document_page_tags/tests/__init__.py | 1 - .../tests/test_document_page_tags.py | 5 +- document_page_tags/views/document_page.xml | 20 +++++- .../views/document_page_tag.xml | 65 +++++++++++++++++-- 11 files changed, 98 insertions(+), 26 deletions(-) diff --git a/document_page_tags/README.rst b/document_page_tags/README.rst index ebae1dcc..ef955d38 100644 --- a/document_page_tags/README.rst +++ b/document_page_tags/README.rst @@ -5,12 +5,14 @@ Tags/Keywords for document page =============================== -This module allows you to fill in keywords on your pages to simplify finding them afterwards. +This module allows you to fill in keywords on your pages to simplify finding +them afterwards. Usage ===== -Fill in your keywords, and search for them by typing (part of) the keyword and choose searching for keywords. +Fill in your keywords, and search for them by typing (part of) the keyword and +choose searching for keywords. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot @@ -21,7 +23,8 @@ 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 +If you spotted it first, help us smashing it by providing a detailed and +welcomed feedback `here `_. Credits @@ -31,6 +34,7 @@ Contributors ------------ * Holger Brunn +* Marcel Savegnago Maintainer ---------- diff --git a/document_page_tags/__init__.py b/document_page_tags/__init__.py index 289e8cdb..7840f99e 100644 --- a/document_page_tags/__init__.py +++ b/document_page_tags/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2015-2018 Therp BV # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from . import models diff --git a/document_page_tags/__manifest__.py b/document_page_tags/__manifest__.py index 77b3cb20..eb29e6d6 100644 --- a/document_page_tags/__manifest__.py +++ b/document_page_tags/__manifest__.py @@ -1,10 +1,10 @@ -# -*- coding: utf-8 -*- # Copyright 2015-2018 Therp BV # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). { - "name": "Tags/Keywords for document page", - "version": "10.0.1.0.0", + "name": "Document Page Tags", + "version": "12.0.1.0.0", "author": "Therp BV,Odoo Community Association (OCA)", + "website": "https://github.com/OCA/knowledge", "license": "AGPL-3", "category": "Knowledge Management", "summary": "Allows you to assign tags or keywords to pages and search for " diff --git a/document_page_tags/models/__init__.py b/document_page_tags/models/__init__.py index 7911c6a6..3242a4a1 100644 --- a/document_page_tags/models/__init__.py +++ b/document_page_tags/models/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2015-2018 Therp BV # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from . import document_page diff --git a/document_page_tags/models/document_page.py b/document_page_tags/models/document_page.py index 0358ac14..04e4bb87 100644 --- a/document_page_tags/models/document_page.py +++ b/document_page_tags/models/document_page.py @@ -1,7 +1,6 @@ -# -*- coding: utf-8 -*- # Copyright 2015-2018 Therp BV # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). -from openerp import models, fields +from odoo import models, fields class DocumentPage(models.Model): diff --git a/document_page_tags/models/document_page_tag.py b/document_page_tags/models/document_page_tag.py index f0380375..3fd759d2 100644 --- a/document_page_tags/models/document_page_tag.py +++ b/document_page_tags/models/document_page_tag.py @@ -1,7 +1,6 @@ -# -*- coding: utf-8 -*- # Copyright 2015-2018 Therp BV # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). -from openerp import api, models, fields +from odoo import api, models, fields class DocumentPageTag(models.Model): @@ -9,6 +8,8 @@ class DocumentPageTag(models.Model): _description = 'A keyword for document pages' name = fields.Char(required=True, translate=True) + color = fields.Integer(string='Color Index') + active = fields.Boolean(default=True) _sql_constraints = [ ('unique_name', 'unique(name)', 'Tags must me unique'), diff --git a/document_page_tags/security/ir.model.access.csv b/document_page_tags/security/ir.model.access.csv index baee8104..c426dec3 100644 --- a/document_page_tags/security/ir.model.access.csv +++ b/document_page_tags/security/ir.model.access.csv @@ -1,3 +1,4 @@ -"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" -access_document_page_tag_all,access_document_page_tag,model_document_page_tag,,1,0,0,0 -access_document_page_tag,access_document_page_tag,model_document_page_tag,base.group_user,1,0,1,1 +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +document_page_user,document.page user,model_document_page_tag,knowledge.group_document_user,1,0,0,0 +document_page_editor,document.page editor,model_document_page_tag,document_page.group_document_editor,1,1,1,0 +document_page_manager,document.page manager,model_document_page_tag,document_page.group_document_manager,1,1,1,1 diff --git a/document_page_tags/tests/__init__.py b/document_page_tags/tests/__init__.py index 5a9ce340..c8af28ed 100644 --- a/document_page_tags/tests/__init__.py +++ b/document_page_tags/tests/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2015-2018 Therp BV # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from . import test_document_page_tags diff --git a/document_page_tags/tests/test_document_page_tags.py b/document_page_tags/tests/test_document_page_tags.py index 7265a5f6..add9d242 100644 --- a/document_page_tags/tests/test_document_page_tags.py +++ b/document_page_tags/tests/test_document_page_tags.py @@ -1,9 +1,8 @@ -# -*- coding: utf-8 -*- # Copyright 2015-2018 Therp BV # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from psycopg2 import IntegrityError -from openerp.tests.common import TransactionCase -from openerp.tools.misc import mute_logger +from odoo.tests.common import TransactionCase +from odoo.tools.misc import mute_logger class TestDocumentPageTags(TransactionCase): diff --git a/document_page_tags/views/document_page.xml b/document_page_tags/views/document_page.xml index f7ed85fc..7f4e1b91 100644 --- a/document_page_tags/views/document_page.xml +++ b/document_page_tags/views/document_page.xml @@ -1,11 +1,12 @@ + document.page - + @@ -18,4 +19,21 @@ + + + + document_page.tags.tree + document.page + + tree + child_ids + + + + + + + diff --git a/document_page_tags/views/document_page_tag.xml b/document_page_tags/views/document_page_tag.xml index 54545a5a..524fbfd3 100644 --- a/document_page_tags/views/document_page_tag.xml +++ b/document_page_tags/views/document_page_tag.xml @@ -1,13 +1,66 @@ - + - + + + document.page.tag.search document.page.tag -
- - - + + + + + + + + + + document.page.tag.form + document.page.tag + + + +
+ +
+
+
+ + + +
+ + + document.page.tag.tree + document.page.tag + + + + + + + + + Tags + ir.actions.act_window + document.page.tag + tree,form + form + + + +