size int64 0 304k | ext stringclasses 1
value | lang stringclasses 1
value | branch stringclasses 1
value | content stringlengths 0 304k | avg_line_length float64 0 238 | max_line_length int64 0 304k |
|---|---|---|---|---|---|---|
713 | py | PYTHON | 15.0 | # Copyright 2019 Creu Blanca
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Web Widget Child Selector",
"summary": "Widget used for navigation on hierarchy fields",
"version": "15.0.1.0.0",
"license": "AGPL-3",
"author": "Creu Blanca,Odoo Community Association (OCA)",
... | 35.65 | 713 |
1,195 | py | PYTHON | 15.0 | # Copyright 2019 Creu Blanca
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo.tests.common import TransactionCase
class TestWidgetChildSelector(TransactionCase):
def setUp(self):
super().setUp()
ResPartner = self.env["res.partner"].with_context(tracking_disable=True)
... | 41.206897 | 1,195 |
1,066 | py | PYTHON | 15.0 | # Copyright 2019 Creu Blanca
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models
class Base(models.AbstractModel):
_inherit = "base"
def _get_record_parents(self, field):
if not self or not hasattr(self, self._parent_name):
return []
return get... | 33.3125 | 1,066 |
703 | py | PYTHON | 15.0 | {
"name": "Web Refresher",
"version": "15.0.2.0.0",
"author": "Compassion Switzerland, Tecnativa, Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "https://github.com/OCA/web",
"depends": ["web"],
"installable": True,
"auto_install": False,
"assets": {
"web.... | 33.47619 | 703 |
899 | py | PYTHON | 15.0 | # Copyright 2019-2020 Brainbean Apps (https://brainbeanapps.com)
# Copyright 2020 CorporateHub (https://corporatehub.eu)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Dynamic Dropdown Widget",
"summary": "This module adds support for dynamic dropdown widget",
"category": "... | 39.086957 | 899 |
688 | py | PYTHON | 15.0 | # pylint: disable=missing-docstring
# Copyright 2016 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Web Notify",
"summary": """
Send notification messages to user""",
"version": "15.0.1.0.0",
"license": "AGPL-3",
"author": "ACSONE SA/NV," "AdaptiveCi... | 31.272727 | 688 |
3,807 | py | PYTHON | 15.0 | # Copyright 2016 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import json
from odoo import exceptions
from odoo.tests import common
from ..models.res_users import DANGER, DEFAULT, INFO, SUCCESS, WARNING
class TestResUsers(common.TransactionCase):
def test_notify_success(self):
... | 42.775281 | 3,807 |
3,492 | py | PYTHON | 15.0 | # Copyright 2016 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import _, api, exceptions, fields, models
from odoo.addons.bus.models.bus import channel_with_db, json_dump
DEFAULT_MESSAGE = "Default message"
SUCCESS = "success"
DANGER = "danger"
WARNING = "warning"
INFO = "inf... | 35.632653 | 3,492 |
909 | py | PYTHON | 15.0 | # Copyright 2020 Tecnativa - Alexandre Díaz
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
{
"name": "Web Pivot Computed Measure",
"category": "web",
"version": "15.0.1.0.1",
"author": "Tecnativa, Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "https://gi... | 34.923077 | 908 |
282 | py | PYTHON | 15.0 | # Copyright 2022 Tecnativa - Carlos Roca
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
from odoo import fields, models
class ResUsersFake(models.Model):
_inherit = "res.users"
user_year_born = fields.Integer()
user_year_now = fields.Integer()
| 23.5 | 282 |
1,108 | py | PYTHON | 15.0 | # Copyright 2022 Tecnativa - Carlos Roca
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
from odoo_test_helper import FakeModelLoader
from odoo.tests import common, tagged
@tagged("post_install", "-at_install")
class TestUIPivot(common.HttpCase):
@classmethod
def setUpClass(cls):
... | 29.945946 | 1,108 |
1,195 | py | PYTHON | 15.0 | # Copyright 2016 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Web timeline",
"summary": "Interactive visualization chart to show events in time",
"version": "15.0.1.0.2",
"development_status": "Production/Stable",
"author": "ACSON... | 33.194444 | 1,195 |
315 | py | PYTHON | 15.0 | # Copyright 2016 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
TIMELINE_VIEW = ("timeline", "Timeline")
class IrUIView(models.Model):
_inherit = "ir.ui.view"
type = fields.Selection(selection_add=[TIMELINE_VIEW])
| 26.25 | 315 |
662 | py | PYTHON | 15.0 | # Copyright 2015 Andrius Preimantas <andrius@versada.lt>
# Copyright 2020 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Use AND conditions on omnibar search",
"version": "15.0.1.0.0",
"author": "Versada UAB, ACSONE SA/NV, Serincloud, Odoo Community Associatio... | 34.842105 | 662 |
791 | py | PYTHON | 15.0 | # Copyright 2017 - 2018 Modoolar <info@modoolar.com>
# Copyright 2018 Brainbean Apps
# Copyright 2020 Manuel Calero
# Copyright 2020 CorporateHub (https://corporatehub.eu)
# License LGPLv3.0 or later (https://www.gnu.org/licenses/lgpl-3.0.en.html).
{
"name": "Web Actions Multi",
"summary": "Enables triggering ... | 34.391304 | 791 |
433 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class IrActionsActMulti(models.Model):
_name = "ir.actions.act_multi"
_description = "Action Mulit"
_inherit = "ir.actions.actions"
_table = "ir_actions"
type = fields.Char(default="ir.acti... | 28.866667 | 433 |
823 | py | PYTHON | 15.0 | # Copyright 2019 GRAP - Quentin DUPONT
# Copyright 2020 Tecnativa - Alexandre Díaz
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
{
"name": "Web Widget Numeric Step",
"category": "web",
"version": "15.0.1.0.0",
"author": "GRAP, Tecnativa, " "Odoo Community Association (OCA)",
"... | 32.88 | 822 |
1,166 | py | PYTHON | 15.0 | # Copyright 2015 ACSONE SA/NV
# Copyright 2018 Amaris
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Web Dialog Size",
"summary": """
A module that lets the user expand a
dialog box to the full screen width.""",
"author": "ACSONE SA/NV, "
"Therp BV, "
"Si... | 33.314286 | 1,166 |
729 | py | PYTHON | 15.0 | # Copyright 2018 Tecnativa - Ernesto Tejeda
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0
from odoo.tests.common import TransactionCase
class TestWebDialogSize(TransactionCase):
def setUp(self):
super(TestWebDialogSize, self).setUp()
def test_get_web_dialog_size_config(self):
o... | 36.45 | 729 |
514 | py | PYTHON | 15.0 | # Copyright 2018 Tecnativa - Jairo Llopis
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo.models import Model, api
from odoo.tools.safe_eval import const_eval
class IrConfigParameter(Model):
_inherit = "ir.config_parameter"
@api.model
def get_web_dialog_size_config(self):
... | 28.555556 | 514 |
753 | py | PYTHON | 15.0 | # Copyright 2015 0k.io
# Copyright 2016 ACSONE SA/NV
# Copyright 2017 Tecnativa
# Copyright 2020 initOS GmbH.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "web_m2x_options",
"version": "15.0.1.1.0",
"category": "Web",
"author": "initOS GmbH,"
"ACSONE SA/NV, "
"0k.io... | 27.888889 | 753 |
1,475 | py | PYTHON | 15.0 | # Copyright 2020 initOS GmbH.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.tests import common
class TestIrConfigParameter(common.TransactionCase):
@classmethod
def setUpClass(cls):
super(TestIrConfigParameter, cls).setUpClass()
cls.env["ir.config_parameter"]... | 52.678571 | 1,475 |
581 | py | PYTHON | 15.0 | from odoo import api, models
class IrConfigParameter(models.Model):
_inherit = "ir.config_parameter"
@api.model
def get_web_m2x_options(self):
opts = [
"web_m2x_options.create",
"web_m2x_options.create_edit",
"web_m2x_options.limit",
"web_m2x_option... | 32.277778 | 581 |
656 | py | PYTHON | 15.0 | # © 2017 Onestein (<http://www.onestein.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "List Range Selection",
"summary": """
Enables selecting a range of records using the shift key
""",
"version": "15.0.1.0.0",
"category": "Web",
"author": "Onestei... | 29.772727 | 655 |
783 | py | PYTHON | 15.0 | # Copyright 2017 ForgeFlow S.L.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
{
"name": "Web Widget Bokeh Chart",
"category": "Hidden",
"summary": "This widget allows to display charts using Bokeh library.",
"author": "ForgeFlow, " "Odoo Community Association (OCA)",
"version": "1... | 34.043478 | 783 |
692 | py | PYTHON | 15.0 | # Copyright 2015-2018 Camptocamp SA, Damien Crier
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Colorize field in tree views",
"summary": "Allows you to dynamically color fields on tree views",
"category": "Hidden/Dependency",
"version": "15.0.1.0.0",
"depends": ["w... | 36.421053 | 692 |
559 | py | PYTHON | 15.0 | # Copyright 2020 Creu Blanca
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Web View Calendar List",
"summary": """
Show calendars as a List""",
"version": "15.0.1.0.0",
"license": "AGPL-3",
"author": "Creu Blanca,Odoo Community Association (OCA)",
"website":... | 29.421053 | 559 |
329 | py | PYTHON | 15.0 | # Copyright 2020 Creu Blanca
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class IrUiView(models.Model):
_inherit = "ir.ui.view"
type = fields.Selection(
selection_add=[("calendar_list", "Calendar List")],
ondelete={"calendar_list": "cascade"... | 25.307692 | 329 |
364 | py | PYTHON | 15.0 | # Copyright 2020 Creu Blanca
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class IrActionsActWindowView(models.Model):
_inherit = "ir.actions.act_window.view"
view_mode = fields.Selection(
selection_add=[("calendar_list", "Calendar List")],
o... | 28 | 364 |
654 | py | PYTHON | 15.0 | # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
{
"name": "Web Time Range Menu Custom",
"version": "15.0.1.0.1",
"author": "Tecnativa, Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "https://github.com/OCA/web",
"depends": ["web"],
"installable": Tru... | 31.142857 | 654 |
623 | py | PYTHON | 15.0 | # Copyright 2018 Simone Orsi - Camptocamp SA
# License LGPLv3.0 or later (https://www.gnu.org/licenses/lgpl-3.0.en.html).
{
"name": "Web URL widget advanced",
"summary": "This module extends URL widget "
"for displaying anchors with custom labels.",
"category": "Web",
"version": "15.0.1.0.0",
"l... | 34.611111 | 623 |
559 | py | PYTHON | 15.0 | # Copyright 2019-2020 Creu Blanca
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Widget Open on new Tab",
"summary": """
Allow to open record from trees on new tab from tree views""",
"version": "15.0.1.0.0",
"license": "AGPL-3",
"author": "Creu Blanca,Odoo Commu... | 32.882353 | 559 |
598 | py | PYTHON | 15.0 | {
"name": "Group Expand Buttons",
"category": "Web",
"version": "15.0.1.0.0",
"license": "AGPL-3",
"author": "OpenERP SA, "
"AvanzOSC, "
"Serv. Tecnol. Avanzados - Pedro M. Baeza, "
"Therp BV, "
"Xtendoo, "
"Odoo Community Association (OCA)",
"website": "https://github.com/OC... | 27.181818 | 598 |
1,664 | py | PYTHON | 15.0 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import find_packages, setup
from os.path import join, dirname
exec(open(join(dirname(__file__), 'odoo', 'release.py'), 'rb').read()) # Load release variables
lib_name = 'odoo'
setup(
name='odoo',
version=version,
description=description,
... | 25.212121 | 1,664 |
1,669 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
RELEASE_LEVELS = [ALPHA, BETA, RELEASE_CANDIDATE, FINAL] = ['alpha', 'beta', 'candidate', 'final']
RELEASE_LEVELS_DISPLAY = {ALPHA: ALPHA,
BETA: BETA,
RELEASE_CANDIDATE... | 45.108108 | 1,669 |
11,352 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
import logging.handlers
import os
import platform
import pprint
import sys
import threading
import time
import traceback
import warnings
from . import release
from . import sql_db
from . import tools
_lo... | 41.28 | 11,352 |
300,877 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
"""
Object Relational Mapping module:
* Hierarchical structure
* Constraints consistency and validation
* Object metadata depends on its status
* Optimised processing by complex query (multiple a... | 44.116862 | 300,877 |
177,441 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
""" High-level objects for fields. """
from collections import defaultdict
from datetime import date, datetime, time
from operator import attrgetter
from xmlrpc.client import MAXINT
import base64
import binascii
import ... | 43.131016 | 177,441 |
3,663 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import sys
LOG_NOTSET = 'notset'
LOG_DEBUG = 'debug'
LOG_INFO = 'info'
LOG_WARNING = 'warn'
LOG_ERROR = 'error'
LOG_CRITICAL = 'critical'
# TODO get_encodings, ustr and exception_to_unicode were originally from tools.m... | 35.221154 | 3,663 |
38,952 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
"""The Odoo API module defines Odoo Environments and method decorators.
.. todo:: Document this module
"""
__all__ = [
'Environment',
'Meta',
'model',
'constrains', 'depends', 'onchange', 'returns',
... | 38.039063 | 38,952 |
68,758 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
#----------------------------------------------------------
# OpenERP HTTP layer
#----------------------------------------------------------
import ast
import cgi
import collections
import contextlib
import functools
import hashlib
import hmac
import inspect
import logging
import mimetypes
impor... | 40.092128 | 68,758 |
29,251 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
"""
The PostgreSQL connector is a connectivity layer between the OpenERP code and
the database, *not* a database abstraction toolkit. Database abstraction is what
the ORM does, in fact.
"""
from contextlib import conte... | 36.472569 | 29,251 |
3,984 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
"""The Odoo Exceptions module defines a few core exception types.
Those types are understood by the RPC layer.
Any other exception type bubbling until the RPC layer will be
treated as a 'Server error'.
.. note::
If... | 28.457143 | 3,984 |
24,786 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
import collections
import logging
import random
import re
import socket
import threading
import time
from email.utils import getaddresses
from urllib.parse import urlparse
import idna
import markupsafe
fro... | 39.405405 | 24,786 |
56,815 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
"""
Miscellaneous tools used by OpenERP.
"""
import cProfile
import collections
import datetime
import hmac as hmac_lib
import hashlib
import io
import itertools
import os
import pickle as pickle_
import re
import socke... | 34.474196 | 56,779 |
8,162 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import reprlib
shortener = reprlib.Repr()
shortener.maxstring = 150
shorten = shortener.repr
class Speedscope:
def __init__(self, name='Speedscope', init_stack_trace=None):
self.init_stack_trace = init_stac... | 38.140187 | 8,162 |
50,373 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import codecs
import fnmatch
import functools
import inspect
import io
import locale
import logging
import os
import polib
import re
import tarfile
import tempfile
import threading
from collections import defaultdict, nam... | 39.292512 | 50,373 |
13,851 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from __future__ import print_function
import builtins
import math
def round(f):
# P3's builtin round differs from P2 in the following manner:
# * it rounds half to even rather than up (away from 0)
# * roun... | 49.117021 | 13,851 |
1,714 | py | PYTHON | 15.0 | import ast
import os
import logging
from shutil import copyfileobj
_logger = logging.getLogger(__name__)
from werkzeug.datastructures import FileStorage
try:
from xlrd import xlsx
except ImportError:
pass
else:
from lxml import etree
# xlrd.xlsx supports defusedxml, defusedxml's etree interface is br... | 32.961538 | 1,714 |
40,237 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
import configparser as ConfigParser
import errno
import logging
import optparse
import glob
import os
import sys
import tempfile
import warnings
import odoo
from os.path import expandvars, expanduser, abspath, realpath
from .. import release, c... | 54.154778 | 40,237 |
10,761 | py | PYTHON | 15.0 |
from lxml import etree
from lxml.builder import E
import copy
import itertools
import logging
from odoo.tools.translate import _
from odoo.tools import SKIPPED_ELEMENT_TYPES, html_escape
_logger = logging.getLogger(__name__)
def add_text_before(node, text):
""" Add text before ``node`` in its XML tree. """
... | 41.709302 | 10,761 |
3,490 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
## this functions are taken from the setuptools package (version 0.6c8)
## http://peak.telecommunity.com/DevCenter/PkgResources#parsing-utilities
from __future__ import print_function
import re
component_re = re.compil... | 43.625 | 3,490 |
9,491 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
import math
import calendar
from datetime import date, datetime, time
import pytz
from dateutil.relativedelta import relativedelta
from . import ustr
from .func import lazy
def get_month(date):
''' Compute the month dates range on which the 'date' parameter belongs to.
:param date: A ... | 37.366142 | 9,491 |
31,656 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
__all__ = [
'convert_file', 'convert_sql_import',
'convert_csv_import', 'convert_xml_import'
]
import base64
import io
import logging
import os.path
import pprint
import re
import subprocess
import warnings
fro... | 38.889435 | 31,656 |
8,267 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# decorator makes wrappers that have the same API as their wrapped function
from collections import Counter, defaultdict
from decorator import decorator
from inspect import signature
import logging
unsafe_eval = eval
_... | 35.633621 | 8,267 |
7,142 | py | PYTHON | 15.0 | from functools import lru_cache
import json
class SourceMapGenerator:
"""
The SourceMapGenerator creates the sourcemap maps the asset bundle to the js/css files.
What is a sourcemap ? (https://developer.mozilla.org/en-US/docs/Tools/Debugger/How_to/Use_a_source_map)
In brief: a source map is what make... | 39.899441 | 7,142 |
18,285 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import io
import re
from datetime import datetime
from hashlib import md5
from logging import getLogger
from PyPDF2 import PdfFileWriter, PdfFileReader
from PyPDF2.generic import DictionaryObject, NameObject, ArrayObject... | 43.533333 | 18,284 |
7,966 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
"""
Mimetypes-related utilities
# TODO: reexport stdlib mimetypes?
"""
import collections
import functools
import io
import logging
import re
import zipfile
__all__ = ['guess_mimetype']
_logger = logging.getLogger(__name__)
# We define our own guess_mimetype implementation and if magic is av... | 38.110048 | 7,965 |
1,038 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import locale
import time
import datetime
if not hasattr(locale, 'D_FMT'):
locale.D_FMT = 1
if not hasattr(locale, 'T_FMT'):
locale.T_FMT = 2
if not hasattr(locale, 'nl_langinfo'):
def nl_langinfo(param):
... | 34.6 | 1,038 |
711 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import importlib
import logging
import types
_logger = logging.getLogger(__name__)
SUPPORTED_DEBUGGER = {'pdb', 'ipdb', 'wdb', 'pudb'}
def post_mortem(config, info):
if config['dev_mode'] and isinstance(info[2], ty... | 37.421053 | 711 |
21,332 | py | PYTHON | 15.0 | """
This code is what let us use ES6-style modules in odoo.
Classic Odoo modules are composed of a top-level :samp:`odoo.define({name},{body_function})` call.
This processor will take files starting with an `@odoo-module` annotation (in a comment) and convert them to classic modules.
If any file has the /** odoo-module... | 32.567939 | 21,332 |
2,199 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import dateutil.relativedelta as relativedelta
import functools
import re
from markupsafe import Markup
from werkzeug import urls
from odoo.tools import safe_eval
INLINE_TEMPLATE_REGEX = re.compile(r"\{\{(.+?)\}\}")
... | 29.32 | 2,199 |
19,969 | py | PYTHON | 15.0 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2005-2010 ActiveState Software Inc.
# Copyright (c) 2013 Eddy Petrișor
"""Utilities for determining application-specific dirs.
See <http://github.com/ActiveState/appdirs> for details and usage.
"""
from __future__ import print_function
# Dev Notes:
# - MSD... | 42.394904 | 19,968 |
13,988 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import ast
import pathlib
import os
import re
import shutil
import odoo
from odoo.tools.config import config
VERSION = 1
DEFAULT_EXCLUDE = [
"__manifest__.py",
"__openerp__.py",
"tests/**/*",
"static/lib... | 41.384615 | 13,988 |
12,274 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
""" Helper functions for reports testing.
Please /do not/ import this file by default, but only explicitly call it
through the code of python tests.
"""
import logging
import os
import tempfile
from subprocess ... | 42.178694 | 12,274 |
1,336 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
import collections
import threading
from .func import synchronized
__all__ = ['LRU']
class LRU(object):
"""
Implementation of a length-limited O(1) LRU map.
Original Copyright 2003 Josiah Carlson, later rebuilt on OrderedDict.
"""
def __init__(self, count, pairs=()):
... | 22.644068 | 1,336 |
1,116 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
#pylint: disable=deprecated-module
import csv
import codecs
import io
_reader = codecs.getreader('utf-8')
_writer = codecs.getwriter('utf-8')
def csv_reader(stream, **params):
assert not isinstance(stream, io.TextIOBase),\
"For cross-compatibility purposes, csv_reader takes a byte... | 27.219512 | 1,116 |
6,594 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
"""
Some functions related to the os and os.path module
"""
import logging
import os
import re
import tempfile
import zipfile
from contextlib import contextmanager
from os.path import join as opj
_logger = logging.getL... | 38.561404 | 6,594 |
5,973 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
"""Utilities for generating, parsing and checking XML/XSD files on top of the lxml.etree module."""
import base64
from io import BytesIO
from lxml import etree
from odoo.exceptions import UserError
class odoo_resolver(etree.Resolver):
"""Odoo specific file resolver that can be added to t... | 43.282609 | 5,973 |
5,435 | py | PYTHON | 15.0 | """ View validation code (using assertions, not the RNG schema). """
import ast
import collections
import logging
import os
import re
from lxml import etree
from odoo import tools
_logger = logging.getLogger(__name__)
_validators = collections.defaultdict(list)
_relaxng_cache = {}
READONLY = re.compile(r"\breadon... | 29.862637 | 5,435 |
15,111 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
"""
safe_eval module - methods intended to provide more restricted alternatives to
evaluate simple and/or untrusted code.
Methods in this module are typically used as alternatives to eval() to parse
O... | 35.893112 | 15,111 |
13,078 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# pylint: disable=sql-injection
import logging
import psycopg2
_schema = logging.getLogger('odoo.schema')
_CONFDELTYPES = {
'RESTRICT': 'r',
'NO ACTION': 'a',
'CASCADE': 'c',
'SET NULL': 'n',
'SET ... | 43.304636 | 13,078 |
6,723 | py | PYTHON | 15.0 | #!/usr/bin/env python
""" Which - locate a command
* adapted from Brian Curtin's http://bugs.python.org/file15381/shutil_which.patch
* see http://bugs.python.org/issue444582
* uses ``PATHEXT`` on Windows
* searches current directory before ``PATH`` on Windows,
but not before an explicitly passed ... | 45.120805 | 6,723 |
8,075 | py | PYTHON | 15.0 | import random
from datetime import datetime
from dateutil.relativedelta import relativedelta
from odoo.tools import pycompat
def Random(seed):
""" Return a random number generator object with the given seed. """
r = random.Random()
r.seed(seed, version=2)
return r
def format_str(val, counter, values... | 45.111732 | 8,075 |
24,711 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import datetime
import gc
import json
import logging
import sys
import time
import threading
import re
import functools
from psycopg2 import sql
from odoo import tools
_logger = logging.getLogger(__name_... | 38.607813 | 24,709 |
2,092 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
import json as json_
import re
import markupsafe
JSON_SCRIPTSAFE_MAPPER = {
'&': r'\u0026',
'<': r'\u003c',
'>': r'\u003e',
'\u2028': r'\u2028',
'\u2029': r'\u2029'
}
class _ScriptSafe(str):
def __html__(self):
# replacement can be done straight in the serialise... | 38.036364 | 2,092 |
21,978 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
import binascii
import io
from PIL import Image, ImageOps
# We can preload Ico too because it is considered safe
from PIL import IcoImagePlugin
try:
from PIL.Image import Transpose, Palette, Resampling
... | 38.423077 | 21,978 |
9,790 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
__all__ = ['synchronized', 'lazy_classproperty', 'lazy_property',
'classproperty', 'conditional', 'lazy']
from functools import wraps
from inspect import getsourcefile
from json import JSONEncoder
class laz... | 39.796748 | 9,790 |
8,117 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
r"""
Vendored copy of https://github.com/pallets/werkzeug/blob/2b2c4c3dd3cf7389e9f4aa06371b7332257c6289/src/werkzeug/contrib/sessions.py
werkzeug.contrib was removed from werkzeug 1.0. sessions (and secure
cookies) were moved to the secure-cookies package. Problem is distros
are... | 32.729839 | 8,117 |
5,528 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
"""
werkzeug.useragents
~~~~~~~~~~~~~~~~~~~
This module provides a helper to inspect user agent strings. This module
is far from complete but should work for most of the currently available
browsers.
:copyright: 2007 Pallets
:license: BSD-3-Clause
This packag... | 27.098039 | 5,528 |
9,953 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import re
import warnings
from zlib import crc32
from odoo.tools import lazy_property
IDENT_RE = re.compile(r'^[a-z_][a-z0-9_$]*$', re.I)
def _from_table(table, alias):
""" Return a FROM clause element from ``tab... | 40.45935 | 9,953 |
389 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from ..exceptions import except_orm
from ..models import Model, TransientModel, AbstractModel
# Deprecated, kept for backward compatibility.
except_osv = except_orm
# Deprecated, kept for backward compatibility.
osv = ... | 29.923077 | 389 |
49,899 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
""" Domain expression processing
The main duty of this module is to compile a domain expression into a
SQL query. A lot of things should be documented here, but as a first
step in the right direction, some tests in test... | 45.777064 | 49,897 |
167 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from odoo import models
class A(models.Model):
_name = _description = 'tab.a'
class B(models.Model):
_name = _description = 'tab.b'
| 18.555556 | 167 |
174 | py | PYTHON | 15.0 | {
'name': "Test Action Bindings",
'category': 'Hidden/Tests',
'data': [
'ir.model.access.csv',
'test_data.xml',
],
'license': 'LGPL-3',
}
| 19.333333 | 174 |
3,606 | py | PYTHON | 15.0 | from odoo.tests import common
class TestActionBindings(common.TransactionCase):
def test_bindings(self):
""" check the action bindings on models """
Actions = self.env['ir.actions.actions']
# first make sure there is no bound action
self.env.ref('base.action_partner_merge').unlink... | 38.774194 | 3,606 |
624 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, fields
class test_uninstall_model(models.Model):
"""
This model uses different types of columns to make it possible to test
the uninstall feature of Odoo.
"""
_name = 'test_u... | 31.2 | 624 |
392 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'test-uninstall',
'version': '0.1',
'category': 'Hidden/Tests',
'description': """A module to test the uninstall feature.""",
'depends': ['base'],
'data': ['ir.model.access.csv'],
'in... | 30.153846 | 392 |
700 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Test Main Flow',
'version': '1.0',
'category': 'Hidden/Tests',
'description': """
This module will test the main workflow of Odoo.
It will install some main apps and will try to execute the most... | 33.333333 | 700 |
3,352 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
import odoo
import odoo.tests
import unittest
class BaseTestUi(odoo.tests.HttpCase):
def main_flow_tour(self):
# Enable Make to Order
self.env.ref('stock.route_warehouse0_mto').active = True
# Define minimal accou... | 38.528736 | 3,352 |
228 | py | PYTHON | 15.0 | {
'name': 'test installation of data module',
'description': 'Test data module (see test_data_module) installation',
'version': '0.0.1',
'category': 'Hidden/Tests',
'sequence': 10,
'license': 'LGPL-3',
}
| 28.5 | 228 |
506 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from odoo.tests import common
class TestDataModuleInstalled(common.TransactionCase):
""" Test that the fake data module `test_data_module` is correctly installed.
The use case of this test is that odoo supports installation of data modules only without `__init__.py`.
"""
def t... | 38.923077 | 506 |
2,546 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class SomeObj(models.Model):
_name = 'test_access_right.some_obj'
_description = 'Object For Test Access Right'
val = fields.Integer()
categ_id = fields.Many2one('test_ac... | 36.898551 | 2,546 |
281 | py | PYTHON | 15.0 | {
'name': 'test of access rights and rules',
'description': "Testing of access restrictions",
'version': '0.0.1',
'category': 'Hidden/Tests',
'data': [
'ir.model.access.csv',
'security.xml',
'data.xml',
],
'license': 'LGPL-3',
}
| 23.416667 | 281 |
16,198 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from odoo import SUPERUSER_ID, Command
from odoo.exceptions import AccessError
from odoo.tests import common, TransactionCase
class Feedback(TransactionCase):
def setUp(self):
super().setUp()
self.group0 = self.env['res.groups'].create({'name': "Group 0"})
self.gro... | 38.112941 | 16,198 |
5,498 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.exceptions import AccessError
from odoo.tests.common import TransactionCase
from odoo.tools import mute_logger
from odoo import Command
class TestRules(TransactionCase):
def setUp(self):
super(Tes... | 43.634921 | 5,498 |
1,824 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.base.tests.common import TransactionCaseWithUserDemo
class TestMonetaryAccess(TransactionCaseWithUserDemo):
def test_monetary_access_create(self):
"""Monetary fields that depend on compute... | 48 | 1,824 |
2,630 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import odoo.tests
from odoo import Command
@odoo.tests.tagged('-at_install', 'post_install')
class TestAccess(odoo.tests.HttpCase):
def setUp(self):
super(TestAccess, self).setUp()
self.portal_user ... | 45.344828 | 2,630 |
205 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
{
'name': 'test mimetypes-guessing',
'version': '0.1',
'category': 'Hidden/Tests',
'description': """A module to generate exceptions.""",
'license': 'LGPL-3',
}
| 25.625 | 205 |
1,885 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
import os.path
from odoo.tests.common import BaseCase
from odoo.tools.mimetypes import guess_mimetype
def contents(extension):
with open(os.path.join(
os.path.dirname(__file__),
'testfiles',
'case.{}'.format(extension)
), 'rb') as f:
return f.read()
cl... | 27.318841 | 1,885 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.