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 |
|---|---|---|---|---|---|---|
3,010 | 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 PurchaseOrder(models.Model):
_inherit = "purchase.order"
sale_order_count = fields.Integer(
"Number of Source Sale",
compute='_compute_sale_order_c... | 40.675676 | 3,010 |
1,021 | 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 ProductTemplate(models.Model):
_inherit = 'product.template'
service_to_purchase = fields.Boolean("Subcontract Service", help="If ticked, each time you sell this prod... | 39.269231 | 1,021 |
1,387 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Tours',
'category': 'Hidden',
'description': """
Odoo Web tours.
========================
""",
'version': '0.1',
'depends': ['web'],
'data': [
'security/ir.model.access.csv',
... | 30.152174 | 1,387 |
586 | 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.http import request
class Http(models.AbstractModel):
_inherit = 'ir.http'
def session_info(self):
result = super().session_info()
if result['is_admin']:
... | 34.470588 | 586 |
1,061 | 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 Tour(models.Model):
_name = "web_tour.tour"
_description = "Tours"
_log_access = False
name = fields.Char(string="Tour name", required=True)
user_id = fi... | 35.366667 | 1,061 |
4,214 | py | PYTHON | 15.0 | # -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Surveys',
'version': '3.4',
'category': 'Marketing/Surveys',
'description': """
Create beautiful surveys and visualize answers
==============================================
It depends on the... | 41.313725 | 4,214 |
2,522 | 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 TestSurveyRandomize(TransactionCase):
def test_01_generate_randomized_questions(self):
""" Use random generate for a survey and verify that questions with... | 42.745763 | 2,522 |
17,762 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import datetime
from odoo.addons.survey.tests import common
from odoo.exceptions import AccessError, UserError
from odoo.tests import tagged
from odoo.tests.common import users, HttpCase
from odoo.tools import mute_logg... | 49.202216 | 17,762 |
3,898 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.survey.tests import common
class TestSurveyComputePagesQuestions(common.TestSurveyCommon):
def test_compute_pages_questions(self):
with self.with_user('survey_manager'):
survey ... | 57.323529 | 3,898 |
11,115 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
import odoo.tests
from odoo.addons.base.tests.common import HttpCaseWithUserDemo
@odoo.tests.common.tagged('post_install', '-at_install')
class TestUiFeedback(HttpCaseWithUserDemo):
def setUp(self):
super(TestUiFeedback, self).s... | 44.46 | 11,115 |
12,567 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
import odoo.tests
from odoo.addons.base.tests.common import HttpCaseWithUserDemo
@odoo.tests.common.tagged('post_install', '-at_install')
class TestUiCertification(HttpCaseWithUserDemo):
def setUp(self):
super(TestUiCertificatio... | 44.72242 | 12,567 |
5,558 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.survey.tests import common
from odoo.tests import tagged
from odoo.tests.common import HttpCase
@tagged('-at_install', 'post_install', 'functional')
class TestSurveyFlowWithConditions(common.TestSurvey... | 44.464 | 5,558 |
11,602 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import _
from odoo.addons.survey.tests import common
from odoo.tests.common import users
class TestSurveyInternals(common.TestSurveyCommon):
@users('survey_manager')
def test_answer_validation_mandat... | 39.063973 | 11,602 |
10,080 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from dateutil.relativedelta import relativedelta
from unittest.mock import patch
from odoo import fields
from odoo.tests.common import tagged, HttpCase
@tagged('post_install', '-at_install')
class TestUiSession(HttpCa... | 45.201794 | 10,080 |
13,616 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import re
from collections import Counter
from contextlib import contextmanager
from odoo.addons.mail.tests.common import mail_new_test_user
from odoo.tests import common
class SurveyCase(common.TransactionCase):
... | 44.204545 | 13,615 |
5,648 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.survey.tests import common
from odoo.tests import tagged
from odoo.tests.common import HttpCase
@tagged('-at_install', 'post_install', 'functional')
class TestSurveyFlow(common.TestSurveyCommon, HttpCa... | 47.066667 | 5,648 |
10,793 | 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.addons.base.models.ir_mail_server import IrMailServer
from odoo.addons.survey.tests import common
from odoo.tests import tagged
from odoo.tests.common import HttpCase
@tagged(... | 50.2 | 10,793 |
11,559 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.survey.tests import common
from psycopg2 import IntegrityError
from odoo.exceptions import AccessError
from odoo.tools import mute_logger
class TestCertificationBadge(common.TestSurveyCommon):
def... | 57.507463 | 11,559 |
10,202 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import datetime
from dateutil.relativedelta import relativedelta
from odoo import fields
from odoo.addons.survey.tests import common
from odoo.exceptions import UserError
from odoo.tests import Form
from o... | 43.785408 | 10,202 |
12,813 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
import re
import werkzeug
from odoo import api, fields, models, tools, _
from odoo.exceptions import UserError
_logger = logging.getLogger(__name__)
emails_split = re.compile(r"[;,\n\r]+")
class Surve... | 45.760714 | 12,813 |
602 | 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 GamificationBadge(models.Model):
_inherit = 'gamification.badge'
survey_ids = fields.One2many('survey.survey', 'certification_badge_id', 'Survey Ids')
survey_id =... | 37.625 | 602 |
56,305 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import json
import random
import uuid
import werkzeug
from odoo import api, exceptions, fields, models, _
from odoo.exceptions import AccessError, UserError
from odoo.osv import expression
from odoo.tools import is_html... | 51.139873 | 56,305 |
30,971 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import collections
import json
import itertools
import operator
from odoo import api, fields, models, tools, _
from odoo.exceptions import UserError, ValidationError
class SurveyQuestion(models.Model):
""" Questio... | 53.862609 | 30,971 |
35,543 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
import uuid
from dateutil.relativedelta import relativedelta
from odoo import api, fields, models, _
from odoo.exceptions import ValidationError
from odoo.tools import float_is_zero
_logger = logging.ge... | 49.639665 | 35,542 |
358 | 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 Challenge(models.Model):
_inherit = 'gamification.challenge'
challenge_category = fields.Selection(selection_add=[
('certification', 'Certifications')
], ondel... | 29.833333 | 358 |
1,447 | 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 ResPartner(models.Model):
_inherit = 'res.partner'
certifications_count = fields.Integer('Certifications Count', compute='_compute_certifications_count')
certific... | 45.21875 | 1,447 |
38,228 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import json
import logging
import werkzeug
from datetime import datetime, timedelta
from dateutil.relativedelta import relativedelta
from odoo import fields, http, SUPERUSER_ID, _
from odoo.addons.base.models.ir_ui_vie... | 52.438957 | 38,228 |
11,816 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import datetime
import json
from dateutil.relativedelta import relativedelta
from werkzeug.exceptions import NotFound
from odoo import fields, http
from odoo.http import request
from odoo.tools import is_html_empty
c... | 47.453815 | 11,816 |
540 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
{
'name': 'Maintenance - HR',
'version': '1.0',
'sequence': 125,
'category': 'Human Resources',
'description': """
Bridge between HR and Maintenance.""",
'depends': ['hr', 'maintenance'],
'summary': 'Equipments, Assets, Internal Hardware, Allocation Tracking'... | 25.714286 | 540 |
5,930 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from odoo import api, fields, models, tools
class MaintenanceEquipment(models.Model):
_inherit = 'maintenance.equipment'
employee_id = fields.Many2one('hr.employee', compute='_compute_equipment_assign',
store=True, readonly=False, string='Assigned Employee', tracking=True)
... | 47.063492 | 5,930 |
821 | py | PYTHON | 15.0 | from odoo import api, models, fields
class Users(models.Model):
_inherit = 'res.users'
equipment_ids = fields.One2many('maintenance.equipment', 'owner_user_id', string="Managed Equipments")
equipment_count = fields.Integer(related='employee_id.equipment_count', string="Assigned Equipments")
@propert... | 34.208333 | 821 |
3,853 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'eCommerce',
'category': 'Website/Website',
'sequence': 50,
'summary': 'Sell your products online',
'website': 'https://www.odoo.com/app/ecommerce',
'version': '1.1',
'description': ... | 41.880435 | 3,853 |
2,553 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.models import Command
from odoo.tests.common import tagged
from odoo.addons.payment.tests.common import PaymentCommon
from odoo.addons.website.tools import MockRequest
@tagged('post_install', '-at_install')
class WebsiteSaleCartPay... | 47.277778 | 2,553 |
14,271 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
import io
from PIL import Image
from odoo.addons.website_sale.tests.common import TestWebsiteSaleCommon
import odoo.tests
@odoo.tests.common.tagged('post_install', '-at_install')
class TestWebsiteSaleImage(TestWebsiteSaleCommo... | 44.457944 | 14,271 |
13,882 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.sale.tests.test_sale_product_attribute_value_config import TestSaleProductAttributeValueCommon
from odoo.tests import tagged
from odoo.addons.website.tools import MockRequest
from odoo.addons.website_sal... | 49.22695 | 13,882 |
838 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests import HttpCase, tagged
@tagged('post_install', '-at_install')
class TestSitemap(HttpCase):
def setUp(self):
super(TestSitemap, self).setUp()
self.cats = self.env['product.public.category'].create([{
... | 33.52 | 838 |
415 | py | PYTHON | 15.0 | from odoo.tests.common import HttpCase
class TestWebsiteSaleCommon(HttpCase):
def setUp(self):
super(TestWebsiteSaleCommon, self).setUp()
# Update website pricelist to ensure currency is same as env.company
website = self.env['website'].get_current_website()
pricelist = website.get... | 41.5 | 415 |
3,232 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
import odoo.tests
@odoo.tests.common.tagged('post_install', '-at_install')
class TestWebsiteSequence(odoo.tests.TransactionCase):
def setUp(self):
super(TestWebsiteSequence, self).setUp()
ProductTemplate = self.env['prod... | 41.974026 | 3,232 |
5,559 | py | PYTHON | 15.0 | # coding: utf-8
from odoo.addons.website_sale.controllers.main import WebsiteSale
from odoo.addons.website.tools import MockRequest
from odoo.tests import TransactionCase, tagged
@tagged('post_install', '-at_install')
class WebsiteSaleVisitorTests(TransactionCase):
def setUp(self):
super().setUp()
... | 46.714286 | 5,559 |
4,725 | 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 HttpCase, TransactionCase
from odoo.addons.base.tests.common import HttpCaseWithUserPortal
@tagged('post_install', '-at_install')
class TestWebsiteSaleCartReco... | 37.5 | 4,725 |
5,694 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import datetime
from dateutil.relativedelta import relativedelta
from odoo.tests import tagged
from odoo.addons.base.tests.common import HttpCaseWithUserPortal
@tagged('post_install', '-at_install')
clas... | 43.465649 | 5,694 |
28,993 | 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.addons.base.tests.common import TransactionCaseWithUserDemo, HttpCaseWithUserPortal
from odoo.addons.website.tools import MockRequest
from odoo.addons.website_sale.tests.common i... | 48.645973 | 28,993 |
4,111 | py | PYTHON | 15.0 | # coding: utf-8
from odoo.addons.website_sale.controllers.main import WebsiteSale, PaymentPortal
from odoo.addons.website.tools import MockRequest
from odoo.exceptions import UserError
from odoo.tests.common import TransactionCase, tagged
@tagged('post_install', '-at_install')
class WebsiteSaleCart(TransactionCase):
... | 42.381443 | 4,111 |
13,131 | 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 api
from odoo.addons.base.tests.common import HttpCaseWithUserDemo, TransactionCaseWithUserDemo, HttpCaseWithUserPortal
from odoo.addons.website_sale.controllers.main import WebsiteSal... | 48.453875 | 13,131 |
13,091 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
from odoo.addons.base.tests.common import HttpCaseWithUserDemo, HttpCaseWithUserPortal
from odoo.modules.module import get_module_resource
from odoo.tests import tagged
@tagged('post_install', '-at_install')
class TestUi(HttpCas... | 40.65528 | 13,091 |
999 | 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 TestWebsiteSaleMail(HttpCase):
def test_01_shop_mail_t... | 32.225806 | 999 |
803 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class PaymentWizard(models.TransientModel):
_inherit = 'payment.acquirer.onboarding.wizard'
_name = 'website.sale.payment.acquirer.onboarding.wizard'
_description = 'Website Payment ... | 42.263158 | 803 |
1,443 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models, _
from odoo.exceptions import AccessError
class Digest(models.Model):
_inherit = 'digest.digest'
kpi_website_sale_total = fields.Boolean('eCommerce Sales')
kpi_website_sale... | 46.548387 | 1,443 |
2,759 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import datetime
from dateutil.relativedelta import relativedelta
from odoo import fields,api, models, _
from odoo.exceptions import UserError, ValidationError
class CrmTeam(models.Model):
_inherit = ... | 45.983333 | 2,759 |
462 | 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
class AccountMove(models.Model):
_inherit = 'account.move'
website_id = fields.Many2one('website', related='partner_id.website_id', string='Website',
... | 38.5 | 462 |
461 | 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.http import request
class IrHttp(models.AbstractModel):
_inherit = 'ir.http'
@classmethod
def _dispatch(cls):
affiliate_id = request.httprequest.args.get('affiliate... | 30.733333 | 461 |
377 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class ResCountry(models.Model):
_inherit = 'res.country'
def get_website_sale_countries(self, mode='billing'):
return self.sudo().search([])
def get_website_sale_states(sel... | 26.928571 | 377 |
21,282 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
import random
from datetime import datetime
from dateutil.relativedelta import relativedelta
from odoo import api, models, fields, _
from odoo.http import request
from odoo.osv import expression
from odoo.... | 50.43128 | 21,282 |
2,715 | 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 ValidationError
from odoo.addons.website.tools import get_video_embed_code
class ProductImage(models.Model):
_name = 'product.image'
_... | 43.095238 | 2,715 |
824 | 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 MailComposeMessage(models.TransientModel):
_inherit = 'mail.compose.message'
def _action_send_mail(self, auto_commit=False):
context = self._context
# TODO TD... | 43.368421 | 824 |
21,567 | 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.addons.http_routing.models.ir_http import slug, unslug
from odoo.tools.translate import html_translate
from odoo.osv import expression
class ProductTemplate(models.Mode... | 51.35 | 21,567 |
4,620 | 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
class Product(models.Model):
_inherit = "product.product"
website_id = fields.Many2one(related='product_tmpl_id.website_id', ... | 50.217391 | 4,620 |
440 | 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.http import request
class WabsitePage(models.AbstractModel):
_inherit = 'website.page'
def _get_cache_key(self, req):
cart = request.website.sale_get_order()
ca... | 31.428571 | 440 |
782 | 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 ResCompany(models.Model):
_inherit = 'res.company'
website_sale_onboarding_payment_acquirer_state = fields.Selection([('not_done', "Not done"), ('just_done', "Just do... | 46 | 782 |
9,827 | 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 ValidationError, UserError
from odoo.addons.website.models import ir_http
from odoo.tools.translate import html_translate
class ProductRibbon(m... | 46.13615 | 9,827 |
7,911 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from collections import Counter
from odoo import models, fields, api, _
from odoo.osv import expression
class WebsiteSnippetFilter(models.Model):
_inherit = 'website.snippet.filter'
product_cross_selling = fields.Boolean(string="About cross selling products", default=False,
... | 49.44375 | 7,911 |
4,314 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models, fields
class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
salesperson_id = fields.Many2one('res.users', related='website_id.salesperson_id', string='... | 49.586207 | 4,314 |
1,293 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from collections import OrderedDict
from odoo import models, fields
class ProductAttribute(models.Model):
_inherit = 'product.attribute'
visibility = fields.Selection([('visible', 'Visible'), ('hidden', 'Hidd... | 40.40625 | 1,293 |
22,180 | 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, tools, SUPERUSER_ID, _
from odoo.http import request
from odoo.addons.website.models import ir_http
from odoo.addons.http_routing.models.ir_http import url_for
_log... | 53.317308 | 22,180 |
353 | py | PYTHON | 15.0 | from odoo import fields, models
class BaseUnit(models.Model):
_name = "website.base.unit"
_description = "Unit of Measure for price per unit on eCommerce products."
_order = "name"
name = fields.Char(help="Define a custom unit to display in the price per unit of measure field.",
... | 35.3 | 353 |
1,072 | 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.addons.website.models import ir_http
class ResPartner(models.Model):
_inherit = 'res.partner'
last_website_so_id = fields.Many2one('sale.order', compute='_compute... | 42.88 | 1,072 |
949 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models
class PaymentAcquirer(models.Model):
_inherit = 'payment.acquirer'
@api.model
def _get_compatible_acquirers(self, *args, website_id=None, **kwargs):
""" Override of payment to only return acq... | 36.5 | 949 |
2,385 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import datetime, timedelta
from odoo import fields, models, api
class WebsiteTrack(models.Model):
_inherit = 'website.track'
product_id = fields.Many2one('product.product', index=True, ondelete='... | 49.6875 | 2,385 |
563 | 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 SaleReport(models.Model):
_inherit = 'sale.report'
website_id = fields.Many2one('website', readonly=True)
def _group_by_sale(self, groupby=''):
res = super()._gro... | 31.277778 | 563 |
8,585 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
import babel.dates
from datetime import datetime, timedelta, time
from odoo import fields, http, _
from odoo.addons.website.controllers.backend import WebsiteBackend
from odoo.http import request
from odoo.tools.misc import get_lang
class WebsiteSaleBackend(WebsiteBackend):
@http.route... | 46.912568 | 8,585 |
60,662 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import json
import logging
from werkzeug.exceptions import Forbidden, NotFound
from werkzeug.urls import url_decode, url_encode, url_parse
from odoo import fields, http, SUPERUSER_ID, tools, _
from odoo.fields import Com... | 45.71364 | 60,662 |
1,781 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import http
from odoo.http import request
from odoo.addons.sale.controllers.variant import VariantController
class WebsiteSaleVariantController(VariantController):
@http.route(['/sale/get_combination_info... | 57.451613 | 1,781 |
613 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Units of measure',
'version': '1.0',
'category': 'Sales/Sales',
'depends': ['base'],
'description': """
This is the base module for managing Units of measure.
==============================... | 27.863636 | 613 |
4,562 | 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
class TestUom(TransactionCase):
def setUp(self):
super(TestUom, self).setUp()
self.uom_gram = self.env.ref(... | 39.327586 | 4,562 |
11,755 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import timedelta
from odoo import api, fields, tools, models, _
from odoo.exceptions import UserError, ValidationError
class UoMCategory(models.Model):
_name = 'uom.category'
_description = 'Prod... | 45.7393 | 11,755 |
737 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Margins by Products',
'category': 'Sales/Sales',
'description': """
Adds a reporting menu in products that computes sales, purchases, margins and other interesting indicators based on invoices.
==... | 35.095238 | 737 |
2,640 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.account.tests.common import AccountTestInvoicingCommon
from odoo.tests import tagged
@tagged('post_install', '-at_install')
class TestProductMargin(AccountTestInvoicingCommon):
def test_product_mar... | 39.402985 | 2,640 |
1,853 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import time
from odoo import api, fields, models, _
class ProductMargin(models.TransientModel):
_name = 'product.margin'
_description = 'Product Margin'
from_date = fields.Date('From', default=time.strfti... | 33.089286 | 1,853 |
11,647 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import time
from odoo import api, fields, models
class ProductProduct(models.Model):
_inherit = "product.product"
date_from = fields.Date(compute='_compute_product_margin_fields_values', string='Margin Date F... | 64.348066 | 11,647 |
528 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
{
'name': 'Payment - Account',
'category': 'Accounting/Accounting',
'summary': 'Account and Payment Link and Portal',
'version': '1.0',
'description': """Link Account and Payment and add Portal Payment
Provide tools for account-related payment as well as portal options to
e... | 24 | 528 |
2,990 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.http import request
from odoo.addons.account.controllers import portal
from odoo.addons.payment.controllers.portal import PaymentPortal
from odoo.addons.portal.controllers.portal import _build_url_w_params
c... | 51.551724 | 2,990 |
1,909 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.exceptions import AccessError, MissingError, ValidationError
from odoo.fields import Command
from odoo.http import request, route
from odoo.addons.payment.controllers import portal as payment_portal
class Pa... | 46.560976 | 1,909 |
704 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Memos pad',
'version': '0.1',
'category': 'Productivity/Notes',
'description': """
This module update memos inside Odoo for using an external pad
===============================================... | 25.142857 | 704 |
344 | 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 NotePad(models.Model):
_name = 'note.note'
_inherit = ['pad.common', 'note.note']
_pad_fields = ['note_pad']
note_pad_url = fields.Char('Pad Url', pad_content_fi... | 24.571429 | 344 |
593 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'POS Adyen',
'version': '1.0',
'category': 'Sales/Point of Sale',
'sequence': 6,
'summary': 'Integrate your POS with an Adyen payment terminal',
'description': '',
'data': [
'... | 26.954545 | 593 |
987 | 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, _
from odoo.exceptions import ValidationError
_logger = logging.getLogger(__name__)
class PosConfig(models.Model):
_inherit = 'pos.config'
adyen_ask_customer_for_t... | 39.48 | 987 |
5,366 | py | PYTHON | 15.0 | # coding: utf-8
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import json
import logging
import pprint
import random
import requests
import string
from werkzeug.exceptions import Forbidden
from odoo import fields, models, api, _
from odoo.exceptions import ValidationError
_logger = loggin... | 43.626016 | 5,366 |
1,427 | py | PYTHON | 15.0 | # coding: utf-8
import logging
import pprint
import json
from odoo import fields, http
from odoo.http import request
_logger = logging.getLogger(__name__)
class PosAdyenController(http.Controller):
@http.route('/pos_adyen/notification', type='json', methods=['POST'], auth='none', csrf=False)
def notification... | 43.242424 | 1,427 |
625 | py | PYTHON | 15.0 | {
'name': '2FA by mail',
'description': """
2FA by mail
===============
Two-Factor authentication by sending a code to the user email inbox
when the 2FA using an authenticator app is not configured.
To enforce users to use a two-factor authentication by default,
and encourage users to configure their 2FA using ... | 31.25 | 625 |
5,493 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import babel.dates
import logging
from datetime import datetime, timedelta
from odoo import _, models
from odoo.exceptions import AccessDenied, UserError
from odoo.http import request
from odoo.tools.misc import babel_l... | 37.114865 | 5,493 |
1,030 | 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 ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
auth_totp_enforce = fields.Boolean(
string="Enforce two-factor authentication",
... | 32.1875 | 1,030 |
692 | py | PYTHON | 15.0 | from odoo import fields, models
class AuthTotpRateLimitLog(models.TransientModel):
_name = 'auth.totp.rate.limit.log'
_description = 'TOTP rate limit logs'
def init(self):
self.env.cr.execute("""
CREATE INDEX IF NOT EXISTS auth_totp_rate_limit_log_user_id_limit_type_create_date_idx
... | 34.6 | 692 |
1,052 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
import odoo.addons.auth_totp.controllers.home
from odoo import http
from odoo.exceptions import AccessDenied, UserError
from odoo.http import request
class Home(odoo.addons.auth_totp.controllers.home.Home):
@http.route()
def web_totp(self, redirect=None, **kwargs):
response = ... | 40.461538 | 1,052 |
997 | py | PYTHON | 15.0 | {
'name': 'eCommerce Delivery',
'category': 'Website/Website',
'summary': 'Add delivery costs to online sales',
'version': '1.0',
'description': """
Add a selection of delivery methods to your eCommerce store.
Configure your own methods with a pricing grid or integrate with carriers for a fully auto... | 32.16129 | 997 |
2,604 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
import odoo.tests
@odoo.tests.tagged('post_install', '-at_install')
class TestUi(odoo.tests.HttpCase):
def test_01_free_delivery_when_exceed_threshold(self):
# Avoid Shipping/Billing address page
self.env.ref('ba... | 36.676056 | 2,604 |
1,832 | 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.exceptions import UserError
from odoo.addons.payment.tests.common import PaymentCommon
from odoo.addons.website_sale_delivery.controllers.main import WebsiteSaleDelivery
from od... | 50.888889 | 1,832 |
409 | 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 DeliveryCarrier(models.Model):
_name = 'delivery.carrier'
_inherit = ['delivery.carrier', 'website.published.multi.mixin']
website_description = fields.Text(related='p... | 37.181818 | 409 |
1,576 | 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 ResCountry(models.Model):
_inherit = 'res.country'
def get_website_sale_countries(self, mode='billing'):
res = super(ResCountry, self).get_website_sale_countries(m... | 38.439024 | 1,576 |
4,389 | 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
_logger = logging.getLogger(__name__)
class SaleOrder(models.Model):
_inherit = 'sale.order'
amount_delivery = fields.Monetary(
compute='_compute_am... | 46.691489 | 4,389 |
6,348 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import http, _
from odoo.http import request
from odoo.addons.website_sale.controllers.main import WebsiteSale
from odoo.exceptions import UserError
class WebsiteSaleDelivery(WebsiteSale):
@http.route()
... | 49.984252 | 6,348 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.