product_library adds some fields to product and some utilities addons from OCA

This commit is contained in:
santiky 2021-08-06 13:03:47 +02:00
parent 9145e0cabe
commit 6c8876b991
Signed by: snt
GPG key ID: A9FD34930EADBE71
334 changed files with 92878 additions and 0 deletions

View file

@ -0,0 +1,24 @@
# Copyright 2016 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from psycopg2.extensions import ISQLQuote
class IdentifierAdapter(ISQLQuote):
def __init__(self, identifier, quote=True):
self.quote = quote
self.identifier = identifier
def __conform__(self, protocol):
if protocol == ISQLQuote:
return self
def getquoted(self):
def is_identifier_char(c):
return c.isalnum() or c in ['_', '$']
format_string = '"%s"'
if not self.quote:
format_string = '%s'
return format_string % ''.join(
filter(is_identifier_char, self.identifier)
)