mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-20 02:06:45 -06:00
fixup! [MIG] document_page_tags
This commit is contained in:
parent
2767b218bf
commit
d50086cb77
@ -17,7 +17,7 @@ class DocumentPageTag(models.Model):
|
|||||||
@api.model
|
@api.model
|
||||||
def create(self, vals):
|
def create(self, vals):
|
||||||
"""Be nice when trying to create duplicates"""
|
"""Be nice when trying to create duplicates"""
|
||||||
existing = self.search([('name', '=ilike', vals['name'])])
|
existing = self.search([('name', '=ilike', vals['name'])], limit=1)
|
||||||
if existing:
|
if existing:
|
||||||
return existing
|
return existing
|
||||||
return super(DocumentPageTag, self).create(vals)
|
return super(DocumentPageTag, self).create(vals)
|
||||||
|
@ -1,20 +1,4 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
##############################################################################
|
# Copyright 2015-2018 Therp BV <https://therp.nl>
|
||||||
#
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||||
# This module copyright (C) 2015 Therp BV <http://therp.nl>.
|
|
||||||
#
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU Affero General Public License as
|
|
||||||
# published by the Free Software Foundation, either version 3 of the
|
|
||||||
# License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU Affero General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU Affero General Public License
|
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
#
|
|
||||||
##############################################################################
|
|
||||||
from . import test_document_page_tags
|
from . import test_document_page_tags
|
||||||
|
Loading…
Reference in New Issue
Block a user