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 |
|---|---|---|---|---|---|---|
6,205 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from odoo.tests import common
import odoo
GIF = b"R0lGODdhAQABAIAAAP///////ywAAAAAAQABAAACAkQBADs="
class test_ir_http_mimetype(common.TransactionCase):
def test_ir_http_mimetype_attachment(self):
""" Test mimetype for attachment """
attachment = self.env['ir.attachment'... | 39.775641 | 6,205 |
7,504 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.base.models.res_users import is_selection_groups, get_selection_groups
from odoo.tests.common import TransactionCase, Form, tagged
class TestUsers(TransactionCase):
def test_name_search(self):
... | 38.680412 | 7,504 |
2,213 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# This assumes an existing but uninitialized database.
from contextlib import contextmanager
import unittest
from odoo import api, registry, SUPERUSER_ID
from odoo.tests import common
from odoo.tests.common import Base... | 34.578125 | 2,213 |
54,763 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import collections
import json
import os.path
import re
import markupsafe
from lxml import etree, html
from lxml.builder import E
from odoo.modules import get_module_resource
from odoo.tests.common import TransactionCa... | 39.705584 | 54,754 |
17,620 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from collections import defaultdict
import psycopg2
from odoo.exceptions import AccessError, MissingError
from odoo.tests.common import TransactionCase
from odoo.tools import mute_logger
from odoo import Command
clas... | 42.97561 | 17,620 |
19,714 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import datetime
from dateutil.relativedelta import relativedelta
import os.path
import pytz
from odoo.tools import config, misc, date_utils, file_open, file_path, merge_sequences, remove_accents
from odoo.tests.common i... | 42.819172 | 19,654 |
5,339 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
import re
from odoo.tests.common import TransactionCase
from odoo.tools import pdf
from odoo.modules.module import get_module_resource
import io
class TestPdf(TransactionCase):
""" Tests on pdf. """
... | 42.373016 | 5,339 |
24,567 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import date
from psycopg2 import IntegrityError, ProgrammingError
import odoo
from odoo.exceptions import UserError, ValidationError, AccessError
from odoo.tools import mute_logger
from odoo.tests import c... | 42.21134 | 24,567 |
28,561 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from unittest.mock import patch
import email.policy
import email.message
import re
import threading
from odoo.addons.base.models.ir_mail_server import extract_rfc2822_addresses
from odoo.tests.common import BaseCase, T... | 49.113597 | 28,535 |
83,387 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import psycopg2
from odoo.addons.base.tests.common import SavepointCaseWithUserDemo
from odoo.fields import Date
from odoo.models import BaseModel
from odoo.tests.common import TransactionCase
from odoo.tools import mut... | 47.587329 | 83,373 |
7,447 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from contextlib import contextmanager
import psycopg2
import psycopg2.errorcodes
import odoo
from odoo.tests import common
from odoo.tests.common import BaseCase
ADMIN_USER_ID = common.ADMIN_USER_ID
@contextmanager
d... | 35.802885 | 7,447 |
11,514 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests.common import TransactionCase
from odoo import Command
class test_search(TransactionCase):
def patch_order(self, model, order):
self.patch(self.registry[model], '_order', order)
def te... | 59.335052 | 11,511 |
24,487 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
MISC_HTML_SOURCE = u"""
<font size="2" style="color: rgb(31, 31, 31); font-family: monospace; font-variant: normal; line-height: normal; ">test1</font>
<div style="color: rgb(31, 31, 31); font-family: monospace; font-var... | 40.59204 | 24,477 |
2,064 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>)
from odoo.addons.base.tests.common import SavepointCaseWithUserDemo
class TestResPartnerBank(SavepointCaseWithUserDemo):
"""Tests acc_number
"""
def ... | 40.470588 | 2,064 |
2,711 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from base64 import b64decode
from odoo.tests.common import TransactionCase
class TestAvatarMixin(TransactionCase):
""" tests the avatar mixin """
def setUp(self):
super().setUp()
self.user_with... | 45.183333 | 2,711 |
2,120 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests.common import TransactionCase
class test_res_lang(TransactionCase):
def test_00_intersperse(self):
from odoo.addons.base.models.res_lang import intersperse
assert intersperse("", []... | 50.47619 | 2,120 |
21,079 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
import binascii
from PIL import Image, ImageDraw, PngImagePlugin
from odoo import tools
from odoo.exceptions import UserError
from odoo.tests.common import TransactionCase
class TestImage(TransactionCas... | 60.746398 | 21,079 |
6,242 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import date
from odoo.tests.common import SingleTransactionCase
from odoo.tools import DEFAULT_SERVER_DATE_FORMAT as DATE_FORMAT
class TestIrSequenceDateRangeStandard(SingleTransactionCase):
""" A fe... | 43.957746 | 6,242 |
15,119 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from psycopg2 import IntegrityError
from odoo.exceptions import ValidationError
from odoo.tests.common import TransactionCase, tagged
from odoo.tools import mute_logger
from odoo import Command
class TestXMLID(Transac... | 43.950581 | 15,119 |
16,401 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import contextlib
import difflib
import logging
import re
from contextlib import contextmanager
from pathlib import PurePath
from unittest import TestCase
from unittest.mock import patch
from odoo.tests.common import Tr... | 36.125551 | 16,401 |
2,140 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests.common import HttpCase, tagged
from odoo.tools import mute_logger, logging
from unittest.mock import patch
@tagged('-at_install', 'post_install')
class TestHttpCase(HttpCase):
def test_console_error... | 47.555556 | 2,140 |
128,681 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import ast
import logging
import time
from functools import partial
from lxml import etree
from lxml.builder import E
from psycopg2 import IntegrityError
from odoo.exceptions import AccessError, ValidationError
from od... | 37.450233 | 128,679 |
13,195 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests.common import TransactionCase
from odoo.exceptions import ValidationError
from odoo import Command
class TestHasGroup(TransactionCase):
def setUp(self):
super(TestHasGroup, self).setUp()
... | 47.635379 | 13,195 |
3,334 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests import common
class TestSingleTransactionCase(common.SingleTransactionCase):
"""
Check the whole-class transaction behavior of SingleTransactionCase.
"""
def test_00(self):
""" ... | 46.305556 | 3,334 |
2,927 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
import odoo
import odoo.tests
_logger = logging.getLogger(__name__)
@odoo.tests.tagged('post_install', '-at_install')
class TestReports(odoo.tests.TransactionCase):
def test_reports(self):
... | 55.226415 | 2,927 |
26,085 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import time
from odoo.exceptions import AccessError
from odoo.tests.common import BaseCase, TransactionCase, tagged, new_test_user
from odoo.tools import profiler
from odoo.tools.profiler import Profiler, ExecutionContex... | 40.949765 | 26,085 |
14,516 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from contextlib import contextmanager
from unittest.mock import patch
from odoo.tests.common import TransactionCase, HttpCase
from odoo import Command
class TransactionCaseWithUserDemo(TransactionCase):
def setUp... | 42.568915 | 14,516 |
11,815 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests import Form
from odoo.tests.common import TransactionCase
from odoo.exceptions import AccessError, UserError
class TestPartner(TransactionCase):
def test_name_search(self):
""" Check name_s... | 59.671717 | 11,815 |
13,496 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import ast
import logging
from odoo import exceptions
from odoo.addons.base.tests.common import TransactionCaseWithUserDemo
from odoo.tests.common import TransactionCase, ADMIN_USER_ID, tagged
_logger = logging.getLogg... | 40.89697 | 13,496 |
12,148 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests.common import TransactionCase, tagged, TagsSelector, BaseCase
@tagged('nodatabase')
class TestSetTags(TransactionCase):
def test_set_tags_empty(self):
"""Test the set_tags decorator with an... | 35.624633 | 12,148 |
38,071 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.exceptions import AccessError, ValidationError
from odoo.tools import mute_logger
from odoo.tools.translate import quote, unquote, xml_translate, html_translate
from odoo.tests.common import TransactionCase, Bas... | 44.674883 | 38,063 |
8,430 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tools import cloc
from odoo.tests import TransactionCase, tagged
XML_TEST = """<!-- Comment -->
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<node>Line</node>
<!-- Comment -->
<node>Line</node>
<!-- Comment
Mu... | 31.573034 | 8,430 |
1,338 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests.common import TransactionCase
class TestMenu(TransactionCase):
def test_00_menu_deletion(self):
"""Verify that menu deletion works properly when there are child menus, and those
... | 44.6 | 1,338 |
1,273 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests.common import TransactionCase
from odoo.tools import get_cache_key_counter
class TestOrmcache(TransactionCase):
def test_ormcache(self):
""" Test the effectiveness of the ormcache() decorato... | 32.641026 | 1,273 |
2,192 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import functools
from odoo.tests.common import BaseCase
from odoo.tools import frozendict
from odoo.tools.func import compose
from odoo import Command
class TestCompose(BaseCase):
def test_basic(self):
str... | 33.212121 | 2,192 |
6,033 | py | PYTHON | 15.0 | import base64
import unittest
try:
import magic
except ImportError:
magic = None
from odoo.tests.common import BaseCase
from odoo.tools.mimetypes import guess_mimetype, get_extension
PNG = b'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVQI12P4//8/AAX+Av7czFnnAAAAAElFTkSuQmCC'
GIF = b"R0lGODdhAQABAIAA... | 45.360902 | 6,033 |
7,843 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import time
from xmlrpc.client import Binary
from odoo.exceptions import AccessDenied, AccessError
from odoo.http import _request_stack
import odoo.tools
from odoo.tests import common
from odoo.service import common as ... | 36.47907 | 7,843 |
11,793 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from math import log10
from odoo.tests.common import TransactionCase
from odoo.tools import float_compare, float_is_zero, float_repr, float_round, float_split, float_split_str
class TestFloatPrecision(TransactionCase)... | 47.361446 | 11,793 |
21,114 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from unittest.mock import patch
from odoo import tools
from odoo.addons.base.tests import test_mail_examples
from odoo.addons.base.tests.common import MockSmtplibCase
from odoo.tests import tagged
from odoo.tests.common... | 46.267544 | 21,098 |
21,815 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models, Command
from odoo.addons.base.tests.common import SavepointCaseWithUserDemo
from odoo.tools import mute_logger
from odoo.exceptions import AccessError
class TestAPI(SavepointCaseWithUserDe... | 40.699627 | 21,815 |
13,408 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from lxml import etree
from odoo.exceptions import AccessError
from odoo.addons.base.tests.common import TransactionCaseWithUserDemo
from odoo.tests.common import TransactionCase
from odoo.tools.misc import mute_logger
... | 47.715302 | 13,408 |
9,075 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from functools import partial
import odoo
from odoo.sql_db import db_connect, TestCursor
from odoo.tests import common
from odoo.tests.common import BaseCase
from odoo.tools.misc import config, mute_logger
ADMIN_USER_I... | 37.8125 | 9,075 |
8,013 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.exceptions import ValidationError
from odoo.tests.common import TransactionCase
class TestIrDefault(TransactionCase):
def test_defaults(self):
""" check the mechanism of user-defined defaults """... | 51.696774 | 8,013 |
39,900 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import ast
from odoo import SUPERUSER_ID, Command
from odoo.exceptions import RedirectWarning, UserError, ValidationError
from odoo.tests.common import TransactionCase, BaseCase
from odoo.tools import mute_logger
from o... | 56.756757 | 39,900 |
4,674 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import timedelta
from unittest.mock import patch
from freezegun import freeze_time
from odoo import fields
from odoo.tests.common import TransactionCase, RecordCapturer
class CronMixinCase:
def captu... | 38 | 4,674 |
4,828 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import os
import platform
import psutil
import unittest
from odoo.addons.base.tests.common import TransactionCaseWithUserDemo
from odoo.exceptions import CacheMiss
from odoo.tests.common import TransactionCase
class T... | 37.138462 | 4,828 |
6,292 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.osv.query import Query
from odoo.tests.common import BaseCase
class QueryTestCase(BaseCase):
def test_basic_query(self):
query = Query(None, 'product_product')
query.add_table('product_te... | 62.29703 | 6,292 |
27,407 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from ast import literal_eval
from collections import defaultdict
import functools
import itertools
import logging
import psycopg2
import datetime
from odoo import api, fields, models, Command
from odoo import SUPERUSER_... | 41.588771 | 27,407 |
2,346 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class BaseModuleUninstall(models.TransientModel):
_name = "base.module.uninstall"
_description = "Module Uninstall"
show_all = fields.Boolean()
module_id = fields.M... | 39.762712 | 2,346 |
2,874 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
import logging
import os
from tempfile import TemporaryFile
from psycopg2 import ProgrammingError
from contextlib import closing
from odoo import api, fields, models, tools, sql_db, _
from odoo.exceptions ... | 44.90625 | 2,874 |
1,260 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import tarfile
import tempfile
from odoo import api, fields, models, tools, _
from odoo.exceptions import UserError
class BaseUpdateTranslations(models.TransientModel):
_name = 'base.update.translations'
_desc... | 33.157895 | 1,260 |
3,391 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import odoo
from odoo import api, fields, models, _
from odoo.exceptions import UserError
class BaseModuleUpgrade(models.TransientModel):
_name = "base.module.upgrade"
_description = "Upgrade Module"
@api.... | 42.3875 | 3,391 |
957 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from odoo import api, fields, models
class BaseModuleUpdate(models.TransientModel):
_name = "base.module.update"
_description = "Update Module"
updated = fields.Integer('Number of modules updated', readonly=True)
added = fields.Integer('Number of modules added', readonly=True... | 33 | 957 |
2,259 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
import contextlib
import io
from odoo import api, fields, models, tools, _
NEW_LANG_KEY = '__new__'
class BaseLanguageExport(models.TransientModel):
_name = "base.language.export"
_description = ... | 38.948276 | 2,259 |
2,305 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _
class BaseLanguageInstall(models.TransientModel):
_name = "base.language.install"
_description = "Install Language"
@api.model
def _default_language(self):
... | 36.015625 | 2,305 |
7,842 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import json
from odoo import api, fields, models, tools, _
from odoo.exceptions import ValidationError
class IrDefault(models.Model):
""" User-defined default values for fields. """
_name = 'ir.default'
_d... | 44.05618 | 7,842 |
18,313 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _
from odoo.exceptions import UserError
from odoo.osv.expression import TERM_OPERATORS_NEGATION
from odoo.tools import ormcache
TYPE2FIELD = {
'char': 'value_text',
'float':... | 39.130342 | 18,313 |
15,754 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import ast
import json
import locale
import logging
import re
from operator import itemgetter
from odoo import api, fields, models, tools, _
from odoo.exceptions import UserError, ValidationError
_logger = logging.getL... | 41.240838 | 15,754 |
44,053 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import hashlib
import itertools
import json
import logging
import operator
from collections import defaultdict
from difflib import get_close_matches
from odoo import api, fields, models, tools, SUPERUSER_ID, _
from odoo.... | 48.145355 | 44,053 |
37,493 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from email.message import EmailMessage
from email.utils import make_msgid
import base64
import datetime
import email
import email.policy
import idna
import logging
import re
import smtplib
import ssl
import sys
import th... | 51.714483 | 37,493 |
13,057 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
import warnings
from odoo import api, fields, models, tools, SUPERUSER_ID, _
from odoo.exceptions import AccessError, ValidationError
from odoo.osv import expression
from odoo.tools import config
from odoo... | 45.653846 | 13,057 |
105,023 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import itertools
import logging
import re
import psycopg2
from ast import literal_eval
from collections import defaultdict
from collections.abc import Mapping
from operator import itemgetter
from psycopg2 import sql
fro... | 45.132359 | 105,023 |
2,040 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import inspect
import logging
import warnings
import traceback
from odoo import api, models
from odoo.exceptions import AccessDenied
_logger = logging.getLogger(__name__)
def is_autovacuum(func):
""" Return wheth... | 33.442623 | 2,040 |
48,097 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from markupsafe import Markup
from odoo import api, fields, models, tools, SUPERUSER_ID, _
from odoo.exceptions import UserError, AccessError
from odoo.tools.safe_eval import safe_eval, time
from odoo.tools.misc import f... | 47.099902 | 48,089 |
504 | py | PYTHON | 15.0 | # -*- coding: ascii -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class ReportLayout(models.Model):
_name = "report.layout"
_description = 'Report Layout'
_order = 'sequence'
view_id = fields.Many2one('ir.ui.view', 'Document Template',... | 29.647059 | 504 |
20,365 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
#----------------------------------------------------------
# ir_http modular http routing
#----------------------------------------------------------
import base64
import hashlib
import logging
import mimetypes
import os
import re
import sys
import traceback
import werkzeug
import werkzeug.exc... | 41.058468 | 20,365 |
59,510 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
import logging
import os.path
import re
import traceback
import builtins
import token
import tokenize
import io
from markupsafe import Markup, escape
from collections.abc import Sized, Mapping
from itertools import count, chain
from textwrap import dedent, indent as _indent
from lxml import etr... | 44.212481 | 59,510 |
7,567 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import re
import logging
from odoo import api, fields, models
from odoo.osv import expression
from odoo.exceptions import UserError
from psycopg2 import IntegrityError
from odoo.tools.translate import _
_logger = logging... | 40.25 | 7,567 |
30,940 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
import hashlib
import io
import itertools
import logging
import mimetypes
import os
import re
import uuid
from collections import defaultdict
from PIL import Image
from odoo import api, fields, models, too... | 46.179104 | 30,940 |
1,001 | py | PYTHON | 15.0 | from odoo import api, fields, models
class DemoFailure(models.TransientModel):
""" Stores modules for which we could not install demo data
"""
_name = 'ir.demo_failure'
_description = 'Demo failure'
module_id = fields.Many2one('ir.module.module', required=True, string="Module")
error = fields... | 32.290323 | 1,001 |
542 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
from odoo.modules.loading import force_demo
from odoo.addons.base.models.ir_module import assert_log_admin_access
class IrDemo(models.TransientModel):
_name = 'ir.demo'
_description = '... | 25.809524 | 542 |
27,396 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import functools
import itertools
import psycopg2
import pytz
from odoo import api, Command, fields, models, _
from odoo.tools import ustr
REFERENCING_FIELDS = {None, 'id', '.id'}
def only_ref_fields(record):
retu... | 43.348101 | 27,396 |
5,098 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
import re
from collections.abc import Iterable
from odoo import api, fields, models, _
from odoo.osv import expression
def sanitize_account_number(acc_number):
if acc_number:
return re.sub(r'\W+', '', acc_number).upper()
return False
class Bank(models.Model):
_descripti... | 39.828125 | 5,098 |
7,337 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, tools, _
from odoo.exceptions import UserError
from odoo.tools.safe_eval import safe_eval, datetime
class IrFilters(models.Model):
_name = 'ir.filters'
_description = 'Filt... | 47.642857 | 7,337 |
19,229 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import datetime, timedelta
import logging
import pytz
from psycopg2 import sql, OperationalError, errorcodes
from odoo import api, fields, models, _
from odoo.exceptions import UserError
_logger = logging.... | 49.687339 | 19,229 |
682 | 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 IrExports(models.Model):
_name = "ir.exports"
_description = 'Exports'
_order = 'name'
name = fields.Char(string='Export Name')
resource = fields.Char(index=Tr... | 29.652174 | 682 |
2,377 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class IrLogging(models.Model):
_name = 'ir.logging'
_description = 'Logging'
_order = 'id DESC'
# The _log_access fields are defined manually for the following reasons:
#
# - The en... | 55.27907 | 2,377 |
12,434 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
import operator
import re
from odoo import api, fields, models, tools, _
from odoo.exceptions import ValidationError
from odoo.http import request
from odoo.modules import get_module_resource
from odoo.osv... | 41.036304 | 12,434 |
3,526 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from base64 import b64encode
from hashlib import sha512
from odoo import models, fields, api
from odoo.tools import html_escape, file_open
def get_hsl_from_seed(seed):
hashed_seed = sha512(seed.encode()).hexdigest(... | 44.632911 | 3,526 |
30,326 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
import base64
import logging
import re
from io import BytesIO
import babel
import babel.dates
from markupsafe import Markup, escape
from PIL import Image
from lxml import etree, html
from odoo import api, fields, models, _, _lt
from odoo.tools import posix_to_ldml, float_utils, format_date, fo... | 39.538462 | 30,326 |
106,295 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import ast
import collections
import datetime
import fnmatch
import inspect
import json
import logging
import math
import pprint
import re
import time
import uuid
import warnings
from dateutil.relativedelta import relat... | 46.336094 | 106,295 |
18,499 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import os
from glob import glob
from logging import getLogger
from werkzeug import urls
import odoo
from odoo.tools import misc
from odoo import tools
from odoo import api, fields, http, models
from odoo.http import ro... | 42.23516 | 18,499 |
14,677 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
import io
import logging
import os
import re
from odoo import api, fields, models, tools, _, Command
from odoo.exceptions import ValidationError, UserError
from odoo.modules.module import get_resource_path... | 47.345161 | 14,677 |
22,503 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
import math
import re
import time
from lxml import etree
from odoo import api, fields, models, tools, _
from odoo.exceptions import UserError
_logger = logging.getLogger(__name__)
try:
from num2wor... | 47.27521 | 22,503 |
19,066 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from __future__ import print_function
from textwrap import dedent
import copy
import io
import logging
import re
import markupsafe
import tokenize
from lxml import html, etree
from odoo import api, models, tools
from odoo.tools.safe_eval import check_values, assert_valid_codeobj, _BUILTINS, to_... | 44.134259 | 19,066 |
48,720 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
from collections import defaultdict, OrderedDict
from decorator import decorator
from operator import attrgetter
import importlib
import io
import logging
import os
import pkg_resources
import shutil
import ... | 44.779412 | 48,720 |
860 | 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 ImageMixin(models.AbstractModel):
_name = 'image.mixin'
_description = "Image Mixin"
# all image fields are base64 encoded and PIL-supported
image_1920 = fields.I... | 45.263158 | 860 |
3,953 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
"""
Store database-specific configuration parameters
"""
import uuid
import logging
from odoo import api, fields, models
from odoo.tools import config, ormcache, mute_logger
_logger = logging.getLogger(__name__)
"""
A... | 34.675439 | 3,953 |
80,125 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
import binascii
import contextlib
import datetime
import hmac
import ipaddress
import itertools
import json
import logging
import os
import time
from collections import defaultdict
from functools import wra... | 44.048928 | 80,125 |
6,790 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _
from odoo.exceptions import ValidationError
# see http://doc.qt.io/archives/qt-4.8/qprinter.html#PaperSize-enum
PAPER_SIZES = [
{
'description': 'A0 5 841 x 1189 mm... | 31.877934 | 6,790 |
21,958 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
import threading
import time
import os
import psycopg2
import pytz
from datetime import datetime, timedelta
from dateutil.relativedelta import relativedelta
import odoo
from odoo import api, fields, models, _
from odoo.exceptions... | 42.223077 | 21,956 |
5,796 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
import datetime
import json
import logging
from dateutil.relativedelta import relativedelta
from odoo import fields, models, api, _
from odoo.exceptions import UserError
from odoo.http import request
from... | 40.25 | 5,796 |
33,683 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import json
import logging
import re
from lxml import etree
from odoo import api, models, _, Command
from odoo.exceptions import AccessError, RedirectWarning, UserError
from odoo.tools import ustr
_logger = logging.get... | 42.96301 | 33,683 |
44,927 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from contextlib import closing
from datetime import datetime
from subprocess import Popen, PIPE
import base64
import hashlib
import itertools
import json
import logging
import os
import re
import textwrap
import uuid
import psycopg2
try:
import sass as libsass
except ImportError:
# If t... | 42.145403 | 44,927 |
52,062 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
import collections
import datetime
import hashlib
import pytz
import threading
import re
import requests
from collections import defaultdict
from lxml import etree
from random import randint
from werkzeug ... | 48.472998 | 52,060 |
39,092 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import odoo
from odoo import api, fields, models, tools, SUPERUSER_ID, _, Command
from odoo.exceptions import MissingError, UserError, ValidationError, AccessError
from odoo.osv import expression
from odoo.tools.safe_eva... | 45.140878 | 39,092 |
2,615 | py | PYTHON | 15.0 | # -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, tools, _
import odoo.addons
import logging
import sys
_logger = logging.getLogger(__name__)
def get_precision(application):
_logger.warning("Deprecated call to decimal_preci... | 35.821918 | 2,615 |
1,541 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models
class IrModelReferenceReport(models.AbstractModel):
_name = 'report.base.report_irmodulereference'
_description = 'Module Reference Report (base)'
@api.model
def _object_fi... | 40.552632 | 1,541 |
3,911 | py | PYTHON | 15.0 | import re
import xmlrpc.client
from datetime import date, datetime
from xmlrpc.client import dumps, loads
from markupsafe import Markup
from werkzeug.wrappers import Response
from odoo.http import Controller, dispatch_rpc, request, route
from odoo.service import wsgi_server
from odoo.fields import Date, Datetime, Com... | 38.722772 | 3,911 |
2,918 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from odoo import fields, models
class GroupOnDate(models.Model):
_name = 'test_read_group.on_date'
_description = 'Group Test Read On Date'
date = fields.Date("Date")
value = fields.Integer("Value")
class BooleanAggregate(models.Model):
_name = 'test_read_group.aggregate... | 28.330097 | 2,918 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.