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 |
|---|---|---|---|---|---|---|
444 | 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 ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
digest_emails = fields.Boolean(string="Digest Emails", config_parameter='digest.default_digest_em... | 44.4 | 444 |
2,028 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from werkzeug.exceptions import Forbidden, NotFound
from werkzeug.urls import url_encode
from odoo import _
from odoo.http import Controller, request, route
from odoo.tools import consteq
class DigestController(Contro... | 41.387755 | 2,028 |
667 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Google reCAPTCHA integration',
'category': 'Hidden',
'version': '1.0',
'description': """
This module implements reCaptchaV3 so that you can prevent bot spam on your public modules.
... | 29 | 667 |
5,405 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
import requests
from odoo import api, models, _
from odoo.http import request
from odoo.exceptions import UserError, ValidationError
logger = logging.getLogger(__name__)
class Http(models.AbstractModel)... | 47.831858 | 5,405 |
752 | 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 ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
recaptcha_public_key = fields.Char("Site Key", config_parameter='recaptcha_public_key', groups='b... | 44.235294 | 752 |
1,950 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'VAT Number Validation',
'version': '1.0',
'category': 'Accounting/Accounting',
'description': """
VAT validation for Partner's VAT numbers.
=========================================
After inst... | 44.318182 | 1,950 |
4,208 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests.common import TransactionCase, tagged
from odoo.exceptions import ValidationError
from unittest.mock import patch
import stdnum.eu.vat
class TestStructure(TransactionCase):
@classmethod
def setUpClass(cls):
def... | 43.381443 | 4,208 |
261 | 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 ResCompany(models.Model):
_inherit = 'res.company'
vat_check_vies = fields.Boolean(string='Verify VAT Numbers')
| 26.1 | 261 |
271 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from odoo import fields, models
class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
vat_check_vies = fields.Boolean(related='company_id.vat_check_vies', readonly=False,
string='Verify VAT Numbers')
| 27.1 | 271 |
1,025 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from odoo import api, models, _
from odoo.exceptions import ValidationError
class AccountFiscalPosition(models.Model):
_inherit = 'account.fiscal.position'
@api.constrains('country_id', 'foreign_vat')
def _validate_foreign_vat(self):
for record in self:
if not... | 42.708333 | 1,025 |
28,183 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import datetime
import string
import re
import stdnum
from stdnum.eu.vat import check_vies
from stdnum.exceptions import InvalidComponent
from stdnum.util import clean
import logging
from odoo import api, models, field... | 39.916431 | 28,181 |
669 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': "Luxembourg - Peppol Identifier",
'version': '1.0',
'description': """
Some Luxembourg public institutions do not have a VAT number but have been assigned an arbitrary number
(see: https://... | 39.352941 | 669 |
326 | 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 ResPartner(models.Model):
_inherit = 'res.partner'
country_code = fields.Char(related='country_id.code')
l10n_lu_peppol_identifier = fields.Char("Peppol Unique Identif... | 29.636364 | 326 |
432 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': "MRP Project",
'version': '1.0',
'summary': "Monitor MRP using project",
'description': "",
'category': 'Services/Project',
'depends': ['mrp_account', 'project'],
'data': [
'... | 25.411765 | 432 |
2,577 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models, _, _lt
class Project(models.Model):
_inherit = "project.project"
production_count = fields.Integer(related="analytic_account_id.production_count", groups='mrp.group_mrp_user')
... | 37.347826 | 2,577 |
700 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Purchase Requisition Stock Dropshipping',
'version': '1.0',
'category': 'Hidden',
'summary': 'Purchase Requisition, Stock, Dropshipping',
'description': """
This module makes the link betwe... | 31.818182 | 700 |
2,595 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.fields import Command
from odoo.tests import common
from odoo.tests.common import Form
class TestPurchaseRequisitionStockDropshipping(common.TransactionCase):
def test_purchase_requisition_stock_dropship... | 46.339286 | 2,595 |
611 | py | PYTHON | 15.0 | # -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models
class PurchaseOrder(models.Model):
_inherit = 'purchase.order'
@api.onchange('requisition_id')
def _onchange_requisition_id(self):
super()._onchange_requisition_id()
... | 38.1875 | 611 |
1,076 | py | PYTHON | 15.0 | # -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class PurchaseRequisition(models.Model):
_inherit = 'purchase.requisition'
def _prepare_tender_values(self, product_id, product_qty, product_uom, location_id, name, origin, co... | 41.384615 | 1,076 |
1,750 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': "Course Certifications",
'summary': 'Add certification capabilities to your courses',
'description': """This module lets you use the full power of certifications within your courses.""",
'categor... | 39.772727 | 1,750 |
6,384 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.survey.tests.common import TestSurveyCommon
class TestCourseCertificationFailureFlow(TestSurveyCommon):
def test_course_certification_failure_flow(self):
# Step 1: create a simple certifica... | 52.760331 | 6,384 |
5,846 | 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 SlidePartnerRelation(models.Model):
_inherit = 'slide.slide.partner'
user_input_ids = fields.One2many('survey.user_input', 'slide_partner_id', 'Certification attempts... | 48.31405 | 5,846 |
312 | 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 Channel(models.Model):
_inherit = 'slide.channel'
nbr_certification = fields.Integer("Number of Certifications", compute='_compute_slides_statistics', store=True)
| 31.2 | 312 |
2,770 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models, api
from odoo.osv import expression
class SurveyUserInput(models.Model):
_inherit = 'survey.user_input'
slide_id = fields.Many2one('slide.slide', 'Related course slide',
... | 43.28125 | 2,770 |
2,628 | 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 Survey(models.Model):
_inherit = 'survey.survey'
slide_ids = fields.One2many(
'slide.slide', 'survey_id', string="Certification Slides",
help="The ... | 48.666667 | 2,628 |
800 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.survey.controllers import main
class Survey(main.Survey):
def _prepare_survey_finished_values(self, survey, answer, token=False):
result = super(Survey, self)._prepare_survey_finished_value... | 36.363636 | 800 |
7,640 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import werkzeug
import werkzeug.utils
import werkzeug.exceptions
from odoo import _
from odoo import http
from odoo.exceptions import AccessError
from odoo.http import request
from odoo.osv import expression
from odoo.... | 45.748503 | 7,640 |
1,148 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Automated Action Rules',
'version': '1.0',
'category': 'Sales/Sales',
'description': """
This module allows to implement action rules for any object.
===========================================... | 31.888889 | 1,148 |
3,824 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests import TransactionCase
from odoo.exceptions import UserError
import odoo.tests
@odoo.tests.tagged('post_install', '-at_install')
class TestAutomation(TransactionCase):
def test_01_on_create(self):
... | 42.488889 | 3,824 |
1,485 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests.common import tagged, HttpCase
@tagged('-at_install', 'post_install', 'mail_composer')
class TestMailFullComposer(HttpCase):
def test_full_composer_tour(self):
self.env['mail.template'].cre... | 38.076923 | 1,485 |
24,892 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import datetime
import logging
import traceback
from collections import defaultdict
from dateutil.relativedelta import relativedelta
from odoo import _, api, fields, models, SUPERUSER_ID
from odoo.tools import DEFAULT_... | 46.181818 | 24,892 |
345 | 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 ServerAction(models.Model):
_inherit = "ir.actions.server"
usage = fields.Selection(selection_add=[
('base_automation', 'Automated Action')
], ondelete={'base_... | 28.75 | 345 |
1,230 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
{
'name': "Testing the Import/Export invoices with UBL/CII",
'version': '1.0',
'category': 'Hidden/Tests',
'description': """
This module tests the module 'account_edi_ubl_cii', it is separated since dependencies to some
localizations were required. Its name begins with ... | 38.4375 | 1,230 |
21,493 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from odoo.addons.l10n_account_edi_ubl_cii_tests.tests.common import TestUBLCommon
from odoo.tests import tagged
import base64
@tagged('post_install_l10n', 'post_install', '-at_install')
class TestUBLBE(TestUBLCommon):
@classmethod
def setUpClass(cls,
chart_template_r... | 44.681913 | 21,492 |
9,724 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from odoo.addons.l10n_account_edi_ubl_cii_tests.tests.common import TestUBLCommon
from odoo.tests import tagged
import base64
@tagged('post_install_l10n', 'post_install', '-at_install')
class TestUBLDE(TestUBLCommon):
@classmethod
def setUpClass(cls,
chart_template_... | 41.547009 | 9,722 |
8,472 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from odoo.addons.l10n_account_edi_ubl_cii_tests.tests.common import TestUBLCommon
from odoo.tests import tagged
@tagged('post_install_l10n', 'post_install', '-at_install')
class TestUBLNL(TestUBLCommon):
@classmethod
def setUpClass(cls,
chart_template_ref="l10n_nl.l... | 40.535885 | 8,472 |
9,976 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
import base64
from freezegun import freeze_time
from odoo.addons.account_edi.tests.common import AccountEdiTestCommon
from odoo import fields
from odoo.modules.module import get_resource_path
from odoo.tests import tagged
from lxml import etree
@tagged('post_install_l10n', 'post_install', '-... | 41.394191 | 9,976 |
20,577 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from odoo.addons.l10n_account_edi_ubl_cii_tests.tests.common import TestUBLCommon
from odoo.tests import tagged
@tagged('post_install_l10n', 'post_install', '-at_install')
class TestCIIFR(TestUBLCommon):
@classmethod
def setUpClass(cls,
chart_template_ref="l10n_fr.l... | 43.869936 | 20,575 |
974 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
{
'name': 'Booths/Exhibitors Bridge',
'category': 'Marketing/Events',
'version': '1.0',
'summary': 'Event Booths, automatically create a sponsor.',
'description': """
Automatically create a sponsor when renting a booth.
""",
'depends': ['website_event_exhibitor', 'we... | 30.4375 | 974 |
640 | 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 HttpCaseWithUserDemo, HttpCaseWithUserPortal
from odoo.tests import tagged
@tagged('post_install', '-at_install')
class TestWEventBoothExhibitorCommon(HttpCaseWithUserDemo, Htt... | 37.647059 | 640 |
1,014 | 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 EventBoothCategory(models.Model):
_inherit = 'event.booth.category'
@api.model
def _get_exhibitor_type(self):
return self.env['event.sponsor']._fields['ex... | 42.25 | 1,014 |
2,703 | 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 EventBooth(models.Model):
_inherit = 'event.booth'
use_sponsor = fields.Boolean(related='booth_category_id.use_sponsor')
sponsor_type_id = fields.Many2one(related='boo... | 50.055556 | 2,703 |
2,284 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
from odoo.addons.website_event.controllers.main import WebsiteEventController
from odoo.tools import plaintext2html
class WebsiteEventBoothController(WebsiteEventController):
def _prepare_booth_regi... | 55.707317 | 2,284 |
6,913 | py | PYTHON | 15.0 | # -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import contextlib
import re
from lxml import etree
from psycopg2 import sql
from unittest.mock import Mock, MagicMock, patch
import werkzeug
import odoo
from odoo.tools.misc import DotDict
def get_video_embed_code(v... | 34.222772 | 6,913 |
12,255 | py | PYTHON | 15.0 | # -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Website',
'category': 'Website/Website',
'sequence': 20,
'summary': 'Enterprise website builder',
'website': 'https://www.odoo.com/app/website',
'version': '1.0',
'description': "... | 46.420455 | 12,255 |
1,810 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import json
from odoo import tests
from odoo.tools import mute_logger
@tests.tagged('post_install', '-at_install')
class TestControllers(tests.HttpCase):
@mute_logger('odoo.addons.http_routing.models.ir_http', 'o... | 39.347826 | 1,810 |
4,378 | 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.tests.common import TransactionCase, new_test_user
from odoo.exceptions import ValidationError
from odoo.service.model import check
from odoo.tools import mute_logger
from o... | 44.673469 | 4,378 |
3,233 | 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 odoo.tests
from odoo.addons.iap.tools.iap_tools import iap_jsonrpc_mocked
from odoo.tools import mute_logger
class TestConfiguratorCommon(odoo.tests.HttpCase):
def _theme_upg... | 47.544118 | 3,233 |
7,933 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests import TransactionCase, tagged
@tagged('post_install', '-at_install')
class TestDisableSnippetsAssets(TransactionCase):
def setUp(self):
super().setUp()
self.View = self.env['ir.ui.v... | 48.078788 | 7,933 |
8,236 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from lxml import etree
import re
from odoo import http, tools
from odoo.addons.base.tests.common import TransactionCaseWithUserDemo
from odoo.addons.website.tools import MockRequest
from odoo.modules.module import get_m... | 46.269663 | 8,236 |
1,644 | py | PYTHON | 15.0 | import odoo.tests
from odoo.tests.common import HOST
from odoo.tools import config
@odoo.tests.common.tagged('post_install', '-at_install')
class TestWebsiteAttachment(odoo.tests.HttpCase):
def test_01_type_url_301_image(self):
IMD = self.env['ir.model.data']
IrAttachment = self.env['ir.attachmen... | 32.235294 | 1,644 |
15,032 | py | PYTHON | 15.0 | # coding: utf-8
from lxml import html
from odoo.addons.website.controllers.main import Website
from odoo.addons.website.tools import MockRequest
from odoo.tests import common, HttpCase, tagged
from odoo.tests.common import HOST
from odoo.tools import config
from odoo.tools import mute_logger
@tagged('-at_install', '... | 49.285246 | 15,032 |
15,250 | py | PYTHON | 15.0 | # coding: utf-8
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from contextlib import contextmanager
from datetime import datetime, timedelta
from unittest.mock import patch
from odoo.addons.base.tests.common import HttpCaseWithUserDemo
from odoo.addons.website.tools import MockRequest
fro... | 46.776074 | 15,249 |
470 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests import common, tagged
@tagged('-at_install', 'post_install')
class TestAuthSignupUninvited(common.TransactionCase):
def test_01_auth_signup_uninvited(self):
self.env['website'].browse(1).au... | 36.153846 | 470 |
7,186 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from lxml.html import document_fromstring
import odoo.tests
class TestUrlCommon(odoo.tests.HttpCase):
def setUp(self):
super(TestUrlCommon, self).setUp()
self.domain = 'http://' + odoo.tests.HOST
... | 47.589404 | 7,186 |
13,533 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
import odoo
import odoo.tests
@odoo.tests.tagged('-at_install', 'post_install')
class TestUiCustomizeTheme(odoo.tests.HttpCase):
def test_01_attachment_website_unlink(self):
''' Some ir.attac... | 42.556604 | 13,533 |
76,578 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import unittest
from itertools import zip_longest
from lxml import etree as ET, html
from lxml.html import builder as h
from odoo.tests import common, HttpCase, tagged
def attrs(**kwargs):
return {'data-oe-%s' % k... | 51.222742 | 76,578 |
4,410 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
import time
import lxml.html
from werkzeug import urls
import odoo
import re
from odoo.addons.base.tests.common import HttpCaseWithUserDemo
_logger = logging.getLogger(__name__)
@odoo.tests.common.ta... | 38.017241 | 4,410 |
1,624 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
# -*- coding: utf-8 -*-
import odoo.tests
@odoo.tests.tagged('post_install', '-at_install')
class TestWebsiteFormEditor(odoo.tests.HttpCase):
def test_tour(self):
self.start_tour("/", 'website_form_editor_tour', login="admin")
... | 49.212121 | 1,624 |
1,694 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from unittest.mock import sentinel
from odoo.http import EndPoint
from odoo.tests import HttpCase
class TestHttpEndPoint(HttpCase):
def test_http_endpoint_equality(self):
sentinel.method.original_func = se... | 35.291667 | 1,694 |
5,884 | 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
EXTRA_REQUEST = 5
""" During tests, the query on 'base_registry_signaling, base_cache_signaling'
won't be executed on hot state, but 6 new queries related to the test cursor
... | 41.43662 | 5,884 |
12,757 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
from lxml import etree
import re
from markupsafe import Markup
from odoo.addons.website.controllers.main import Website
from odoo.addons.website.tools import distance, MockRequest
import odoo.tests
from o... | 49.832031 | 12,757 |
909 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import odoo.tests
@odoo.tests.common.tagged('post_install', '-at_install')
class TestUnsplashBeacon(odoo.tests.HttpCase):
def test_01_beacon(self):
self.env['ir.config_parameter'].sudo().set_param('unsplas... | 39.521739 | 909 |
5,312 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import odoo
from odoo.addons.http_routing.models.ir_http import url_lang
from odoo.addons.website.tools import MockRequest
from odoo.tests import HttpCase, tagged
from odoo.tests.common import HOST
@tagged('-at_install... | 47.00885 | 5,312 |
1,257 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from PIL import Image
from odoo.tests import tagged
from odoo.tests.common import TransactionCase
from odoo.tools import base64_to_image, image_to_base64
@tagged('post_install', '-at_install')
class TestWebsiteResetPa... | 34.916667 | 1,257 |
1,702 | py | PYTHON | 15.0 | # coding: utf-8
from odoo.tests import common, tagged
@tagged('-at_install', 'post_install')
class TestTheme(common.TransactionCase):
def test_theme_remove_working(self):
""" This test ensure theme can be removed.
Theme removal is also the first step during theme installation.
"""
... | 41.512195 | 1,702 |
8,308 | py | PYTHON | 15.0 | # coding: utf-8
import json
from odoo.tests import common
class TestMenu(common.TransactionCase):
def setUp(self):
super(TestMenu, self).setUp()
self.nb_website = self.env['website'].search_count([])
def test_01_menu_got_duplicated(self):
Menu = self.env['website.menu']
tota... | 43.710526 | 8,305 |
2,003 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.http_routing.models.ir_http import slugify, unslug
from odoo.tests.common import BaseCase
class TestUnslug(BaseCase):
def test_unslug(self):
tests = {
'': (None, None),
... | 24.641975 | 1,996 |
5,119 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests import HttpCase, standalone, tagged
@tagged('website_nightly', '-standard')
class TestWebsiteNightlyRunbot(HttpCase):
def test_01_website_nightly_runbot(self):
""" This test is just here to ... | 51.707071 | 5,119 |
2,260 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import odoo.tests
@odoo.tests.common.tagged('post_install', '-at_install')
class TestIrAsset(odoo.tests.HttpCase):
def test_01_website_specific_assets(self):
IrAsset = self.env['ir.asset']
Website ... | 44.313725 | 2,260 |
691 | py | PYTHON | 15.0 | from odoo.tests import tagged
from odoo.addons.website.tests.test_configurator import TestConfiguratorCommon
@tagged('post_install', '-at_install')
class TestAutomaticEditor(TestConfiguratorCommon):
def test_01_automatic_editor_on_new_website(self):
# We create a lang because if the new website is display... | 40.647059 | 691 |
6,487 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests import tagged
from odoo.tests.common import TransactionCase
@tagged('post_install', '-at_install')
class TestGetCurrentWebsite(TransactionCase):
def setUp(self):
# Unlink unused website(s) ... | 47.698529 | 6,487 |
3,025 | 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 odoo
from odoo.tests import tagged
from odoo.tests.common import HttpCase
@tagged('post_install', '-at_install')
class TestWebsiteResetPassword(HttpCase):
def test_01_websit... | 39.285714 | 3,025 |
2,655 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from lxml import html
import odoo
import odoo.tests
from odoo.addons.website.tools import MockRequest
from odoo.tests.common import HOST
from odoo.tools import config
@odoo.tests.common.tagged('post_install', '-at_ins... | 43.52459 | 2,655 |
507 | 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
class WebsiteRobots(models.TransientModel):
_name = "website.robots"
_description = "Robots.txt Editor"
content = fields.Text(default=lambda s: s.env['website'].get_cu... | 36.214286 | 507 |
1,249 | 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
class BaseLanguageInstall(models.TransientModel):
_inherit = "base.language.install"
website_ids = fields.Many2many('website', string='Websites to translate')
@api.... | 35.685714 | 1,249 |
20,321 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
import os
from collections import OrderedDict
from odoo import api, fields, models
from odoo.addons.base.models.ir_model import MODULE_UNINSTALL_FLAG
from odoo.exceptions import MissingError
from odoo.htt... | 44.272331 | 20,321 |
941 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models, tools, _
from odoo.addons.website.models import ir_http
from odoo.exceptions import UserError
from odoo.http import request
class Lang(models.Model):
_inherit = "res.lang"
def wri... | 36.192308 | 941 |
3,110 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class IrTranslation(models.Model):
_inherit = "ir.translation"
def _load_module_terms(self, modules, langs, overwrite=False):
""" Add missing website specific translation """
... | 49.365079 | 3,110 |
16,088 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
import re
from werkzeug.urls import url_join
from odoo import api, fields, models, _
from odoo.addons.http_routing.models.ir_http import url_for
from odoo.addons.website.tools import text_from_html
from ... | 43.016043 | 16,088 |
915 | py | PYTHON | 15.0 | # coding: utf-8
from odoo import api, models
from odoo.addons.website.models import ir_http
class IrRule(models.Model):
_inherit = 'ir.rule'
@api.model
def _eval_context(self):
res = super(IrRule, self)._eval_context()
# We need is_frontend to avoid showing website's company items in bac... | 38.125 | 915 |
1,589 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class BaseModel(models.AbstractModel):
_inherit = 'base'
def get_base_url(self):
"""
Returns the base url for a given record, given the following priority:
1. If... | 39.725 | 1,589 |
21,500 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
from lxml import etree
import os
import unittest
import time
import pytz
import werkzeug
import werkzeug.routing
import werkzeug.utils
from functools import partial
import odoo
from odoo import api, mode... | 44.605809 | 21,500 |
1,517 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
from odoo import fields, models, api
from odoo.exceptions import UserError
from odoo.tools.translate import _
_logger = logging.getLogger(__name__)
class Attachment(models.Model):
_inherit = "ir.att... | 42.138889 | 1,517 |
1,440 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
from odoo import api, models
from odoo.http import request
_logger = logging.getLogger(__name__)
class IrModelData(models.Model):
_inherit = 'ir.model.data'
@api.model
def _process_end_unl... | 40 | 1,440 |
5,581 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, fields, api, SUPERUSER_ID
from odoo.http import request
class website_form_config(models.Model):
_inherit = 'website'
def _website_form_last_record(self):
if request and reques... | 43.601563 | 5,581 |
9,530 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import werkzeug.exceptions
import werkzeug.urls
from odoo import api, fields, models
from odoo.http import request
from odoo.tools.translate import html_translate
class Menu(models.Model):
_name = "website.menu"
... | 43.715596 | 9,530 |
955 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models, tools
from odoo.http import request
class IrUiMenu(models.Model):
_inherit = 'ir.ui.menu'
@api.model
@tools.ormcache_context('self._uid', keys=('lang', 'force_action',))
d... | 36.730769 | 955 |
278 | py | PYTHON | 15.0 | from odoo import models
class MailThread(models.AbstractModel):
_inherit = 'mail.thread'
def message_post_with_view(self, views_or_xmlid, **kwargs):
super(MailThread, self.with_context(inherit_branding=False)).message_post_with_view(views_or_xmlid, **kwargs)
| 34.75 | 278 |
631 | 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 Contact(models.AbstractModel):
_inherit = 'ir.qweb.field.contact'
@api.model
def get_available_options(self):
options = super(Contact, self).get_available_opti... | 35.055556 | 631 |
15,749 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from psycopg2 import sql
import re
from odoo.addons.http_routing.models.ir_http import slugify
from odoo.addons.website.tools import text_from_html
from odoo import api, fields, models
from odoo.osv import expression
fr... | 44.36338 | 15,749 |
26,515 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
import os
import uuid
import werkzeug
from odoo import api, fields, models
from odoo import tools
from odoo.addons import website
from odoo.exceptions import AccessError
from odoo.osv import expression
fr... | 48.473492 | 26,515 |
3,864 | 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 IrAsset(models.Model):
_inherit = 'ir.asset'
key = fields.Char(copy=False, help='Technical field used to resolve multiple assets in a multi-website environment.')
webs... | 42.461538 | 3,864 |
1,732 | 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 Company(models.Model):
_inherit = "res.company"
website_id = fields.Many2one('website', compute='_compute_website_id', store=True)
def _compute_website_id(self):... | 39.363636 | 1,732 |
9,400 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
import re
import requests
from werkzeug.urls import url_parse
from odoo import models
class Assets(models.AbstractModel):
_inherit = 'web_editor.assets'
def make_scss_customization(self, url, v... | 50.26738 | 9,400 |
3,622 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import re
from collections import OrderedDict
from odoo import models
from odoo.http import request
from odoo.addons.base.models.assetsbundle import AssetsBundle
from odoo.addons.http_routing.models.ir_http import url_fo... | 39.802198 | 3,622 |
5,475 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import re
import werkzeug
from odoo import models, fields, api, _
from odoo.exceptions import AccessDenied, ValidationError
import logging
_logger = logging.getLogger(__name__)
class WebsiteRoute(models.Model):
_... | 40.858209 | 5,475 |
12,047 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from ast import literal_eval
from collections import OrderedDict
from odoo import models, fields, api, _
from odoo.exceptions import ValidationError, MissingError
from odoo.osv import expression
from lxml import etree, html
import logging
from random import randint
_logger = logging.getLogger(... | 43.179211 | 12,047 |
14,674 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
import threading
from odoo import api, fields, models
from odoo.tools.translate import xml_translate
from odoo.modules.module import get_resource_from_path
from odoo.addons.base.models.ir_asset import AFT... | 37.625641 | 14,674 |
4,594 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
from odoo import api, fields, models, _, Command
from odoo.exceptions import ValidationError
from odoo.http import request
_logger = logging.getLogger(__name__)
class ResUsers(models.Model):
_inheri... | 47.360825 | 4,594 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.