From 1ae20f68305a714d8061c93af01a520c2b86aa2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Faure-Lacroix?= Date: Tue, 10 Mar 2015 18:43:55 +0300 Subject: [PATCH] [FIX+IMP] document_page: * Add dependency to knowledge * Adding hack in document_page_history to allow calling method that don't exists * document_page_history don't have _sql attribute * Filter more fields --- document_page/__openerp__.py | 2 +- document_page/document_page.py | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/document_page/__openerp__.py b/document_page/__openerp__.py index 5aaf8983..291a62bc 100644 --- a/document_page/__openerp__.py +++ b/document_page/__openerp__.py @@ -32,7 +32,7 @@ Web pages 'website': 'http://www.openerp.com/', 'license': 'AGPL-3', 'depends': [ - 'knowledge' + 'knowledge', ], 'data': [ 'wizard/document_page_create_menu_view.xml', diff --git a/document_page/document_page.py b/document_page/document_page.py index 8983ba00..57e6d050 100644 --- a/document_page/document_page.py +++ b/document_page/document_page.py @@ -18,9 +18,12 @@ # along with this program. If not, see . # ############################################################################## +import logging import difflib from openerp import models, fields, api, _ +_logger = logging.getLogger(__name__) + class document_page(models.Model): _name = "document.page" @@ -177,3 +180,14 @@ class document_page_history(models.Model): "Revision-{}".format(v2), context=True ) + + def __getattr__(self, attr): + """Return a dummy callabale""" + if attr in ['_sql', 'init', '_ids']: + raise AttributeError + + _logger.warning( + "Trying to access attribute %s on document_page_history", + attr + ) + return (lambda *a, **b: None)