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 |
|---|---|---|---|---|---|---|
449 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from odoo import fields, models
class PhoneBlacklistRemove(models.TransientModel):
_name = 'phone.blacklist.remove'
_description = 'Remove phone from blacklist'
phone = fields.Char(string="Phone Number", readonly=True, required=True)
reason = fields.Char(name="Reason")
d... | 32.071429 | 449 |
12,316 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import re
from odoo import api, fields, models, _
from odoo.addons.phone_validation.tools import phone_validation
from odoo.exceptions import AccessError, UserError
from odoo.osv import expression
class PhoneMixin(mod... | 51.078838 | 12,310 |
5,580 | 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.addons.phone_validation.tools import phone_validation
from odoo.exceptions import UserError
_logger = logging.getLogger(__name__)
class PhoneBlackList(... | 42.923077 | 5,580 |
1,798 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models
from odoo.addons.phone_validation.tools import phone_validation
class Partner(models.Model):
_name = 'res.partner'
_inherit = ['res.partner']
@api.onchange('phone', 'country_id', 'company_id')
def... | 40.863636 | 1,798 |
317 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
try:
# import for usage in phonenumbers_patch/region_*.py files
from phonenumbers.phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata # pylint: disable=unused-import
except ImportError:
pass
| 39.625 | 317 |
935 | py | PYTHON | 15.0 | """Auto-generated file, do not edit by hand. CI metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_CI = PhoneMetadata(id='CI', country_code=225, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[02]\\d{9}', possible_length=(10,)),
... | 103.888889 | 935 |
574 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
{
'name': 'Booths Sale/Exhibitors Bridge',
'category': 'Marketing/Events',
'version': '1.0',
'summary': 'Bridge module between website_event_booth_exhibitor and website_event_booth_sale.',
'description': """
""",
'depends': ['website_event_exhibitor', 'website_event_... | 30.210526 | 574 |
956 | 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 EventBoothRegistration(models.Model):
_inherit = 'event.booth.registration'
sponsor_name = fields.Char(string='Sponsor Name')
sponsor_email = fields.Char(string='Spons... | 45.52381 | 956 |
603 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
{
'name': "snailmail_account",
'description': """
Allows users to send invoices by post
=====================================================
""",
'category': 'Hidden/Tools',
'version': '0.1',
'depends': ['account', 'snailmail'],
'data': [
'views/res_confi... | 26.217391 | 603 |
3,108 | py | PYTHON | 15.0 |
import requests
import json
import base64
import logging
from odoo.tests.common import HttpCase
from odoo.tests import tagged
_logger = logging.getLogger(__name__)
@tagged('post_install', '-at_install', '-standard', 'external')
class TestPingenSend(HttpCase):
def setUp(self):
super(TestPingenSend, self... | 38.37037 | 3,108 |
4,445 | 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, Command, _
from odoo.exceptions import UserError
class AccountInvoiceSend(models.TransientModel):
_name = 'account.invoice.send'
_inherit = 'account.invoice.send'
_desc... | 44.89899 | 4,445 |
585 | 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 SnailmailConfirmInvoiceSend(models.TransientModel):
_name = 'snailmail.confirm.invoice'
_inherit = ['snailmail.confirm']
_description = 'Snailmail Confirm Invoice'... | 29.25 | 585 |
273 | 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 Company(models.Model):
_inherit = "res.company"
invoice_is_snailmail = fields.Boolean(string='Send by Post', default=False)
| 27.3 | 273 |
349 | 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'
invoice_is_snailmail = fields.Boolean(string='Send by Post', related='company_id.invoice_is... | 34.9 | 349 |
594 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Margins in Sales Orders',
'version':'1.0',
'category': 'Sales/Sales',
'description': """
This module adds the 'Margin' on sales order.
=============================================
This gives ... | 31.263158 | 594 |
8,068 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests import common
from datetime import datetime
class TestSaleMargin(common.TransactionCase):
def setUp(self):
super(TestSaleMargin, self).setUp()
self.SaleOrder = self.env['sale.order'... | 52.732026 | 8,068 |
3,975 | 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 SaleOrderLine(models.Model):
_inherit = "sale.order.line"
margin = fields.Float(
"Margin", compute='_compute_margin',
digits='Product Price', store=Tru... | 45.170455 | 3,975 |
471 | 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 SaleReport(models.Model):
_inherit = 'sale.report'
margin = fields.Float('Margin')
def _select_additional_fields(self, fields):
fields['margin'] = ", SUM(l.ma... | 33.642857 | 471 |
2,686 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Expenses',
'version': '2.0',
'category': 'Human Resources/Expenses',
'sequence': 70,
'summary': 'Submit, validate and reinvoice employee expenses',
'description': """
Manage expenses b... | 39.470588 | 2,684 |
5,585 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.hr_expense.tests.common import TestExpenseCommon
from odoo.tests import tagged
@tagged('-at_install', 'post_install')
class TestExpensesMailImport(TestExpenseCommon):
@classmethod
def setUpClas... | 36.503268 | 5,585 |
23,392 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.hr_expense.tests.common import TestExpenseCommon
from odoo.tests import tagged, Form
from odoo.tools.misc import formatLang
from odoo import fields
@tagged('-at_install', 'post_install')
class TestExpen... | 44.984615 | 23,392 |
2,337 | 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.addons.mail.tests.common import mail_new_test_user
class TestExpenseCommon(AccountTestInvoicingCommon):
@classmethod
def setUpC... | 41 | 2,337 |
4,928 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.hr_expense.tests.common import TestExpenseCommon
from odoo.exceptions import AccessError, UserError
from odoo.tests import tagged
@tagged('-at_install', 'post_install')
class TestExpensesAccessRights(Te... | 42.852174 | 4,928 |
4,997 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.hr_expense.tests.common import TestExpenseCommon
from odoo.tests import tagged
from odoo.exceptions import UserError
@tagged('post_install', '-at_install')
class TestExpenseMultiCompany(TestExpenseCommo... | 43.077586 | 4,997 |
1,651 | 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 HrExpenseRefuseWizard(models.TransientModel):
"""This wizard can be launched from an he.expense (an expense line)
or from an hr.expense.sheet (En expense report)
'... | 36.688889 | 1,651 |
1,107 | 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 HrExpenseApproveDuplicate(models.TransientModel):
"""
This wizard is shown whenever an approved expense is similar to one being
approved. The user has the oppor... | 32.558824 | 1,107 |
1,963 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from odoo import models, fields, api, _
class AccountPaymentRegister(models.TransientModel):
_inherit = 'account.payment.register'
# -------------------------------------------------------------------------
# BUSINESS METHODS
# ------------------------------------------------... | 47.878049 | 1,963 |
597 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, _
class AccountMove(models.Model):
_inherit = "account.move"
def button_cancel(self):
for l in self.line_ids:
if l.expense_id:
l.expense_id.refuse_e... | 29.85 | 597 |
64,206 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import re
from markupsafe import Markup
from odoo import api, fields, Command, models, _
from odoo.exceptions import UserError, ValidationError
from odoo.tools import email_split, float_is_zero, float_repr
from odoo.tool... | 52.757601 | 64,206 |
1,585 | 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 AccountMove(models.Model):
_inherit = "account.move"
def _payment_state_matters(self):
self.ensure_one()
if self.line_ids.expense_id:
retur... | 44.027778 | 1,585 |
786 | 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 HrDepartment(models.Model):
_inherit = 'hr.department'
def _compute_expense_sheets_to_approve(self):
expense_sheet_data = self.env['hr.expense.sheet'].read_group([... | 49.125 | 786 |
829 | 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"
@api.model
def default_get(self, fields):
result = super(ProductTemplate, self).default_get(f... | 37.681818 | 829 |
2,017 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models
from odoo.tools.misc import formatLang
class AccountJournal(models.Model):
_inherit = "account.journal"
def _get_expenses_to_pay_query(self):
"""
Returns a tuple co... | 45.840909 | 2,017 |
2,467 | 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 Employee(models.Model):
_inherit = 'hr.employee'
def _group_hr_expense_user_domain(self):
# We return the domain only if the group exists for the following re... | 45.685185 | 2,467 |
1,260 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from odoo import api, fields, models
class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
expense_alias_prefix = fields.Char('Default Alias Name for Expenses', compute='_compute_expense_alias_prefix',
store=True, readonly=False)
use_mailgateway... | 39.375 | 1,260 |
549 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Send SMS to Visitor',
'category': 'Website/Website',
'sequence': 54,
'summary': 'Allows to send sms to website visitor',
'version': '1.0',
'description': """Allows to send sms to website... | 32.294118 | 549 |
1,530 | 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.exceptions import UserError
class WebsiteVisitor(models.Model):
_inherit = 'website.visitor'
def _check_for_sms_composer(self):
""" Purpose of this method is to act... | 38.25 | 1,530 |
681 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Website Mail',
'category': 'Hidden',
'summary': 'Website Module for Mail',
'version': '0.1',
'description': """
Module holding mail improvements for website. It holds the follow widget.
"""... | 27.24 | 681 |
392 | 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 PublisherWarrantyContract(models.AbstractModel):
_inherit = "publisher_warranty.contract"
@api.model
def _get_message(self):
msg = super(PublisherWarrantyContract... | 28 | 392 |
3,308 | 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
class WebsiteMail(http.Controller):
@http.route(['/website_mail/follow'], type='json', auth="public", website=True)
def website_message_subscribe(self, id=0, ... | 41.873418 | 3,308 |
541 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Lead Livechat Sessions',
'category': 'Website/Website',
'summary': 'View livechat sessions for leads',
'version': '1.0',
'description': """ Adds a stat button on lead form view to access the... | 33.8125 | 541 |
874 | 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 Lead(models.Model):
_inherit = 'crm.lead'
visitor_sessions_count = fields.Integer('# Sessions', compute="_compute_visitor_sessions_count", groups="im_livechat.im_live... | 41.619048 | 874 |
777 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class MailChannel(models.Model):
_inherit = 'mail.channel'
def _convert_visitor_to_lead(self, partner, key):
""" When website is installed, we can link the created lead from /le... | 40.894737 | 777 |
409 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
{
'name': "account_qr_code_sepa",
'description': """
This module adds support for SEPA Credit Transfer QR-code generation.
""",
'category': 'Accounting/Payment',
'version': '0.1',
# any module necessary for this one to work correctly
'depends': ['account', ... | 20.45 | 409 |
3,432 | py | PYTHON | 15.0 | # -*- coding:utf-8 -*-
from odoo.exceptions import UserError
from odoo.addons.account.tests.common import AccountTestInvoicingCommon
from odoo.tests import tagged
from odoo import fields
@tagged('post_install', '-at_install')
class TestSEPAQRCode(AccountTestInvoicingCommon):
""" Tests the generation of Swiss QR-c... | 44 | 3,432 |
3,939 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from odoo import models, fields, api, _
class ResPartnerBank(models.Model):
_inherit = 'res.partner.bank'
def _get_qr_vals(self, qr_method, amount, currency, debtor_partner, free_communication, structured_communication):
if qr_method == 'sct_qr':
comment = (free_c... | 60.569231 | 3,937 |
695 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': "Website Sale Gift Card",
'summary': "Use gift card in eCommerce",
'description': """Integrate gift card mechanism in your ecommerce.""",
'category': 'Website/Website',
'version': '1.0',
... | 27.8 | 695 |
1,195 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class SaleOrder(models.Model):
_inherit = "sale.order"
def _compute_website_order_line(self):
super()._compute_website_order_line()
for order in self:
order.... | 36.212121 | 1,195 |
541 | 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 GiftCard(models.Model):
_name = "gift.card"
_inherit = ['website.multi.mixin', 'gift.card']
website_id = fields.Many2one('website', related='buy_line_id.order_id.websi... | 36.066667 | 541 |
1,440 | 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 import main
class GiftCardController(main.WebsiteSale):
@http.route('/shop/pay_with_gift_card', type='http', methods=['... | 42.352941 | 1,440 |
551 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Account Sale Timesheet',
'version': '1.0',
'category': 'Account/sale/timesheet',
'summary': 'Account sale timesheet',
'description': 'Bridge created to add the number of invoices linked to... | 29 | 551 |
987 | 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'
invoice_count = fields.Integer(related='analytic_account_id.invoice_count', groups='account.group_account_readonly'... | 36.555556 | 987 |
745 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Saudi Arabia - Point of Sale',
'author': 'Odoo S.A',
'category': 'Accounting/Localizations/Point of Sale',
'description': """
K.S.A. POS Localization
============================================... | 29.8 | 745 |
497 | 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.exceptions import UserError
from odoo.tools.translate import _
class pos_config(models.Model):
_inherit = 'pos.config'
def open_ui(self):
for config in self:
... | 33.133333 | 497 |
443 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
from odoo import fields, api, models
class POSOrder(models.Model):
_inherit = 'pos.order'
def _prepare_invoice_vals(self):
vals = super()._prepare_invoice_vals()
if self.company_i... | 29.533333 | 443 |
679 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Hong Kong - Accounting',
'version': '1.0',
'category': 'Accounting/Localizations/Account Charts',
'description': """ This is the base module to manage chart of accounting and localization for H... | 32.333333 | 679 |
517 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'SMS in CRM',
'version': '1.1',
'category': 'Sales/CRM',
'summary': 'Add SMS capabilities to CRM',
'description': "",
'depends': ['crm', 'sms'],
'data': [
'views/crm_lead_vie... | 25.85 | 517 |
1,222 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.crm.tests.common import TestCrmCommon
from odoo.tests.common import users
class TestCRMLead(TestCrmCommon):
@users('user_sales_manager')
def test_phone_mobile_update(self):
lead = self... | 42.137931 | 1,222 |
576 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Purchase and Subcontracting Management',
'version': '0.1',
'category': 'Manufacturing/Purchase',
'description': """
This bridge module adds some smart buttons between Purchase and Subco... | 30.315789 | 576 |
8,328 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import Command
from odoo.exceptions import UserError
from odoo.tests import Form
from odoo.addons.mrp_subcontracting.tests.common import TestMrpSubcontractingCommon
class MrpSubcontractingPurchaseTest(TestMr... | 43.375 | 8,328 |
1,415 | 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
class PurchaseOrder(models.Model):
_inherit = 'purchase.order'
subcontracting_resupply_picking_count = fields.Integer(
"Count of Subcontracting Resupply", compute='... | 45.645161 | 1,415 |
1,637 | 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, _
class StockPicking(models.Model):
_inherit = 'stock.picking'
subcontracting_source_purchase_count = fields.Integer(
"Number of subcontracting PO Source", compute... | 40.925 | 1,637 |
904 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Unsplash Image Library',
'category': 'Hidden',
'summary': 'Find free high-resolution images from Unsplash',
'version': '1.1',
'description': """Explore the free high-resolution image library... | 37.666667 | 904 |
977 | py | PYTHON | 15.0 | from werkzeug import urls
from odoo import models, api
class Image(models.AbstractModel):
_inherit = 'ir.qweb.field.image'
@api.model
def from_html(self, model, field, element):
if element.find('.//img') is None:
return False
url = element.find('.//img').get('src')
ur... | 32.566667 | 977 |
804 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class ResUsers(models.Model):
_inherit = 'res.users'
def _has_unsplash_key_rights(self, mode='write'):
self.ensure_one()
# Website has no dependency to web_unsplash, we c... | 47.294118 | 804 |
311 | 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'
unsplash_access_key = fields.Char("Access Key", config_parameter='unsplash.access_key')
| 34.555556 | 311 |
6,147 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
import logging
import mimetypes
import requests
import werkzeug.utils
from odoo import http, tools, _
from odoo.http import request
from odoo.tools.mimetypes import guess_mimetype
from werkzeug.urls import ... | 40.98 | 6,147 |
1,295 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
{
'name': "Website Sale Product Configurator",
'summary': """
Bridge module for website_sale / sale_product_configurator""",
'description': """
Bridge module to make the website e-commerce compatible with the product configurator
""",
'category': 'Hidden',
... | 40.46875 | 1,295 |
6,138 | 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.addons.sale_product_configurator.tests.common import TestProductConfiguratorCommon
from odoo.addons.base.tests.common import HttpCaseWithUserPortal
@tagged('post_install', '-at_i... | 42.331034 | 6,138 |
716 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests.common import HttpCase
from odoo.addons.sale_product_configurator.tests.common import TestProductConfiguratorCommon
from odoo.tests import tagged
@tagged('post_install', '-at_install')
class TestUi(HttpCase, TestProductConfigu... | 47.733333 | 716 |
1,077 | 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 SaleOrder(models.Model):
_inherit = "sale.order"
def _cart_find_product_line(self, product_id=None, line_id=None, **kwargs):
lines = super(SaleOrder, self)._cart_find... | 43.08 | 1,077 |
4,983 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import json
from odoo import http
from odoo.http import request
from odoo.addons.sale_product_configurator.controllers.main import ProductConfiguratorController
from odoo.addons.website_sale.controllers import main
cla... | 52.452632 | 4,983 |
714 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Online Members Directory',
'category': 'Website/Website',
'summary': 'Publish your members directory',
'version': '1.0',
'description': """
Publish your members/association directory public... | 32.454545 | 714 |
499 | 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.addons.http_routing.models.ir_http import url_for
class Website(models.Model):
_inherit = "website"
def get_suggested_controllers(self):
suggested_controllers = sup... | 35.642857 | 499 |
716 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class MembershipLine(models.Model):
_inherit = 'membership.membership_line'
def _get_published_companies(self, limit=None):
if not self.ids:
return []
limit_... | 37.684211 | 716 |
8,315 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import werkzeug.urls
from odoo import fields
from odoo import http
from odoo.http import request
from odoo.addons.http_routing.models.ir_http import unslug
from odoo.tools.translate import _
class WebsiteMembership(h... | 48.063584 | 8,315 |
1,700 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
{
'name': 'Events Sales',
'version': '1.2',
'category': 'Marketing/Events',
'website': 'https://www.odoo.com/app/events',
'description': """
Creating registration with sales orders.
========================================
This module allows you to automate and connect your... | 34 | 1,700 |
12,071 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.event_sale.tests.common import TestEventSaleCommon
from odoo.addons.mail.tests.common import mail_new_test_user
from odoo.tests import tagged
from odoo.tests.common import users
@tagged('event_flow')
... | 42.957295 | 12,071 |
2,465 | 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
from odoo.addons.event_sale.tests.common import TestEventSaleCommon
from odoo.tests.common import Form
class TestEventSpecific(TestEventSaleCommon):
... | 46.509434 | 2,465 |
665 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.event.tests.common import TestEventCommon
from odoo.addons.sales_team.tests.common import TestSalesCommon
class TestEventSaleCommon(TestEventCommon, TestSalesCommon):
@classmethod
def setUpCla... | 33.25 | 665 |
6,404 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import date, datetime, timedelta
from unittest.mock import patch
from odoo.addons.event_sale.tests.common import TestEventSaleCommon
from odoo.fields import Datetime as FieldsDatetime, Date as FieldsDate
f... | 45.098592 | 6,404 |
950 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import timedelta
from odoo.fields import Datetime
from odoo.tests import HttpCase, tagged
@tagged('post_install', '-at_install')
class TestUi(HttpCase):
def test_event_configurator(self):
event = self.env['event.e... | 32.758621 | 950 |
4,573 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from odoo import models, fields, api
class RegistrationEditor(models.TransientModel):
_name = "registration.editor"
_description = 'Edit Attendee Details on Sales Confirmation'
sale_order_id = fields.Many2one('sale.order', 'Sales Order', required=True, ondelete='cascade')
eve... | 47.14433 | 4,573 |
492 | 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 EventConfigurator(models.TransientModel):
_name = 'event.event.configurator'
_description = 'Event Configurator'
product_id = fields.Many2one('product.product', string... | 37.846154 | 492 |
594 | 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 AccountMove(models.Model):
_inherit = 'account.move'
def action_invoice_paid(self):
""" When an invoice linked to a sales order selling registrations is
paid ... | 37.125 | 594 |
7,878 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from odoo import api, fields, models, _
class SaleOrder(models.Model):
_inherit = "sale.order"
attendee_count = fields.Integer('Attendee Count', compute='_compute_attendee_count')
def write(self, vals):
""" Synchronize partner from SO to registrations. This is done notab... | 47.457831 | 7,878 |
6,102 | 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.tools import float_is_zero
class EventRegistration(models.Model):
_inherit = 'event.registration'
is_paid = fields.Boolean('Is Paid')
# TDE FIXME: maybe add a... | 45.879699 | 6,102 |
3,705 | 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 Event(models.Model):
_inherit = 'event.event'
sale_order_lines_ids = fields.One2many(
'sale.order.line', 'event_id',
groups='sales_team.group_sale_sal... | 43.588235 | 3,705 |
221 | py | PYTHON | 15.0 | from odoo import fields, models
class SaleOrderTemplateLine(models.Model):
_inherit = "sale.order.template.line"
product_id = fields.Many2one(domain="[('sale_ok', '=', True), ('detailed_type', '!=', 'event')]")
| 36.833333 | 221 |
751 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from odoo import api, fields, models
class ProductTemplate(models.Model):
_inherit = 'product.template'
detailed_type = fields.Selection(selection_add=[
('event', 'Event Ticket'),
], ondelete={'event': 'set service'})
@api.onchange('detailed_type')
def _onchange_... | 27.814815 | 751 |
225 | py | PYTHON | 15.0 | from odoo import fields, models
class SaleOrderTemplateOption(models.Model):
_inherit = "sale.order.template.option"
product_id = fields.Many2one(domain="[('sale_ok', '=', True), ('detailed_type', '!=', 'event')]")
| 37.5 | 225 |
5,454 | 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 EventTemplateTicket(models.Model):
_inherit = 'event.type.ticket'
def _default_product_id(self):
return... | 41.953846 | 5,454 |
850 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': "Sales - Project",
'summary': "Task Generation from Sales Orders",
'description': """
Allows to create task from your sales order
=============================================
This module allows to g... | 34 | 850 |
12,340 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import Command
from odoo.tests.common import TransactionCase, users
class TestSaleProject(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.analytic_accoun... | 48.011673 | 12,339 |
12,517 | 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, new_test_user
class TestNestedTaskUpdate(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.partner = cls.env['res.partn... | 56.116592 | 12,514 |
21,125 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, Command, fields, models, _
from odoo.tools.safe_eval import safe_eval
from odoo.tools.sql import column_exists, create_column
class SaleOrder(models.Model):
_inherit = 'sale.order'
tasks... | 53.616751 | 21,125 |
5,985 | 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 ProductTemplate(models.Model):
_inherit = 'product.template'
service_tracking = fields.Selection(
selection=[
... | 48.658537 | 5,985 |
12,605 | 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 odoo import api, fields, models, _, _lt
from odoo.exceptions import ValidationError, UserError
from odoo.osv import expression
from odoo.osv.query import Query
class Project(models.Mo... | 46.858736 | 12,605 |
469 | 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 ReportProjectTaskUser(models.Model):
_inherit = "report.project.task.user"
sale_order_id = fields.Many2one('sale.order', string='Sales Order', readonly=True)
def _sel... | 29.3125 | 469 |
2,011 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from operator import itemgetter
from odoo import _
from odoo.http import request
from odoo.tools import groupby as groupbyelem
from odoo.osv.expression import OR
from odoo.addons.project.controllers.portal import Proj... | 46.767442 | 2,011 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.