Follow isort formatting
issue10928
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
[settings]
|
||||
multi_line_output=4
|
||||
known_first_party=trytond
|
||||
+2
-2
@@ -25,10 +25,10 @@ if options.coroutine:
|
||||
from gevent import monkey
|
||||
monkey.patch_all()
|
||||
|
||||
from trytond.modules import get_module_info, get_module_list
|
||||
from trytond.pool import Pool
|
||||
# Import trytond things after it is configured
|
||||
from trytond.wsgi import app
|
||||
from trytond.pool import Pool
|
||||
from trytond.modules import get_module_list, get_module_info
|
||||
|
||||
with commandline.pidfile(options):
|
||||
Pool.start()
|
||||
|
||||
+1
-1
@@ -1,8 +1,8 @@
|
||||
#!/usr/bin/env python3
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
import sys
|
||||
import os
|
||||
import sys
|
||||
|
||||
DIR = os.path.abspath(os.path.normpath(os.path.join(__file__,
|
||||
'..', '..', 'trytond')))
|
||||
|
||||
+1
-1
@@ -1,8 +1,8 @@
|
||||
#!/usr/bin/env python3
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
import sys
|
||||
import os
|
||||
import sys
|
||||
|
||||
DIR = os.path.abspath(os.path.normpath(os.path.join(__file__,
|
||||
'..', '..', 'trytond')))
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
#!/usr/bin/env python3
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
import sys
|
||||
import os
|
||||
import sys
|
||||
|
||||
DIR = os.path.abspath(os.path.normpath(os.path.join(__file__,
|
||||
'..', '..', 'trytond')))
|
||||
@@ -17,9 +17,9 @@ options = parser.parse_args()
|
||||
config.update_etc(options.configfile)
|
||||
commandline.config_log(options)
|
||||
|
||||
import trytond.cron as cron
|
||||
# Import after application is configured
|
||||
from trytond.pool import Pool
|
||||
import trytond.cron as cron
|
||||
|
||||
with commandline.pidfile(options):
|
||||
Pool.start()
|
||||
|
||||
@@ -6,7 +6,6 @@ import datetime as dt
|
||||
import math
|
||||
import os
|
||||
import sys
|
||||
|
||||
from collections import defaultdict
|
||||
|
||||
DIR = os.path.abspath(os.path.normpath(os.path.join(__file__,
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
#!/usr/bin/env python3
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
import sys
|
||||
import os
|
||||
import sys
|
||||
|
||||
DIR = os.path.abspath(os.path.normpath(os.path.join(__file__,
|
||||
'..', '..', 'trytond')))
|
||||
@@ -17,9 +17,9 @@ options = parser.parse_args()
|
||||
config.update_etc(options.configfile)
|
||||
commandline.config_log(options)
|
||||
|
||||
import trytond.worker as worker
|
||||
# Import after application is configured
|
||||
from trytond.pool import Pool
|
||||
import trytond.worker as worker
|
||||
|
||||
with commandline.pidfile(options):
|
||||
Pool.start()
|
||||
|
||||
@@ -2,14 +2,15 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
|
||||
from setuptools import setup, find_packages, Command
|
||||
import glob
|
||||
import os
|
||||
import re
|
||||
import io
|
||||
import os
|
||||
import platform
|
||||
import re
|
||||
import subprocess
|
||||
|
||||
from setuptools import Command, find_packages, setup
|
||||
|
||||
|
||||
def read(fname):
|
||||
return io.open(
|
||||
|
||||
+6
-6
@@ -1,18 +1,18 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
import sys
|
||||
import os
|
||||
import logging
|
||||
import os
|
||||
import random
|
||||
import sys
|
||||
from getpass import getpass
|
||||
|
||||
from sql import Table, Literal
|
||||
from sql import Literal, Table
|
||||
|
||||
from trytond import backend
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.pool import Pool
|
||||
from trytond.config import config
|
||||
from trytond.pool import Pool
|
||||
from trytond.sendmail import send_test_email
|
||||
from trytond.transaction import Transaction
|
||||
|
||||
__all__ = ['run']
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -128,7 +128,7 @@ def run(options):
|
||||
|
||||
|
||||
def validate(models, percentage=100):
|
||||
from trytond.model import ModelStorage, ModelSingleton
|
||||
from trytond.model import ModelSingleton, ModelStorage
|
||||
from trytond.model.exceptions import ValidationError
|
||||
logger = logging.getLogger('validate')
|
||||
pool = Pool()
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
import csv
|
||||
import os
|
||||
import logging.config
|
||||
import os
|
||||
import threading
|
||||
from io import StringIO
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
import importlib
|
||||
import urllib.parse
|
||||
|
||||
try:
|
||||
import pkg_resources
|
||||
except ImportError:
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
from collections import namedtuple
|
||||
|
||||
from sql import For
|
||||
|
||||
DatabaseIntegrityError = None
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
from collections import defaultdict
|
||||
import time
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import json
|
||||
import time
|
||||
import warnings
|
||||
from collections import defaultdict
|
||||
from datetime import datetime
|
||||
from decimal import Decimal
|
||||
from itertools import chain, repeat
|
||||
@@ -16,24 +16,22 @@ try:
|
||||
compat.register()
|
||||
except ImportError:
|
||||
pass
|
||||
from psycopg2 import connect, Binary
|
||||
from psycopg2 import Binary, connect
|
||||
from psycopg2.extensions import (
|
||||
ISOLATION_LEVEL_AUTOCOMMIT, ISOLATION_LEVEL_REPEATABLE_READ, UNICODE, AsIs,
|
||||
cursor, register_adapter, register_type)
|
||||
from psycopg2.pool import PoolError, ThreadedConnectionPool
|
||||
from psycopg2.sql import SQL, Identifier
|
||||
from psycopg2.pool import ThreadedConnectionPool, PoolError
|
||||
from psycopg2.extensions import cursor
|
||||
from psycopg2.extensions import ISOLATION_LEVEL_REPEATABLE_READ
|
||||
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT
|
||||
from psycopg2.extensions import register_type, register_adapter
|
||||
from psycopg2.extensions import UNICODE, AsIs
|
||||
|
||||
try:
|
||||
from psycopg2.extensions import PYDATE, PYDATETIME, PYTIME, PYINTERVAL
|
||||
from psycopg2.extensions import PYDATE, PYDATETIME, PYINTERVAL, PYTIME
|
||||
except ImportError:
|
||||
PYDATE, PYDATETIME, PYTIME, PYINTERVAL = None, None, None, None
|
||||
from psycopg2 import IntegrityError as DatabaseIntegrityError
|
||||
from psycopg2 import OperationalError as DatabaseOperationalError
|
||||
from psycopg2 import ProgrammingError
|
||||
from psycopg2.extras import register_default_json, register_default_jsonb
|
||||
|
||||
from sql import Flavor, Cast, For, Table
|
||||
from sql import Cast, Flavor, For, Table
|
||||
from sql.conditionals import Coalesce
|
||||
from sql.functions import Function
|
||||
from sql.operators import BinaryOperator, Concat
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
import re
|
||||
import logging
|
||||
import re
|
||||
|
||||
from psycopg2.sql import SQL, Identifier, Composed
|
||||
from psycopg2.sql import SQL, Composed, Identifier
|
||||
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.backend.table import TableHandlerInterface
|
||||
from trytond.transaction import Transaction
|
||||
|
||||
__all__ = ['TableHandler']
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import urllib.parse
|
||||
import warnings
|
||||
from decimal import Decimal
|
||||
from weakref import WeakKeyDictionary
|
||||
|
||||
from werkzeug.security import safe_join
|
||||
|
||||
try:
|
||||
@@ -21,10 +22,12 @@ except ImportError:
|
||||
import sqlite3 as sqlite
|
||||
from sqlite3 import IntegrityError as DatabaseIntegrityError
|
||||
from sqlite3 import OperationalError as DatabaseOperationalError
|
||||
from sql import Flavor, Table, Query, Expression, Literal, Null
|
||||
|
||||
from sql import Expression, Flavor, Literal, Null, Query, Table
|
||||
from sql.conditionals import NullIf
|
||||
from sql.functions import (Function, Extract, Position, Substring,
|
||||
Overlay, CharLength, CurrentTimestamp, Trim)
|
||||
from sql.functions import (
|
||||
CharLength, CurrentTimestamp, Extract, Function, Overlay, Position,
|
||||
Substring, Trim)
|
||||
|
||||
from trytond.backend.database import DatabaseInterface, SQLType
|
||||
from trytond.config import config, parse_uri
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.backend.table import TableHandlerInterface
|
||||
import logging
|
||||
import re
|
||||
import warnings
|
||||
|
||||
from trytond.backend.table import TableHandlerInterface
|
||||
from trytond.transaction import Transaction
|
||||
|
||||
from .database import sqlite
|
||||
|
||||
__all__ = ['TableHandler']
|
||||
|
||||
+7
-6
@@ -9,24 +9,25 @@ import select
|
||||
import threading
|
||||
import time
|
||||
import uuid
|
||||
|
||||
try:
|
||||
from http import HTTPStatus
|
||||
except ImportError:
|
||||
from http import client as HTTPStatus
|
||||
|
||||
from urllib.parse import urljoin
|
||||
|
||||
from werkzeug.exceptions import BadRequest
|
||||
from werkzeug.exceptions import NotImplemented as NotImplementedException
|
||||
from werkzeug.utils import redirect
|
||||
from werkzeug.wrappers import Response
|
||||
from werkzeug.exceptions import (
|
||||
NotImplemented as NotImplementedException, BadRequest)
|
||||
|
||||
from trytond import backend
|
||||
from trytond.wsgi import app
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.protocols.jsonrpc import JSONEncoder, JSONDecoder
|
||||
from trytond.config import config
|
||||
from trytond.protocols.jsonrpc import JSONDecoder, JSONEncoder
|
||||
from trytond.tools import resolve
|
||||
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.wsgi import app
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
+1
-1
@@ -17,8 +17,8 @@ from sql.functions import CurrentTimestamp, Function
|
||||
from trytond import backend
|
||||
from trytond.config import config
|
||||
from trytond.pool import Pool
|
||||
from trytond.tools import grouped_slice, resolve
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.tools import resolve, grouped_slice
|
||||
|
||||
__all__ = ['BaseCache', 'Cache', 'LRUDict', 'LRUDictTransaction']
|
||||
_clear_timeout = config.getint('cache', 'clean_timeout', default=5 * 60)
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
import argparse
|
||||
import csv
|
||||
import os
|
||||
import logging
|
||||
import logging.config
|
||||
import logging.handlers
|
||||
import os
|
||||
from contextlib import contextmanager
|
||||
from io import StringIO
|
||||
|
||||
|
||||
+2
-1
@@ -1,11 +1,12 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
import __main__ as main
|
||||
import configparser
|
||||
import logging
|
||||
import os
|
||||
import urllib.parse
|
||||
|
||||
import __main__ as main
|
||||
|
||||
from . import status
|
||||
|
||||
__all__ = ['config', 'get_hostname', 'get_port', 'split_netloc',
|
||||
|
||||
+3
-4
@@ -1,16 +1,15 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
import time
|
||||
import datetime
|
||||
from xml import sax
|
||||
import logging
|
||||
import re
|
||||
|
||||
import time
|
||||
from collections import defaultdict
|
||||
from decimal import Decimal
|
||||
from xml import sax
|
||||
|
||||
from trytond import __version__
|
||||
from trytond.pyson import PYSONEncoder, CONTEXT
|
||||
from trytond.pyson import CONTEXT, PYSONEncoder
|
||||
from trytond.tools import grouped_slice
|
||||
from trytond.transaction import Transaction
|
||||
|
||||
|
||||
+1
-1
@@ -1,8 +1,8 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
import logging
|
||||
import threading
|
||||
import time
|
||||
import logging
|
||||
|
||||
from trytond.pool import Pool
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
import os
|
||||
import hashlib
|
||||
import os
|
||||
|
||||
from trytond.config import config
|
||||
from trytond.tools import resolve
|
||||
|
||||
+1
-1
@@ -1,8 +1,8 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
from trytond.pool import Pool
|
||||
from trytond.tools.string_ import LazyString
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.pool import Pool
|
||||
|
||||
|
||||
def gettext(message_id, *args, **variables):
|
||||
|
||||
+5
-24
@@ -1,30 +1,11 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
from trytond.pool import Pool
|
||||
from . import configuration
|
||||
from . import translation
|
||||
from . import sequence
|
||||
from . import ui
|
||||
from . import action
|
||||
from . import model
|
||||
from . import attachment
|
||||
from . import note
|
||||
from . import avatar
|
||||
from . import cron
|
||||
from . import lang
|
||||
from . import export
|
||||
from . import rule
|
||||
from . import module
|
||||
from . import cache
|
||||
from . import date
|
||||
from . import trigger
|
||||
from . import session
|
||||
from . import queue
|
||||
from . import calendar_
|
||||
from . import message
|
||||
from . import email_
|
||||
from . import routes
|
||||
from . import error
|
||||
|
||||
from . import (
|
||||
action, attachment, avatar, cache, calendar_, configuration, cron, date,
|
||||
email_, error, export, lang, message, model, module, note, queue, routes,
|
||||
rule, sequence, session, translation, trigger, ui)
|
||||
|
||||
__all__ = ['register', 'routes']
|
||||
|
||||
|
||||
@@ -1,23 +1,22 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
import os
|
||||
from operator import itemgetter
|
||||
from collections import defaultdict
|
||||
from functools import partial
|
||||
from operator import itemgetter
|
||||
|
||||
from sql import Null
|
||||
from genshi.template.text import TextTemplate
|
||||
from sql import Null
|
||||
|
||||
from trytond.cache import Cache, MemoryCache
|
||||
from trytond.config import config
|
||||
from trytond.i18n import gettext
|
||||
from trytond.model import (
|
||||
ModelView, ModelStorage, ModelSQL, DeactivableMixin, fields,
|
||||
sequence_ordered, ModelSingleton)
|
||||
DeactivableMixin, ModelSingleton, ModelSQL, ModelStorage, ModelView,
|
||||
fields, sequence_ordered)
|
||||
from trytond.model.exceptions import ValidationError
|
||||
from trytond.pool import Pool
|
||||
from trytond.pyson import PYSONDecoder, PYSON, Eval
|
||||
from trytond.pyson import PYSONEncoder
|
||||
from trytond.pyson import PYSON, Eval, PYSONDecoder, PYSONEncoder
|
||||
from trytond.rpc import RPC
|
||||
from trytond.tools import file_open
|
||||
from trytond.transaction import Transaction
|
||||
|
||||
@@ -5,11 +5,12 @@ from sql.operators import Concat
|
||||
|
||||
from trytond.config import config
|
||||
from trytond.i18n import lazy_gettext
|
||||
from trytond.model import ModelView, ModelSQL, fields
|
||||
from trytond.model import ModelSQL, ModelView, fields
|
||||
from trytond.pool import Pool
|
||||
from trytond.pyson import Eval
|
||||
from trytond.tools import firstline
|
||||
from trytond.transaction import Transaction
|
||||
|
||||
from .resource import ResourceMixin, resource_copy
|
||||
|
||||
__all__ = ['AttachmentCopyMixin']
|
||||
|
||||
@@ -5,7 +5,7 @@ import math
|
||||
import os
|
||||
import uuid
|
||||
from random import Random
|
||||
from urllib.parse import urljoin, quote
|
||||
from urllib.parse import quote, urljoin
|
||||
|
||||
try:
|
||||
import PIL
|
||||
@@ -14,7 +14,7 @@ except ImportError:
|
||||
PIL = None
|
||||
|
||||
from trytond.config import config
|
||||
from trytond.model import ModelSQL, fields, Unique
|
||||
from trytond.model import ModelSQL, Unique, fields
|
||||
from trytond.pool import Pool
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.wsgi import Base64Converter
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
|
||||
from trytond.cache import Cache
|
||||
from trytond.model import ModelSQL, fields, Unique
|
||||
from trytond.model import ModelSQL, Unique, fields
|
||||
from trytond.rpc import RPC
|
||||
from trytond.transaction import Transaction
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
from trytond.cache import Cache
|
||||
from trytond.config import config
|
||||
from trytond.model import ModelSQL, ModelSingleton, fields
|
||||
from trytond.model import ModelSingleton, ModelSQL, fields
|
||||
|
||||
|
||||
class Configuration(ModelSingleton, ModelSQL):
|
||||
|
||||
+4
-3
@@ -1,15 +1,16 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
import datetime
|
||||
import time
|
||||
from dateutil.relativedelta import relativedelta
|
||||
import logging
|
||||
import time
|
||||
|
||||
from dateutil.relativedelta import relativedelta
|
||||
|
||||
from trytond import backend
|
||||
from trytond.config import config
|
||||
from trytond.exceptions import UserError, UserWarning
|
||||
from trytond.model import (
|
||||
ModelView, ModelSQL, DeactivableMixin, fields, dualmethod)
|
||||
DeactivableMixin, ModelSQL, ModelView, dualmethod, fields)
|
||||
from trytond.pool import Pool
|
||||
from trytond.pyson import Eval
|
||||
from trytond.status import processing
|
||||
|
||||
@@ -17,18 +17,18 @@ except ImportError:
|
||||
html2text = None
|
||||
from genshi.template import TextTemplate
|
||||
|
||||
from trytond.i18n import gettext
|
||||
from trytond.config import config
|
||||
from trytond.model import ModelSQL, ModelView, fields, EvalEnvironment
|
||||
from trytond.model.exceptions import ValidationError, AccessError
|
||||
from trytond.i18n import gettext
|
||||
from trytond.model import EvalEnvironment, ModelSQL, ModelView, fields
|
||||
from trytond.model.exceptions import AccessError, ValidationError
|
||||
from trytond.pool import Pool
|
||||
from trytond.pyson import Eval, Bool, PYSONDecoder
|
||||
from trytond.pyson import Bool, Eval, PYSONDecoder
|
||||
from trytond.report import Report
|
||||
from trytond.rpc import RPC
|
||||
from trytond.sendmail import sendmail_transactional, SMTPDataManager
|
||||
from trytond.sendmail import SMTPDataManager, sendmail_transactional
|
||||
from trytond.tools import escape_wildcard
|
||||
from trytond.tools.string_ import StringMatcher
|
||||
from trytond.tools.email_ import set_from_header
|
||||
from trytond.tools.string_ import StringMatcher
|
||||
from trytond.transaction import Transaction
|
||||
|
||||
from .resource import ResourceAccessMixin
|
||||
|
||||
+2
-2
@@ -7,10 +7,10 @@ import logging
|
||||
from trytond.config import config
|
||||
from trytond.exceptions import UserError, UserWarning
|
||||
from trytond.model import ModelSQL, ModelView, Workflow, fields
|
||||
from trytond.tools import firstline
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.pool import Pool
|
||||
from trytond.pyson import Eval
|
||||
from trytond.tools import firstline
|
||||
from trytond.transaction import Transaction
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
clean_days = config.getint('error', 'clean_days', default=90)
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
|
||||
from .lang import (
|
||||
GroupingError as LanguageGroupingError,
|
||||
DateError as LanguageDateError,
|
||||
TranslatableError as LanguageTranslatableError,
|
||||
DeleteDefaultError as LanguageDeleteDefaultError)
|
||||
from .lang import DateError as LanguageDateError
|
||||
from .lang import DeleteDefaultError as LanguageDeleteDefaultError
|
||||
from .lang import GroupingError as LanguageGroupingError
|
||||
from .lang import TranslatableError as LanguageTranslatableError
|
||||
from .module import DeactivateDependencyError
|
||||
from .sequence import (
|
||||
AffixError as SequenceAffixError,
|
||||
MissingError as SequenceMissingError)
|
||||
from .sequence import AffixError as SequenceAffixError
|
||||
from .sequence import MissingError as SequenceMissingError
|
||||
from .translation import OverriddenError as TranslationOverriddenError
|
||||
from .trigger import ConditionError as TriggerConditionError
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
"Exports"
|
||||
from trytond.model import ModelView, ModelSQL, fields
|
||||
from trytond.model import ModelSQL, ModelView, fields
|
||||
from trytond.pool import Pool
|
||||
from trytond.rpc import RPC
|
||||
|
||||
|
||||
+4
-4
@@ -2,22 +2,22 @@
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
|
||||
import datetime
|
||||
from locale import CHAR_MAX
|
||||
from ast import literal_eval
|
||||
|
||||
from decimal import Decimal
|
||||
from locale import CHAR_MAX
|
||||
|
||||
from sql import Table
|
||||
|
||||
from trytond.cache import Cache
|
||||
from trytond.exceptions import UserError
|
||||
from trytond.i18n import gettext
|
||||
from trytond.model import (
|
||||
ModelView, ModelSQL, DeactivableMixin, fields, Check, Unique)
|
||||
Check, DeactivableMixin, ModelSQL, ModelView, Unique, fields)
|
||||
from trytond.modules import create_graph, load_translations
|
||||
from trytond.pool import Pool
|
||||
from trytond.pyson import Eval
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.wizard import Wizard, StateView, Button, StateTransition
|
||||
from trytond.wizard import Button, StateTransition, StateView, Wizard
|
||||
|
||||
Transaction.cache_keys.add('translate_name')
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
|
||||
from trytond.model import ModelView, ModelSQL, fields
|
||||
from trytond.cache import Cache
|
||||
from trytond.model import ModelSQL, ModelView, fields
|
||||
from trytond.pool import Pool
|
||||
from trytond.transaction import Transaction
|
||||
|
||||
|
||||
+9
-9
@@ -4,28 +4,28 @@ import heapq
|
||||
import json
|
||||
import logging
|
||||
import re
|
||||
|
||||
from sql import Null, Literal
|
||||
from sql.aggregate import Max
|
||||
from sql.conditionals import Case
|
||||
from collections import defaultdict
|
||||
from itertools import groupby
|
||||
|
||||
from sql import Literal, Null
|
||||
from sql.aggregate import Max
|
||||
from sql.conditionals import Case
|
||||
|
||||
from trytond.cache import Cache
|
||||
from trytond.i18n import gettext
|
||||
from trytond.model import (
|
||||
ModelView, ModelSQL, Workflow, DeactivableMixin, fields, Unique,
|
||||
EvalEnvironment)
|
||||
DeactivableMixin, EvalEnvironment, ModelSQL, ModelView, Unique, Workflow,
|
||||
fields)
|
||||
from trytond.model.exceptions import AccessError, ValidationError
|
||||
from trytond.pool import Pool
|
||||
from trytond.protocols.jsonrpc import JSONDecoder, JSONEncoder
|
||||
from trytond.pyson import Bool, Eval, PYSONDecoder
|
||||
from trytond.report import Report
|
||||
from trytond.rpc import RPC
|
||||
from trytond.tools import is_instance_method, cursor_dict, grouped_slice
|
||||
from trytond.tools import cursor_dict, grouped_slice, is_instance_method
|
||||
from trytond.tools.string_ import StringMatcher
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.wizard import Wizard, StateView, StateAction, Button
|
||||
from trytond.wizard import Button, StateAction, StateView, Wizard
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -1295,8 +1295,8 @@ class ModelData(ModelSQL, ModelView):
|
||||
return dict(json.loads(values, object_hook=JSONDecoder()))
|
||||
except ValueError:
|
||||
# Migration from 3.2
|
||||
from decimal import Decimal
|
||||
import datetime
|
||||
from decimal import Decimal
|
||||
return eval(values, {
|
||||
'Decimal': Decimal,
|
||||
'datetime': datetime,
|
||||
|
||||
@@ -5,19 +5,19 @@ from functools import wraps
|
||||
|
||||
from sql.operators import NotIn
|
||||
|
||||
from trytond import backend
|
||||
from trytond.cache import Cache
|
||||
from trytond.exceptions import UserError
|
||||
from trytond.i18n import gettext
|
||||
from trytond.model import ModelView, ModelSQL, fields, Unique, sequence_ordered
|
||||
from trytond.model import ModelSQL, ModelView, Unique, fields, sequence_ordered
|
||||
from trytond.model.exceptions import AccessError
|
||||
from trytond.modules import get_module_list, get_module_info
|
||||
from trytond.wizard import Wizard, StateView, Button, StateTransition, \
|
||||
StateAction
|
||||
from trytond import backend
|
||||
from trytond.modules import get_module_info, get_module_list
|
||||
from trytond.pool import Pool
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.pyson import Eval
|
||||
from trytond.rpc import RPC
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.wizard import (
|
||||
Button, StateAction, StateTransition, StateView, Wizard)
|
||||
|
||||
|
||||
class DeactivateDependencyError(UserError):
|
||||
|
||||
+2
-1
@@ -6,11 +6,12 @@ from sql import Null
|
||||
from sql.conditionals import Case
|
||||
|
||||
from trytond.i18n import lazy_gettext
|
||||
from trytond.model import ModelView, ModelSQL, ModelStorage, fields
|
||||
from trytond.model import ModelSQL, ModelStorage, ModelView, fields
|
||||
from trytond.pool import Pool
|
||||
from trytond.pyson import Eval
|
||||
from trytond.tools import grouped_slice, reduce_ids
|
||||
from trytond.transaction import Transaction
|
||||
|
||||
from .resource import ResourceMixin, resource_copy
|
||||
|
||||
__all__ = ['NoteCopyMixin']
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
import datetime
|
||||
|
||||
from sql import With, Literal, Null
|
||||
from sql import Literal, Null, With
|
||||
from sql.aggregate import Min
|
||||
from sql.functions import CurrentTimestamp, Extract
|
||||
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
import csv
|
||||
import datetime as dt
|
||||
import json
|
||||
import io
|
||||
import json
|
||||
from numbers import Number
|
||||
|
||||
try:
|
||||
from http import HTTPStatus
|
||||
except ImportError:
|
||||
@@ -14,13 +15,13 @@ from werkzeug.exceptions import abort
|
||||
from werkzeug.utils import redirect
|
||||
from werkzeug.wrappers import Response
|
||||
|
||||
from trytond.i18n import gettext
|
||||
from trytond.config import config
|
||||
from trytond.wsgi import app
|
||||
from trytond.i18n import gettext
|
||||
from trytond.protocols.jsonrpc import JSONDecoder
|
||||
from trytond.protocols.wrappers import with_pool, with_transaction
|
||||
from trytond.tools import slugify
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.wsgi import app
|
||||
|
||||
SOURCE = config.get(
|
||||
'html', 'src', default='https://cloud.tinymce.com/stable/tinymce.min.js')
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ from sql import Literal
|
||||
|
||||
from trytond.cache import Cache
|
||||
from trytond.i18n import gettext
|
||||
from trytond.model import ModelView, ModelSQL, fields, EvalEnvironment, Check
|
||||
from trytond.model import Check, EvalEnvironment, ModelSQL, ModelView, fields
|
||||
from trytond.model.exceptions import ValidationError
|
||||
from trytond.pool import Pool
|
||||
from trytond.pyson import PYSONDecoder
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
from string import Template
|
||||
import time
|
||||
from string import Template
|
||||
|
||||
from sql import Literal, For
|
||||
from sql import For, Literal
|
||||
|
||||
from trytond import backend
|
||||
from trytond.exceptions import UserError
|
||||
from trytond.i18n import gettext
|
||||
from trytond.model import ModelView, ModelSQL, DeactivableMixin, fields, Check
|
||||
from trytond.model.exceptions import ValidationError, AccessError
|
||||
from trytond.model import Check, DeactivableMixin, ModelSQL, ModelView, fields
|
||||
from trytond.model.exceptions import AccessError, ValidationError
|
||||
from trytond.pool import Pool
|
||||
from trytond.pyson import Eval, And
|
||||
from trytond.pyson import And, Eval
|
||||
from trytond.transaction import Transaction
|
||||
|
||||
sql_sequence = backend.Database.has_sequence()
|
||||
|
||||
@@ -4,6 +4,7 @@ import binascii
|
||||
import datetime
|
||||
import json
|
||||
import os
|
||||
|
||||
try:
|
||||
from secrets import token_hex
|
||||
except ImportError:
|
||||
@@ -12,8 +13,8 @@ except ImportError:
|
||||
nbytes = 32
|
||||
return binascii.hexlify(os.urandom(nbytes)).decode('ascii')
|
||||
|
||||
from trytond.model import ModelSQL, fields
|
||||
from trytond.config import config
|
||||
from trytond.model import ModelSQL, fields
|
||||
|
||||
|
||||
class Session(ModelSQL):
|
||||
|
||||
+10
-11
@@ -2,33 +2,32 @@
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
import os
|
||||
import xml.dom.minidom
|
||||
from difflib import SequenceMatcher
|
||||
from collections import defaultdict
|
||||
from difflib import SequenceMatcher
|
||||
from io import BytesIO
|
||||
from lxml import etree
|
||||
|
||||
import polib
|
||||
from sql import Column, Null, Literal
|
||||
from sql.functions import Substring, Position
|
||||
from sql.conditionals import Case
|
||||
from sql.aggregate import Max
|
||||
|
||||
from genshi.filters.i18n import extract as genshi_extract
|
||||
from lxml import etree
|
||||
from relatorio.reporting import MIMETemplateLoader
|
||||
from relatorio.templates.opendocument import get_zip_file
|
||||
from sql import Column, Literal, Null
|
||||
from sql.aggregate import Max
|
||||
from sql.conditionals import Case
|
||||
from sql.functions import Position, Substring
|
||||
|
||||
from trytond.cache import Cache
|
||||
from trytond.config import config
|
||||
from trytond.exceptions import UserError
|
||||
from trytond.i18n import gettext
|
||||
from trytond.model import ModelView, ModelSQL, fields
|
||||
from trytond.model import ModelSQL, ModelView, fields
|
||||
from trytond.pool import Pool
|
||||
from trytond.pyson import PYSONEncoder, Eval
|
||||
from trytond.tools import file_open, grouped_slice, cursor_dict
|
||||
from trytond.pyson import Eval, PYSONEncoder
|
||||
from trytond.tools import cursor_dict, file_open, grouped_slice
|
||||
from trytond.tools.string_ import LazyString, StringPartitioned
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.wizard import (
|
||||
Wizard, StateView, StateTransition, StateAction, Button)
|
||||
Button, StateAction, StateTransition, StateView, Wizard)
|
||||
|
||||
from .lang import get_parent_language as get_parent
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
import datetime
|
||||
import time
|
||||
|
||||
from sql import Literal, Null, Select
|
||||
from sql.aggregate import Count, Max
|
||||
from sql.functions import CurrentTimestamp
|
||||
@@ -10,12 +11,11 @@ from sql.operators import Concat
|
||||
from trytond.cache import Cache
|
||||
from trytond.i18n import gettext
|
||||
from trytond.model import (
|
||||
ModelView, ModelSQL, DeactivableMixin, fields, EvalEnvironment, Check)
|
||||
Check, DeactivableMixin, EvalEnvironment, ModelSQL, ModelView, fields)
|
||||
from trytond.model.exceptions import ValidationError
|
||||
from trytond.pool import Pool
|
||||
from trytond.pyson import Eval, PYSONDecoder
|
||||
from trytond.tools import grouped_slice
|
||||
from trytond.tools import reduce_ids
|
||||
from trytond.tools import grouped_slice, reduce_ids
|
||||
from trytond.transaction import Transaction
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
from . import menu
|
||||
from . import view
|
||||
from . import icon
|
||||
from . import icon, menu, view
|
||||
|
||||
__all__ = ['menu', 'view', 'icon']
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
|
||||
import os
|
||||
|
||||
from trytond.model import ModelView, ModelSQL, fields, sequence_ordered
|
||||
from trytond.model import ModelSQL, ModelView, fields, sequence_ordered
|
||||
from trytond.rpc import RPC
|
||||
from trytond.tools import file_open
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.rpc import RPC
|
||||
|
||||
|
||||
class Icon(sequence_ordered(), ModelSQL, ModelView):
|
||||
|
||||
@@ -4,11 +4,11 @@ from collections import defaultdict
|
||||
from itertools import groupby
|
||||
|
||||
from trytond.model import (
|
||||
ModelView, ModelSQL, DeactivableMixin, fields, sequence_ordered, tree)
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.tools import grouped_slice
|
||||
DeactivableMixin, ModelSQL, ModelView, fields, sequence_ordered, tree)
|
||||
from trytond.pool import Pool
|
||||
from trytond.rpc import RPC
|
||||
from trytond.tools import grouped_slice
|
||||
from trytond.transaction import Transaction
|
||||
|
||||
|
||||
def one_in(i, j):
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
import os
|
||||
import json
|
||||
import os
|
||||
|
||||
from lxml import etree
|
||||
|
||||
from trytond.cache import Cache
|
||||
from trytond.i18n import gettext
|
||||
from trytond.model import ModelView, ModelSQL, fields
|
||||
from trytond.model import ModelSQL, ModelView, fields
|
||||
from trytond.model.exceptions import ValidationError
|
||||
from trytond.pyson import Eval, Bool, PYSONDecoder, If
|
||||
from trytond.pool import Pool
|
||||
from trytond.pyson import Bool, Eval, If, PYSONDecoder
|
||||
from trytond.rpc import RPC
|
||||
from trytond.tools import file_open
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.wizard import Wizard, StateView, Button
|
||||
from trytond.pool import Pool
|
||||
from trytond.cache import Cache
|
||||
from trytond.rpc import RPC
|
||||
from trytond.wizard import Button, StateView, Wizard
|
||||
|
||||
|
||||
class XMLError(ValidationError):
|
||||
|
||||
+15
-15
@@ -1,22 +1,22 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
from .model import Model
|
||||
from .modelview import ModelView
|
||||
from .modelstorage import ModelStorage, EvalEnvironment
|
||||
from .modelsingleton import ModelSingleton
|
||||
from .modelsql import ModelSQL, Check, Unique, Exclude
|
||||
from .workflow import Workflow
|
||||
from .dictschema import DictSchemaMixin
|
||||
from .match import MatchMixin
|
||||
from .union import UnionMixin
|
||||
from .symbol import SymbolMixin
|
||||
from .digits import DigitsMixin
|
||||
from .multivalue import MultiValueMixin, ValueMixin
|
||||
from .descriptors import dualmethod
|
||||
from .order import sequence_ordered
|
||||
from .active import DeactivableMixin
|
||||
from .tree import tree
|
||||
from .avatar import avatar_mixin
|
||||
from .descriptors import dualmethod
|
||||
from .dictschema import DictSchemaMixin
|
||||
from .digits import DigitsMixin
|
||||
from .match import MatchMixin
|
||||
from .model import Model
|
||||
from .modelsingleton import ModelSingleton
|
||||
from .modelsql import Check, Exclude, ModelSQL, Unique
|
||||
from .modelstorage import EvalEnvironment, ModelStorage
|
||||
from .modelview import ModelView
|
||||
from .multivalue import MultiValueMixin, ValueMixin
|
||||
from .order import sequence_ordered
|
||||
from .symbol import SymbolMixin
|
||||
from .tree import tree
|
||||
from .union import UnionMixin
|
||||
from .workflow import Workflow
|
||||
|
||||
__all__ = ['Model', 'ModelView', 'ModelStorage', 'ModelSingleton', 'ModelSQL',
|
||||
'Check', 'Unique', 'Exclude',
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the toplevel of this
|
||||
# repository contains the full copyright notices and license terms.
|
||||
from trytond.i18n import lazy_gettext
|
||||
from trytond.model import Model, ModelView, fields
|
||||
from trytond.pyson import Eval
|
||||
|
||||
from . import fields
|
||||
from .model import Model
|
||||
from .modelview import ModelView
|
||||
|
||||
|
||||
class DeactivableMixin(Model):
|
||||
"Mixin to allow to soft deletion of records"
|
||||
|
||||
@@ -55,7 +55,7 @@ def avatar_mixin(size=64, default=None):
|
||||
|
||||
@classmethod
|
||||
def generate_avatar(cls, records, field='rec_name'):
|
||||
from trytond.ir.avatar import generate, PIL
|
||||
from trytond.ir.avatar import PIL, generate
|
||||
if not PIL:
|
||||
return
|
||||
records = [r for r in records if not r.has_avatar]
|
||||
|
||||
@@ -8,11 +8,11 @@ from trytond.config import config
|
||||
from trytond.i18n import gettext, lazy_gettext
|
||||
from trytond.model import fields
|
||||
from trytond.model.exceptions import ValidationError
|
||||
from trytond.pool import Pool
|
||||
from trytond.pyson import Eval, PYSONDecoder
|
||||
from trytond.rpc import RPC
|
||||
from trytond.tools import slugify
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.pool import Pool
|
||||
|
||||
|
||||
class DomainError(ValidationError):
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
|
||||
from .modelstorage import (AccessError, ImportDataError, ValidationError,
|
||||
DomainValidationError, RequiredValidationError, SizeValidationError,
|
||||
DigitsValidationError, ForbiddenCharValidationError,
|
||||
SelectionValidationError, TimeFormatValidationError)
|
||||
from .modelsql import ForeignKeyError, SQLConstraintError
|
||||
from .modelstorage import (
|
||||
AccessError, DigitsValidationError, DomainValidationError,
|
||||
ForbiddenCharValidationError, ImportDataError, RequiredValidationError,
|
||||
SelectionValidationError, SizeValidationError, TimeFormatValidationError,
|
||||
ValidationError)
|
||||
from .modelview import AccessButtonError
|
||||
from .tree import RecursionError
|
||||
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
|
||||
from .field import (
|
||||
depends, with_inactive_records, SQL_OPERATORS, on_change_result,
|
||||
get_eval_fields, states_validate, domain_validate, context_validate, Field)
|
||||
from .boolean import Boolean
|
||||
from .integer import Integer, BigInteger
|
||||
from .char import Char
|
||||
from .text import Text, FullText
|
||||
from .float import Float
|
||||
from .numeric import Numeric
|
||||
from .date import Date, Timestamp, DateTime, Time, TimeDelta
|
||||
from .binary import Binary
|
||||
from .selection import Selection
|
||||
from .reference import Reference
|
||||
from .many2one import Many2One
|
||||
from .one2many import One2Many
|
||||
from .many2many import Many2Many
|
||||
from .function import Function, MultiValue
|
||||
from .one2one import One2One
|
||||
from .boolean import Boolean
|
||||
from .char import Char
|
||||
from .date import Date, DateTime, Time, TimeDelta, Timestamp
|
||||
from .dict import Dict
|
||||
from .field import (
|
||||
SQL_OPERATORS, Field, context_validate, depends, domain_validate,
|
||||
get_eval_fields, on_change_result, states_validate, with_inactive_records)
|
||||
from .float import Float
|
||||
from .function import Function, MultiValue
|
||||
from .integer import BigInteger, Integer
|
||||
from .many2many import Many2Many
|
||||
from .many2one import Many2One
|
||||
from .multiselection import MultiSelection
|
||||
from .numeric import Numeric
|
||||
from .one2many import One2Many
|
||||
from .one2one import One2One
|
||||
from .reference import Reference
|
||||
from .selection import Selection
|
||||
from .text import FullText, Text
|
||||
|
||||
__all__ = [
|
||||
depends, with_inactive_records, SQL_OPERATORS, on_change_result,
|
||||
|
||||
@@ -5,6 +5,7 @@ from sql import Column, Null
|
||||
from trytond.filestore import filestore
|
||||
from trytond.tools import grouped_slice, reduce_ids
|
||||
from trytond.transaction import Transaction
|
||||
|
||||
from .field import Field
|
||||
|
||||
|
||||
|
||||
@@ -6,8 +6,9 @@ from sql.conditionals import Coalesce, NullIf
|
||||
from sql.operators import Not
|
||||
|
||||
from trytond.rpc import RPC
|
||||
from trytond.tools import unescape_wildcard, is_full_text
|
||||
from trytond.tools import is_full_text, unescape_wildcard
|
||||
from trytond.transaction import Transaction
|
||||
|
||||
from .field import Field, FieldTranslate, size_validate
|
||||
|
||||
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
import datetime
|
||||
|
||||
from sql.functions import Function, AtTimeZone
|
||||
from sql.functions import AtTimeZone, Function
|
||||
|
||||
from trytond import backend
|
||||
from trytond.pyson import PYSONEncoder
|
||||
|
||||
from .field import Field
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the toplevel of this
|
||||
# repository contains the full copyright notices and license terms.
|
||||
from functools import partial
|
||||
import json
|
||||
from functools import partial
|
||||
|
||||
from sql import operators, Literal, Select, CombiningQuery, Cast, Null
|
||||
from sql import Cast, CombiningQuery, Literal, Null, Select, operators
|
||||
|
||||
from trytond import backend
|
||||
from trytond.pool import Pool
|
||||
@@ -11,7 +11,8 @@ from trytond.protocols.jsonrpc import JSONDecoder, JSONEncoder
|
||||
from trytond.tools import grouped_slice
|
||||
from trytond.tools.immutabledict import ImmutableDict
|
||||
from trytond.transaction import Transaction
|
||||
from .field import Field, SQL_OPERATORS
|
||||
|
||||
from .field import SQL_OPERATORS, Field
|
||||
|
||||
# Use canonical form
|
||||
dumps = partial(
|
||||
|
||||
@@ -4,8 +4,9 @@ import warnings
|
||||
from functools import wraps
|
||||
|
||||
import sql
|
||||
from sql import (operators, Column, Literal, Select, CombiningQuery, Null,
|
||||
Query, Expression, Cast)
|
||||
from sql import (
|
||||
Cast, Column, CombiningQuery, Expression, Literal, Null, Query, Select,
|
||||
operators)
|
||||
from sql.aggregate import Min
|
||||
from sql.conditionals import Coalesce, NullIf
|
||||
from sql.operators import Concat
|
||||
@@ -13,9 +14,9 @@ from sql.operators import Concat
|
||||
from trytond import backend
|
||||
from trytond.const import OPERATORS
|
||||
from trytond.pool import Pool
|
||||
from trytond.pyson import PYSON, PYSONEncoder, PYSONDecoder, Eval
|
||||
from trytond.pyson import PYSON, Eval, PYSONDecoder, PYSONEncoder
|
||||
from trytond.rpc import RPC
|
||||
from trytond.tools.string_ import StringPartitioned, LazyString
|
||||
from trytond.tools.string_ import LazyString, StringPartitioned
|
||||
from trytond.transaction import Transaction
|
||||
|
||||
_sql_version = tuple(map(int, sql.__version__.split('.')))
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
from trytond.pyson import PYSONEncoder, PYSON
|
||||
from trytond.pyson import PYSON, PYSONEncoder
|
||||
|
||||
from .field import Field
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
|
||||
import inspect
|
||||
import copy
|
||||
import inspect
|
||||
from functools import wraps
|
||||
|
||||
from trytond.i18n import gettext
|
||||
|
||||
@@ -4,15 +4,17 @@ from collections import defaultdict
|
||||
from itertools import chain
|
||||
|
||||
from sql import Cast, Literal, Null
|
||||
from sql.functions import Substring, Position
|
||||
from sql.conditionals import Coalesce
|
||||
from sql.functions import Position, Substring
|
||||
|
||||
from trytond.pool import Pool
|
||||
from trytond.pyson import PYSONEncoder
|
||||
from trytond.tools import grouped_slice
|
||||
from trytond.transaction import Transaction
|
||||
from .field import (Field, size_validate, instanciate_values, domain_validate,
|
||||
search_order_validate, context_validate, instantiate_context)
|
||||
|
||||
from .field import (
|
||||
Field, context_validate, domain_validate, instanciate_values,
|
||||
instantiate_context, search_order_validate, size_validate)
|
||||
from .function import Function
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
from sql import Literal, Column, With, Query, Expression
|
||||
from sql import Column, Expression, Literal, Query, With
|
||||
from sql.aggregate import Max
|
||||
from sql.conditionals import Coalesce
|
||||
from sql.operators import Or
|
||||
@@ -9,8 +9,10 @@ from trytond.pool import Pool
|
||||
from trytond.pyson import PYSONEncoder
|
||||
from trytond.tools import reduce_ids
|
||||
from trytond.transaction import Transaction
|
||||
from .field import (Field, search_order_validate, context_validate,
|
||||
with_inactive_records, instantiate_context)
|
||||
|
||||
from .field import (
|
||||
Field, context_validate, instantiate_context, search_order_validate,
|
||||
with_inactive_records)
|
||||
|
||||
|
||||
class Many2One(Field):
|
||||
|
||||
@@ -3,10 +3,11 @@
|
||||
import json
|
||||
from functools import partial
|
||||
|
||||
from sql import operators, Literal
|
||||
from sql import Literal, operators
|
||||
|
||||
from trytond.rpc import RPC
|
||||
from trytond.transaction import Transaction
|
||||
|
||||
from .field import Field
|
||||
from .selection import SelectionMixin
|
||||
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
from decimal import Decimal
|
||||
from sql import Cast, Literal, Select, CombiningQuery, As
|
||||
|
||||
from sql import As, Cast, CombiningQuery, Literal, Select
|
||||
|
||||
from trytond import backend
|
||||
|
||||
from .float import Float
|
||||
|
||||
|
||||
|
||||
@@ -2,16 +2,19 @@
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
from collections import defaultdict
|
||||
from itertools import chain
|
||||
|
||||
from sql import Cast, Literal
|
||||
from sql.functions import Substring, Position
|
||||
from sql.conditionals import Coalesce
|
||||
from sql.functions import Position, Substring
|
||||
|
||||
from trytond.pool import Pool
|
||||
from trytond.pyson import PYSONEncoder
|
||||
from trytond.tools import grouped_slice
|
||||
from trytond.transaction import Transaction
|
||||
from .field import (Field, size_validate, instanciate_values, domain_validate,
|
||||
search_order_validate, context_validate, instantiate_context)
|
||||
|
||||
from .field import (
|
||||
Field, context_validate, domain_validate, instanciate_values,
|
||||
instantiate_context, search_order_validate, size_validate)
|
||||
from .function import Function
|
||||
|
||||
|
||||
|
||||
@@ -2,16 +2,18 @@
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
import warnings
|
||||
|
||||
from sql import Cast, Literal, Query, Expression
|
||||
from sql.functions import Substring, Position
|
||||
from sql import Cast, Expression, Literal, Query
|
||||
from sql.functions import Position, Substring
|
||||
|
||||
from trytond.pool import Pool
|
||||
from trytond.pyson import PYSONEncoder
|
||||
from trytond.rpc import RPC
|
||||
from trytond.transaction import Transaction
|
||||
|
||||
from .field import (
|
||||
Field, context_validate, instantiate_context, search_order_validate,
|
||||
with_inactive_records)
|
||||
from .selection import SelectionMixin
|
||||
from .field import (Field, search_order_validate, context_validate,
|
||||
with_inactive_records, instantiate_context)
|
||||
|
||||
|
||||
class Reference(SelectionMixin, Field):
|
||||
|
||||
@@ -10,6 +10,7 @@ from trytond.rpc import RPC
|
||||
from trytond.tools import is_instance_method
|
||||
from trytond.tools.string_ import LazyString
|
||||
from trytond.transaction import Transaction
|
||||
|
||||
from .field import Field
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
from sql import Query, Expression, Null, Literal
|
||||
from sql.operators import ILike, Not, In, NotIn
|
||||
from sql import Expression, Literal, Null, Query
|
||||
from sql.operators import ILike, In, Not, NotIn
|
||||
|
||||
from trytond.transaction import Transaction
|
||||
|
||||
from .field import Field, SQL_OPERATORS
|
||||
from .char import Char
|
||||
from .field import SQL_OPERATORS, Field
|
||||
|
||||
|
||||
class Text(Char):
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
|
||||
import copy
|
||||
import collections.abc
|
||||
import copy
|
||||
import sys
|
||||
from collections import defaultdict
|
||||
from functools import total_ordering
|
||||
@@ -11,10 +11,10 @@ from itertools import chain
|
||||
from trytond.i18n import lazy_gettext
|
||||
from trytond.model import fields
|
||||
from trytond.pool import Pool, PoolBase, PoolMeta
|
||||
from trytond.pyson import PYSONEncoder, PYSONDecoder
|
||||
from trytond.pyson import PYSONDecoder, PYSONEncoder
|
||||
from trytond.rpc import RPC
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.url import URLMixin
|
||||
from trytond.rpc import RPC
|
||||
|
||||
__all__ = ['Model']
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
from trytond.model import ModelStorage
|
||||
from trytond.transaction import Transaction
|
||||
|
||||
from .modelstorage import ModelStorage
|
||||
|
||||
|
||||
class ModelSingleton(ModelStorage):
|
||||
"""
|
||||
|
||||
+19
-17
@@ -1,33 +1,35 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
import datetime
|
||||
from itertools import islice, chain, product, groupby, repeat
|
||||
from collections import OrderedDict, defaultdict
|
||||
from functools import wraps
|
||||
from itertools import chain, groupby, islice, product, repeat
|
||||
|
||||
from sql import (Table, Column, Literal, Desc, Asc, Expression, Null,
|
||||
NullsFirst, NullsLast, For, Union, With)
|
||||
from sql.functions import CurrentTimestamp, Extract, Substring
|
||||
from sql.conditionals import Coalesce
|
||||
from sql.operators import Or, And, Operator, Equal, Concat
|
||||
from sql import (
|
||||
Asc, Column, Desc, Expression, For, Literal, Null, NullsFirst, NullsLast,
|
||||
Table, Union, With)
|
||||
from sql.aggregate import Count, Max
|
||||
from sql.conditionals import Coalesce
|
||||
from sql.functions import CurrentTimestamp, Extract, Substring
|
||||
from sql.operators import And, Concat, Equal, Operator, Or
|
||||
|
||||
from trytond.i18n import gettext
|
||||
from trytond.model import ModelStorage, ModelView
|
||||
from trytond.model import fields
|
||||
from trytond import backend
|
||||
from trytond.tools import reduce_ids, grouped_slice, cursor_dict
|
||||
from trytond.transaction import Transaction, record_cache_size
|
||||
from trytond.pool import Pool
|
||||
from trytond.pyson import PYSONEncoder, PYSONDecoder
|
||||
from trytond.cache import freeze
|
||||
from trytond.exceptions import ConcurrencyException
|
||||
from trytond.rpc import RPC
|
||||
from trytond.config import config
|
||||
from trytond.exceptions import ConcurrencyException
|
||||
from trytond.i18n import gettext
|
||||
from trytond.pool import Pool
|
||||
from trytond.pyson import PYSONDecoder, PYSONEncoder
|
||||
from trytond.rpc import RPC
|
||||
from trytond.tools import cursor_dict, grouped_slice, reduce_ids
|
||||
from trytond.transaction import Transaction, record_cache_size
|
||||
|
||||
from .modelstorage import (is_leaf,
|
||||
ValidationError, RequiredValidationError, AccessError)
|
||||
from . import fields
|
||||
from .descriptors import dualmethod
|
||||
from .modelstorage import (
|
||||
AccessError, ModelStorage, RequiredValidationError, ValidationError,
|
||||
is_leaf)
|
||||
from .modelview import ModelView
|
||||
|
||||
|
||||
class ForeignKeyError(ValidationError):
|
||||
|
||||
@@ -2,32 +2,32 @@
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
|
||||
import base64
|
||||
import datetime
|
||||
import time
|
||||
import csv
|
||||
import datetime
|
||||
import random
|
||||
|
||||
from decimal import Decimal
|
||||
from itertools import islice, chain
|
||||
from functools import lru_cache, wraps
|
||||
from operator import itemgetter
|
||||
import time
|
||||
from collections import defaultdict
|
||||
from decimal import Decimal
|
||||
from functools import lru_cache, wraps
|
||||
from itertools import chain, islice
|
||||
from operator import itemgetter
|
||||
|
||||
from trytond.exceptions import UserError
|
||||
from trytond.model import Model
|
||||
from trytond.model import fields
|
||||
from trytond.tools import reduce_domain, is_instance_method, grouped_slice
|
||||
from trytond.tools.domain_inversion import (
|
||||
domain_inversion, eval_domain, parse as domain_parse)
|
||||
from trytond.pyson import PYSONEncoder, PYSONDecoder, PYSON
|
||||
from trytond.const import OPERATORS
|
||||
from trytond.config import config
|
||||
from trytond.i18n import gettext, lazy_gettext
|
||||
from trytond.transaction import Transaction, record_cache_size
|
||||
from trytond.pool import Pool
|
||||
from trytond.cache import Cache, LRUDictTransaction, freeze, unfreeze
|
||||
from trytond.config import config
|
||||
from trytond.const import OPERATORS
|
||||
from trytond.exceptions import UserError
|
||||
from trytond.i18n import gettext, lazy_gettext
|
||||
from trytond.pool import Pool
|
||||
from trytond.pyson import PYSON, PYSONDecoder, PYSONEncoder
|
||||
from trytond.rpc import RPC
|
||||
from trytond.tools import grouped_slice, is_instance_method, reduce_domain
|
||||
from trytond.tools.domain_inversion import domain_inversion, eval_domain
|
||||
from trytond.tools.domain_inversion import parse as domain_parse
|
||||
from trytond.transaction import Transaction, record_cache_size
|
||||
|
||||
from . import fields
|
||||
from .descriptors import dualmethod
|
||||
from .model import Model
|
||||
|
||||
__all__ = ['ModelStorage', 'EvalEnvironment']
|
||||
_cache_field = config.getint('cache', 'field')
|
||||
|
||||
@@ -1,20 +1,22 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
from lxml import etree
|
||||
from functools import wraps
|
||||
import collections
|
||||
from functools import wraps
|
||||
|
||||
from lxml import etree
|
||||
|
||||
from trytond.cache import Cache
|
||||
from trytond.exceptions import UserError
|
||||
from trytond.i18n import gettext
|
||||
from trytond.model import Model, fields
|
||||
from trytond.tools import ClassProperty, is_instance_method
|
||||
from trytond.pyson import PYSONDecoder, PYSONEncoder
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.cache import Cache
|
||||
from trytond.pool import Pool
|
||||
from trytond.pyson import PYSONDecoder, PYSONEncoder
|
||||
from trytond.rpc import RPC
|
||||
from trytond.tools import ClassProperty, is_instance_method
|
||||
from trytond.transaction import Transaction
|
||||
|
||||
from . import fields
|
||||
from .fields import on_change_result
|
||||
from .model import Model
|
||||
|
||||
__all__ = ['ModelView']
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the toplevel of this
|
||||
# repository contains the full copyright notices and license terms.
|
||||
from trytond.pool import Pool
|
||||
from .model import Model
|
||||
|
||||
from .match import MatchMixin
|
||||
from .model import Model
|
||||
|
||||
|
||||
class MultiValueMixin(object):
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
from itertools import chain
|
||||
|
||||
from trytond.i18n import gettext
|
||||
|
||||
from .modelstorage import ValidationError
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the toplevel of this
|
||||
# repository contains the full copyright notices and license terms.
|
||||
from sql import Union, Column, Literal
|
||||
from sql import Column, Literal, Union
|
||||
|
||||
from trytond.model import fields
|
||||
from trytond.pool import Pool
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
import os
|
||||
import sys
|
||||
import configparser
|
||||
import importlib
|
||||
import itertools
|
||||
import logging
|
||||
import configparser
|
||||
from glob import iglob
|
||||
import os
|
||||
import sys
|
||||
from collections import defaultdict
|
||||
from importlib.machinery import FileFinder, SourceFileLoader, SOURCE_SUFFIXES
|
||||
from glob import iglob
|
||||
from importlib.machinery import SOURCE_SUFFIXES, FileFinder, SourceFileLoader
|
||||
|
||||
from sql import Table
|
||||
from sql.functions import CurrentTimestamp
|
||||
|
||||
import trytond.convert as convert
|
||||
import trytond.tools as tools
|
||||
from trytond.config import config
|
||||
from trytond.exceptions import MissingDependenciesException
|
||||
from trytond.transaction import Transaction
|
||||
import trytond.convert as convert
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
+5
-3
@@ -1,11 +1,12 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
from collections import defaultdict, OrderedDict
|
||||
from threading import RLock
|
||||
import builtins
|
||||
import logging
|
||||
from collections import OrderedDict, defaultdict
|
||||
from threading import RLock
|
||||
|
||||
from trytond.modules import load_modules, register_classes
|
||||
from trytond.transaction import Transaction
|
||||
import builtins
|
||||
|
||||
__all__ = ['Pool', 'PoolMeta', 'PoolBase', 'isregisteredby']
|
||||
|
||||
@@ -188,6 +189,7 @@ class Pool(object):
|
||||
except KeyError:
|
||||
if type == 'report':
|
||||
from trytond.report import Report
|
||||
|
||||
# Keyword argument 'type' conflicts with builtin function
|
||||
cls = builtins.type(name, (Report,), {'__slots__': ()})
|
||||
cls.__setup__()
|
||||
|
||||
@@ -4,26 +4,26 @@
|
||||
import logging
|
||||
import pydoc
|
||||
import time
|
||||
|
||||
try:
|
||||
from http import HTTPStatus
|
||||
except ImportError:
|
||||
from http import client as HTTPStatus
|
||||
|
||||
from sql import Table
|
||||
from werkzeug.exceptions import abort
|
||||
from werkzeug.wrappers import Response
|
||||
from sql import Table
|
||||
|
||||
from trytond import security
|
||||
from trytond import backend
|
||||
from trytond import __version__, backend, security
|
||||
from trytond.config import config, get_hostname
|
||||
from trytond import __version__
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.exceptions import (
|
||||
UserError, UserWarning, ConcurrencyException, LoginException,
|
||||
RateLimitException)
|
||||
ConcurrencyException, LoginException, RateLimitException, UserError,
|
||||
UserWarning)
|
||||
from trytond.tools import is_instance_method
|
||||
from trytond.wsgi import app
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.worker import run_task
|
||||
from trytond.wsgi import app
|
||||
|
||||
from .wrappers import with_pool
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
import datetime
|
||||
from decimal import Decimal
|
||||
import json
|
||||
import base64
|
||||
import datetime
|
||||
import json
|
||||
from decimal import Decimal
|
||||
|
||||
from werkzeug.wrappers import Response
|
||||
from werkzeug.exceptions import (
|
||||
BadRequest, InternalServerError, Conflict, Forbidden, Locked,
|
||||
BadRequest, Conflict, Forbidden, InternalServerError, Locked,
|
||||
TooManyRequests)
|
||||
from werkzeug.wrappers import Response
|
||||
|
||||
from trytond.protocols.wrappers import Request
|
||||
from trytond.exceptions import (
|
||||
TrytonException, UserWarning, LoginException, ConcurrencyException,
|
||||
RateLimitException, MissingDependenciesException)
|
||||
ConcurrencyException, LoginException, MissingDependenciesException,
|
||||
RateLimitException, TrytonException, UserWarning)
|
||||
from trytond.protocols.wrappers import Request
|
||||
from trytond.tools import cached_property
|
||||
|
||||
|
||||
|
||||
@@ -4,23 +4,25 @@ import base64
|
||||
import gzip
|
||||
import logging
|
||||
import time
|
||||
from io import BytesIO
|
||||
from functools import wraps
|
||||
from io import BytesIO
|
||||
|
||||
try:
|
||||
from http import HTTPStatus
|
||||
except ImportError:
|
||||
from http import client as HTTPStatus
|
||||
|
||||
from werkzeug.wrappers import Request as _Request, Response
|
||||
from werkzeug.datastructures import Authorization
|
||||
from werkzeug.exceptions import abort, HTTPException
|
||||
from werkzeug.exceptions import HTTPException, abort
|
||||
from werkzeug.wrappers import Request as _Request
|
||||
from werkzeug.wrappers import Response
|
||||
|
||||
from trytond import security, backend
|
||||
from trytond import backend, security
|
||||
from trytond.config import config
|
||||
from trytond.exceptions import RateLimitException
|
||||
from trytond.pool import Pool
|
||||
from trytond.tools import cached_property
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.config import config
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -209,7 +211,8 @@ def with_transaction(readonly=None, user=0, context=None):
|
||||
|
||||
|
||||
def user_application(name, json=True):
|
||||
from .jsonrpc import JSONEncoder, json as json_
|
||||
from .jsonrpc import JSONEncoder
|
||||
from .jsonrpc import json as json_
|
||||
|
||||
def decorator(func):
|
||||
@wraps(func)
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
import xmlrpc.client as client
|
||||
import datetime
|
||||
import logging
|
||||
|
||||
import xmlrpc.client as client
|
||||
# convert decimal to float before marshalling:
|
||||
from decimal import Decimal
|
||||
|
||||
from werkzeug.wrappers import Response
|
||||
from werkzeug.exceptions import (
|
||||
BadRequest, InternalServerError, Conflict, Forbidden, Locked,
|
||||
BadRequest, Conflict, Forbidden, InternalServerError, Locked,
|
||||
TooManyRequests)
|
||||
from werkzeug.wrappers import Response
|
||||
|
||||
from trytond.exceptions import (
|
||||
ConcurrencyException, LoginException, MissingDependenciesException,
|
||||
RateLimitException, TrytonException, UserWarning)
|
||||
from trytond.model.fields.dict import ImmutableDict
|
||||
from trytond.protocols.wrappers import Request
|
||||
from trytond.exceptions import (
|
||||
TrytonException, UserWarning, LoginException, ConcurrencyException,
|
||||
RateLimitException, MissingDependenciesException)
|
||||
from trytond.tools import cached_property
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
+3
-2
@@ -1,11 +1,12 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
import json
|
||||
import datetime
|
||||
import json
|
||||
from decimal import Decimal
|
||||
from dateutil.relativedelta import relativedelta
|
||||
from functools import reduce
|
||||
|
||||
from dateutil.relativedelta import relativedelta
|
||||
|
||||
|
||||
class PYSON(object):
|
||||
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
import datetime
|
||||
import dateutil.tz
|
||||
import os
|
||||
import inspect
|
||||
import logging
|
||||
import math
|
||||
import operator
|
||||
import os
|
||||
import subprocess
|
||||
import tempfile
|
||||
import time
|
||||
import warnings
|
||||
import zipfile
|
||||
import operator
|
||||
|
||||
from email.mime.multipart import MIMEMultipart
|
||||
from email.mime.text import MIMEText
|
||||
from io import BytesIO
|
||||
from itertools import groupby
|
||||
|
||||
import dateutil.tz
|
||||
|
||||
try:
|
||||
import html2text
|
||||
except ImportError:
|
||||
@@ -31,19 +31,20 @@ except ImportError:
|
||||
from genshi.filters import Translator
|
||||
from genshi.template.text import TextTemplate
|
||||
|
||||
from trytond.exceptions import UserError
|
||||
from trytond.i18n import gettext
|
||||
from trytond.pool import Pool, PoolBase
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.tools import slugify
|
||||
from trytond.url import URLMixin
|
||||
from trytond.rpc import RPC
|
||||
from trytond.exceptions import UserError
|
||||
from trytond.tools import slugify
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.url import URLMixin
|
||||
|
||||
warnings.simplefilter("ignore")
|
||||
import relatorio.reporting # noqa: E402
|
||||
|
||||
warnings.resetwarnings()
|
||||
try:
|
||||
from relatorio.templates.opendocument import Manifest, MANIFEST
|
||||
from relatorio.templates.opendocument import MANIFEST, Manifest
|
||||
except ImportError:
|
||||
Manifest, MANIFEST = None, None
|
||||
|
||||
|
||||
@@ -2,10 +2,7 @@
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
from trytond.pool import Pool
|
||||
|
||||
from . import group
|
||||
from . import user
|
||||
from . import ir
|
||||
from . import routes
|
||||
from . import group, ir, routes, user
|
||||
|
||||
__all__ = ['register', 'routes']
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
|
||||
from .user import PasswordError, DeleteError
|
||||
from .user import DeleteError, PasswordError
|
||||
|
||||
__all__ = [
|
||||
PasswordError,
|
||||
|
||||
@@ -4,8 +4,8 @@ from itertools import chain
|
||||
|
||||
from sql import With
|
||||
|
||||
from trytond.model import ModelView, ModelSQL, DeactivableMixin, tree, fields
|
||||
from trytond.model import Unique
|
||||
from trytond.model import (
|
||||
DeactivableMixin, ModelSQL, ModelView, Unique, fields, tree)
|
||||
from trytond.pool import Pool
|
||||
from trytond.tools import grouped_slice
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
from trytond.model import ModelSQL, DeactivableMixin, fields
|
||||
from trytond.model import DeactivableMixin, ModelSQL, fields
|
||||
from trytond.pool import Pool, PoolMeta
|
||||
from trytond.pyson import Eval
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
import logging
|
||||
import time
|
||||
import random
|
||||
import time
|
||||
|
||||
from werkzeug.exceptions import abort
|
||||
|
||||
from trytond.config import config
|
||||
from trytond.wsgi import app
|
||||
from trytond.protocols.wrappers import (
|
||||
with_pool, with_transaction, allow_null_origin)
|
||||
allow_null_origin, with_pool, with_transaction)
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.wsgi import app
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
+17
-18
@@ -3,34 +3,34 @@
|
||||
"User"
|
||||
|
||||
import copy
|
||||
import string
|
||||
import random
|
||||
import hashlib
|
||||
import time
|
||||
import datetime
|
||||
import hashlib
|
||||
import logging
|
||||
import uuid
|
||||
import mmap
|
||||
import random
|
||||
import re
|
||||
import string
|
||||
import time
|
||||
import uuid
|
||||
|
||||
try:
|
||||
import secrets
|
||||
except ImportError:
|
||||
secrets = None
|
||||
import ipaddress
|
||||
import warnings
|
||||
from ast import literal_eval
|
||||
from email.header import Header
|
||||
from functools import wraps
|
||||
from itertools import groupby
|
||||
from operator import attrgetter
|
||||
from ast import literal_eval
|
||||
|
||||
from sql import Literal, Null
|
||||
from sql.functions import CurrentTimestamp
|
||||
from sql.conditionals import Coalesce, Case
|
||||
from sql.aggregate import Count
|
||||
from sql.operators import Concat
|
||||
|
||||
from passlib.context import CryptContext
|
||||
from sql import Literal, Null
|
||||
from sql.aggregate import Count
|
||||
from sql.conditionals import Case, Coalesce
|
||||
from sql.functions import CurrentTimestamp
|
||||
from sql.operators import Concat
|
||||
|
||||
try:
|
||||
import bcrypt
|
||||
@@ -43,14 +43,13 @@ except ImportError:
|
||||
|
||||
from trytond.cache import Cache
|
||||
from trytond.config import config
|
||||
from trytond.exceptions import LoginException, RateLimitException
|
||||
from trytond.exceptions import UserError
|
||||
from trytond.exceptions import LoginException, RateLimitException, UserError
|
||||
from trytond.i18n import gettext
|
||||
from trytond.model import (
|
||||
ModelView, ModelSQL, Workflow, DeactivableMixin, fields, Unique,
|
||||
avatar_mixin)
|
||||
DeactivableMixin, ModelSQL, ModelView, Unique, Workflow, avatar_mixin,
|
||||
fields)
|
||||
from trytond.pool import Pool
|
||||
from trytond.pyson import PYSONEncoder, Eval, Bool
|
||||
from trytond.pyson import Bool, Eval, PYSONEncoder
|
||||
from trytond.report import Report, get_email
|
||||
from trytond.rpc import RPC
|
||||
from trytond.sendmail import sendmail_transactional
|
||||
@@ -58,7 +57,7 @@ from trytond.tools import grouped_slice
|
||||
from trytond.tools.email_ import set_from_header
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.url import host, http_host
|
||||
from trytond.wizard import Wizard, StateView, Button, StateTransition
|
||||
from trytond.wizard import Button, StateTransition, StateView, Wizard
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
_has_password = 'password' in re.split('[,+]', config.get(
|
||||
|
||||
+3
-3
@@ -2,11 +2,11 @@
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
import logging
|
||||
|
||||
from trytond.pool import Pool
|
||||
from trytond.config import config
|
||||
from trytond.transaction import Transaction
|
||||
from trytond import backend
|
||||
from trytond.config import config
|
||||
from trytond.exceptions import LoginException, RateLimitException
|
||||
from trytond.pool import Pool
|
||||
from trytond.transaction import Transaction
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
+1
-1
@@ -3,8 +3,8 @@
|
||||
import logging
|
||||
import smtplib
|
||||
from email.message import Message
|
||||
from email.utils import formatdate
|
||||
from email.mime.text import MIMEText
|
||||
from email.utils import formatdate
|
||||
from urllib.parse import parse_qs, unquote_plus
|
||||
|
||||
from trytond.config import config, parse_uri
|
||||
|
||||
@@ -8,46 +8,15 @@ except ImportError:
|
||||
|
||||
|
||||
def register():
|
||||
from . import access
|
||||
from . import copy_
|
||||
from . import export_data
|
||||
from . import field_binary
|
||||
from . import field_boolean
|
||||
from . import field_char
|
||||
from . import field_context
|
||||
from . import field_date
|
||||
from . import field_datetime
|
||||
from . import field_dict
|
||||
from . import field_float
|
||||
from . import field_function
|
||||
from . import field_integer
|
||||
from . import field_many2many
|
||||
from . import field_many2one
|
||||
from . import field_multiselection
|
||||
from . import field_numeric
|
||||
from . import field_one2many
|
||||
from . import field_one2one
|
||||
from . import field_reference
|
||||
from . import field_selection
|
||||
from . import field_text
|
||||
from . import field_time
|
||||
from . import field_timedelta
|
||||
from . import history
|
||||
from . import import_data
|
||||
from . import mixin
|
||||
from . import model
|
||||
from . import modelsql
|
||||
from . import modelstorage
|
||||
from . import modelview
|
||||
from . import mptt
|
||||
from . import multivalue
|
||||
from . import path
|
||||
from . import resource
|
||||
from . import rule
|
||||
from . import tree
|
||||
from . import trigger
|
||||
from . import wizard
|
||||
from . import workflow
|
||||
from . import (
|
||||
access, copy_, export_data, field_binary, field_boolean, field_char,
|
||||
field_context, field_date, field_datetime, field_dict, field_float,
|
||||
field_function, field_integer, field_many2many, field_many2one,
|
||||
field_multiselection, field_numeric, field_one2many, field_one2one,
|
||||
field_reference, field_selection, field_text, field_time,
|
||||
field_timedelta, history, import_data, mixin, model, modelsql,
|
||||
modelstorage, modelview, mptt, multivalue, path, resource, rule, tree,
|
||||
trigger, wizard, workflow)
|
||||
|
||||
access.register('tests')
|
||||
copy_.register('tests')
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
"Test for export_data"
|
||||
from trytond.model import ModelSQL, fields
|
||||
from trytond.pool import PoolMeta, Pool
|
||||
from trytond.pool import Pool, PoolMeta
|
||||
|
||||
|
||||
class ExportDataTarget(ModelSQL):
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
|
||||
from trytond.model import ModelSQL, fields
|
||||
from trytond.pyson import Eval
|
||||
from trytond.pool import Pool
|
||||
from trytond.pyson import Eval
|
||||
|
||||
|
||||
class FieldContextParent(ModelSQL):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
|
||||
from trytond.model import ModelSQL, DictSchemaMixin, fields
|
||||
from trytond.model import DictSchemaMixin, ModelSQL, fields
|
||||
from trytond.pool import Pool
|
||||
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user