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 |
|---|---|---|---|---|---|---|
1,250 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Delivery Costs',
'version': '1.0',
'category': 'Inventory/Delivery',
'description': """
Allows you to add delivery methods in sale orders and picking.
=========================================... | 34.722222 | 1,250 |
5,311 | py | PYTHON | 15.0 | from odoo.tests import Form
from odoo.tests.common import TransactionCase
class TestCarrierPropagation(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
# For performances reasons
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))
cl... | 42.488 | 5,311 |
4,555 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.stock.tests.test_packing import TestPackingCommon
class TestPacking(TestPackingCommon):
@classmethod
def setUpClass(cls):
super(TestPacking, cls).setUpClass()
cls.uom_kg = cls.... | 42.971698 | 4,555 |
10,563 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from odoo.addons.account.tests.common import AccountTestInvoicingCommon
from odoo.tests import tagged, Form
@tagged('post_install', '-at_install')
class StockMoveInvoice(AccountTestInvoicingCommon):
@classmethod
def setUpClass(cls, chart_template_ref=None):
super().setUpClass... | 43.829876 | 10,563 |
17,762 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from odoo.tests import common, Form
from odoo.tools import float_compare
@common.tagged('post_install', '-at_install')
class TestDeliveryCost(common.TransactionCase):
def setUp(self):
super(TestDeliveryCost, self).setUp()
self.SaleOrder = self.env['sale.order']
se... | 43.748768 | 17,762 |
4,044 | 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.exceptions import UserError
class ChooseDeliveryCarrier(models.TransientModel):
_name = 'choose.delivery.carrier'
_description = 'Delivery Carrier Selection Wiz... | 43.021277 | 4,044 |
3,506 | 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.float_utils import float_compare
class ChooseDeliveryPackage(models.TransientModel):
_name = 'choose.delivery.package'
_description = 'Delivery Package Se... | 51.558824 | 3,506 |
9,146 | 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, _
from odoo.exceptions import UserError
class SaleOrder(models.Model):
_inherit = 'sale.order'
carrier_id = fields.Many2one('delivery.carrier', string="Delivery Method", d... | 44.614634 | 9,146 |
371 | 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'
property_delivery_carrier_id = fields.Many2one('delivery.carrier', company_dependent=True, string="Delivery Method", hel... | 37.1 | 371 |
407 | 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 ProductTemplate(models.Model):
_inherit = 'product.template'
hs_code = fields.Char(
string="HS Code",
help="Standardized code for international shipping an... | 31.307692 | 407 |
3,793 | 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.sql import column_exists, create_column
class StockMove(models.Model):
_inherit = 'stock.move'
def _auto_init(self):
if not column_exists(self.env.c... | 49.907895 | 3,793 |
16,326 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import json
from collections import defaultdict
from odoo import models, fields, api, _
from odoo.exceptions import UserError
from odoo.tools.sql import column_exists, create_column
class StockQuantPackage(models.Mode... | 50.233846 | 16,326 |
6,960 | 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, _
from odoo.tools.safe_eval import safe_eval
from odoo.exceptions import UserError, ValidationError
class PriceRule(models.Model):
_name = "delivery.price.rule"
_descriptio... | 45.789474 | 6,960 |
749 | 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 PackageType(models.Model):
_inherit = 'stock.package.type'
shipper_package_code = fields.Char('Carrier Code')
package_carrier_type = fields.Selection([('none', 'N... | 39.421053 | 749 |
13,290 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
import psycopg2
from odoo import api, fields, models, registry, SUPERUSER_ID, _
_logger = logging.getLogger(__name__)
class DeliveryCarrier(models.Model):
_name = 'delivery.carrier'
_descriptio... | 44.747475 | 13,290 |
1,893 | py | PYTHON | 15.0 | #-*- coding:utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Email Gateway',
'version': '1.0',
'depends': ['mail'],
'category': 'Hidden/Tools',
'description': """
Retrieve incoming email on POP/IMAP servers.
============================================... | 39.4375 | 1,893 |
12,411 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
import poplib
import socket
from imaplib import IMAP4, IMAP4_SSL
from poplib import POP3, POP3_SSL
from socket import gaierror, timeout
from ssl import SSLError
from odoo import api, fields, models, tool... | 50.044355 | 12,411 |
304 | 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 MailMail(models.Model):
_inherit = 'mail.mail'
fetchmail_server_id = fields.Many2one('fetchmail.server', "Inbound Mail Server", readonly=True, index=True)
| 30.4 | 304 |
1,969 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Purchase',
'version': '1.2',
'category': 'Inventory/Purchase',
'sequence': 35,
'summary': 'Purchase orders, tenders and agreements',
'description': "",
'website': 'https://www.odoo.... | 33.948276 | 1,969 |
1,408 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
def convert_field(cr, model, field, target_model):
table = model.replace('.', '_')
cr.execute("""SELECT 1
FROM information_schema.columns
WHERE table_name = %s
AND column_name = %s
""", (table, field))
if no... | 40.228571 | 1,408 |
3,835 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
from datetime import datetime, timedelta
from odoo import models
from odoo.tools import populate, groupby
from odoo.addons.stock.populate.stock import COMPANY_NB_WITH_STOCK
_logger = logging.getLogger(__... | 41.684783 | 3,835 |
7,354 | 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 Form, tagged
from odoo.exceptions import AccessError
@tagged('post_install', '-at_install')
class TestPurchaseInvoice(Accoun... | 43.514793 | 7,354 |
13,695 | 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, Form
from odoo import fields
from datetime import timedelta
@tagged('-at_install', 'post_install')
class TestPurch... | 40.517751 | 13,695 |
32,566 | 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
from odoo.tests.common import Form
from odoo import Command, fields
@tagged('post_install', '-at_install')
class Test... | 46.127479 | 32,566 |
6,116 | 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 Form, tagged
from datetime import datetime, timedelta
@tagged('post_install', '-at_install')
class TestPurchaseOrderReport(... | 39.458065 | 6,116 |
4,483 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from odoo import fields, Command
from odoo.addons.account.tests.common import AccountTestInvoicingCommon
from odoo.tests import tagged
from odoo.exceptions import UserError
@tagged('post_install', '-at_install')
class TestAccruedPurchaseOrders(AccountTestInvoicingCommon):
@classmethod
... | 49.811111 | 4,483 |
1,201 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from odoo.addons.account.tests.test_invoice_tax_totals import TestTaxTotals
from odoo.tests import tagged
@tagged('post_install', '-at_install')
class PurchaseTestTaxTotals(TestTaxTotals):
@classmethod
def setUpClass(cls, chart_template_ref=None):
super().setUpClass(chart_temp... | 33.361111 | 1,201 |
636 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# purches Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class MailComposeMessage(models.TransientModel):
_inherit = 'mail.compose.message'
def _action_send_mail(self, auto_commit=False):
if self.model == 'purchase.order':
... | 42.4 | 636 |
72,222 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import datetime, time
from dateutil.relativedelta import relativedelta
from functools import partial
from itertools import groupby
import json
from markupsafe import escape, Markup
from pytz import timezone... | 50.968243 | 72,222 |
6,636 | 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'
purchase_vendor_bill_id = fields.Many2one('purchase.bill.union', store=False, readonly=True,
states={'... | 44.837838 | 6,636 |
1,335 | 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'
po_lead = fields.Float(string='Purchase Lead Time', required=True,
help="Margin of error for vendor lead times. When... | 47.678571 | 1,335 |
4,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, _
from odoo.addons.base.models.res_partner import WARNING_MESSAGE, WARNING_HELP
from odoo.tools.float_utils import float_round
from dateutil.relativedelta import relativedelta
clas... | 46.127451 | 4,705 |
2,815 | 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'
lock_confirmed_po = fields.Boolean("Lock Confirmed Orders", default=lambda self: self.env.c... | 63.977273 | 2,815 |
1,265 | 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 AccountAnalyticAccount(models.Model):
_inherit = 'account.analytic.account'
purchase_order_count = fields.Integer("Purchase Order Count", compute='_compute_purchas... | 37.205882 | 1,265 |
3,332 | 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.base.models.res_partner import WARNING_MESSAGE, WARNING_HELP
class res_partner(models.Model):
_name = 'res.partner'
_inherit = 'res.partner'
def _compu... | 50.484848 | 3,332 |
11,509 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
#
# Please note that these reports are not multi-currency !!!
#
import re
from odoo import api, fields, models, tools
from odoo.exceptions import UserError
from odoo.osv.expression import AND, expression
class Purcha... | 53.036866 | 11,509 |
2,450 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models, tools
from odoo.tools import formatLang
class PurchaseBillUnion(models.Model):
_name = 'purchase.bill.union'
_auto = False
_description = 'Purchases & Bills Union'
_order... | 45.37037 | 2,450 |
8,006 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
from collections import OrderedDict
from datetime import datetime
from odoo import http
from odoo.exceptions import AccessError, MissingError
from odoo.http import request, Response
from odoo.tools import ... | 41.481865 | 8,006 |
1,193 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': "Gift Card for point of sales module",
'summary': "Use gift card in your sales orders",
'description': """Integrate gift card mechanism in sales orders.""",
'category': 'Sales/Sales',
'versi... | 34.085714 | 1,193 |
2,116 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.point_of_sale.tests.test_frontend import TestPointOfSaleHttpCommon
from odoo.tests import Form, tagged
@tagged("post_install", "-at_install")
class TestGiftCardPromotion(TestPointOfSaleHttpCommon):
... | 35.266667 | 2,116 |
1,155 | 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 PosConfig(models.Model):
_inherit = "pos.config"
use_gift_card = fields.Boolean(string="Gift Card")
gift_card_product_id = fields.Many2one(
"product.prod... | 32.083333 | 1,155 |
1,036 | 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 PosOrderLine(models.Model):
_inherit = "pos.order.line"
generated_gift_card_ids = fields.One2many(
"gift.card", "buy_pos_order_line_id", string="Bought Gift Card"
... | 30.470588 | 1,036 |
339 | 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 BarcodeRule(models.Model):
_inherit = 'barcode.rule'
type = fields.Selection(selection_add=[
('gift_card', 'Gift Card'),
], ondelete={
'gift_card': 'se... | 24.214286 | 339 |
1,576 | 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 GiftCard(models.Model):
_inherit = "gift.card"
buy_pos_order_line_id = fields.Many2one(
"pos.order.line",
copy=False,
readonly=True,
h... | 35.818182 | 1,576 |
2,765 | 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
import base64
class PosOrder(models.Model):
_inherit = "pos.order"
gift_card_count = fields.Integer(compute="_compute_gift_card_count")
@api.depends("lines.generated_g... | 43.203125 | 2,765 |
1,007 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Test Full Event Flow',
'version': '1.0',
'category': 'Hidden/Tests',
'description': """
This module will test the main event flows of Odoo, both frontend and backend.
It installs sale capabilit... | 28.771429 | 1,007 |
11,224 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import datetime, timedelta, time
from odoo.addons.base.tests.common import HttpCaseWithUserDemo, HttpCaseWithUserPortal
from odoo.addons.event_crm.tests.common import TestEventCrmCommon
from odoo.addons.sa... | 40.374101 | 11,224 |
8,737 | 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.addons.event.tests.common import TestEventCommon
from odoo.exceptions import AccessError
from odoo.tests.common import users
from ... | 41.212264 | 8,737 |
2,082 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.test_event_full.tests.common import TestWEventCommon
from odoo.exceptions import ValidationError
class TestTemplateRefModel(TestWEventCommon):
def test_template_ref_model_constraint(self):
... | 48.418605 | 2,082 |
7,227 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.test_event_full.tests.common import TestEventFullCommon
from odoo.tests import users
class TestEventCrm(TestEventFullCommon):
@classmethod
def setUpClass(cls):
super(TestEventCrm, cls)... | 48.503356 | 7,227 |
1,689 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import tests
from odoo.addons.test_event_full.tests.common import TestWEventCommon
from odoo.tests.common import HOST
@tests.common.tagged('post_install', '-at_install')
class TestWEventRegister(TestWEventCom... | 38.386364 | 1,689 |
1,092 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Purchase Agreements',
'version': '0.1',
'category': 'Inventory/Purchase',
'description': """
This module allows you to manage your Purchase Agreements.
===========================================================
Manag... | 39 | 1,092 |
6,599 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.purchase_requisition.tests.common import TestPurchaseRequisitionCommon
from odoo.tests import Form
class TestPurchaseRequisition(TestPurchaseRequisitionCommon):
def test_00_purchase_requisition_us... | 48.881481 | 6,599 |
2,607 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from odoo.tests import common
class TestPurchaseRequisitionCommon(common.TransactionCase):
@classmethod
def setUpClass(cls):
super(TestPurchaseRequisitionCommon, cls).setUpClass()
# Fetch purchase related user groups
user_group_purchase_manager = cls.env.ref(... | 37.782609 | 2,607 |
5,479 | 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 PurchaseOrder(models.Model):
_inherit = 'purchase.order'
requisition_id = fields.Many2one('purchase.requisition', string='Purchase Agreement', copy=False)
is_qu... | 42.472868 | 5,479 |
1,445 | 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 SupplierInfo(models.Model):
_inherit = 'product.supplierinfo'
purchase_requisition_id = fields.Many2one('purchase.requisition', related='purchase_requisition_line_id.req... | 42.5 | 1,445 |
15,171 | py | PYTHON | 15.0 | # -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import datetime, time
from odoo import api, fields, models, _
from odoo.exceptions import UserError
PURCHASE_REQUISITION_STATES = [
('draft', 'Draft'),
('ongoing', 'Ongoing'),
('in_progress'... | 51.080808 | 15,171 |
725 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Lead Generation From Website Visits',
'summary': 'Generate Leads/Opportunities from your website\'s traffic',
'version': '1.1',
'category': 'Sales/CRM',
'depends': [
'iap_crm',
... | 27.884615 | 725 |
8,722 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import exceptions
from odoo.addons.crm.tests.common import TestCrmCommon
from odoo.addons.website_crm_iap_reveal.tests.common import MockIAPReveal
from odoo.tests.common import users
class TestLeadMine(TestCr... | 44.723077 | 8,721 |
3,463 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from contextlib import contextmanager
from unittest.mock import patch
from odoo import exceptions
from odoo.addons.crm.models.crm_lead import Lead
from odoo.addons.iap.tests.common import MockIAPEnrich
from odoo.addons.website_crm_iap_reveal.models.crm_reveal_rule import CRMRevealRule
class ... | 41.722892 | 3,463 |
2,377 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
import time
from odoo import models
from odoo.http import request
_logger = logging.getLogger(__name__)
class IrHttp(models.AbstractModel):
_inherit = 'ir.http'
@classmethod
def _serve_page... | 54.022727 | 2,377 |
2,772 | 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 import api, fields, models
DEFAULT_REVEAL_VIEW_WEEKS_VALID = 5
class CRMRevealView(models.Model):
_name = 'crm.reveal.view'
_descriptio... | 48.631579 | 2,772 |
18,931 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import datetime
import itertools
import logging
import re
from dateutil.relativedelta import relativedelta
import odoo
from odoo import api, fields, models, tools, _
from odoo.addons.iap.tools import iap_tools
from odoo... | 45.289474 | 18,931 |
397 | 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 Lead(models.Model):
_inherit = 'crm.lead'
reveal_ip = fields.Char(string='IP Address')
reveal_iap_credits = fields.Integer(string='IAP Credits')
reveal_rule_id = f... | 33.083333 | 397 |
682 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
import json
from odoo import http
from odoo.addons.website.controllers.form import WebsiteForm
from odoo.http import request
class ContactController(WebsiteForm):
def _handle_website_form(self, model_name, **kwargs):
if model_name == 'crm.lead':
# Add the ip_address t... | 37.888889 | 682 |
1,760 | py | PYTHON | 15.0 | # -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Indonesia E-faktur',
'icon': '/l10n_id/static/description/icon.png',
'version': '1.0',
'description': """
E-Faktur Menu(Indonesia)
Format : 010.000-16.00000001
* 2 (du... | 40 | 1,760 |
4,654 | py | PYTHON | 15.0 | from odoo.tests import tagged, common
from odoo.addons.l10n_id_efaktur.models.account_move import FK_HEAD_LIST, LT_HEAD_LIST, OF_HEAD_LIST, _csv_row
@tagged('post_install', '-at_install', 'post_install_l10n')
class TestIndonesianEfaktur(common.TransactionCase):
def setUp(self):
"""
1) contact with ... | 52.292135 | 4,654 |
16,942 | py | PYTHON | 15.0 | # -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
import re
from odoo import api, fields, models, _
from odoo.exceptions import UserError, ValidationError
from odoo.tools import float_round, float_repr
FK_HEAD_LIST = ['FK', 'KD_JENIS_TRANSAKSI', 'FG_PEN... | 54.828479 | 16,942 |
4,396 | 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, _
from odoo.exceptions import ValidationError
import re
class Efaktur(models.Model):
_name = "l10n_id_efaktur.efaktur.range"
_description = "Available E-faktur range"
... | 39.603604 | 4,396 |
1,786 | py | PYTHON | 15.0 | # -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models, api
class ResPartner(models.Model):
"""Inherit res.partner object to add NPWP field and Kode Transaksi"""
_inherit = "res.partner"
l10n_id_pkp = fields.Boolean(string="ID... | 48.27027 | 1,786 |
943 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
{
'name': 'Website Payment',
'category': 'Hidden',
'summary': 'Payment integration with website',
'version': '1.0',
'description': """
This is a bridge module that adds multi-website support for payment acquirers.
""",
'depends': [
'website',
'payment... | 27.735294 | 943 |
2,133 | 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 PaymentTransaction(models.Model):
_inherit = "payment.transaction"
is_donation = fields.Boolean(string="Is donation", help="Is the payment a donation")
def _finali... | 47.4 | 2,133 |
560 | py | PYTHON | 15.0 | # coding: utf-8
from odoo import fields, models
from odoo.http import request
class PaymentAcquirer(models.Model):
_inherit = "payment.acquirer"
website_id = fields.Many2one(
"website",
domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]",
ondelete="restrict",
... | 28 | 560 |
404 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class Page(models.Model):
_inherit = 'website.page'
@classmethod
def _get_cached_blacklist(cls):
return super()._get_cached_blacklist() + (
# Contains a form wit... | 26.933333 | 404 |
339 | 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 AccountPayment(models.Model):
_inherit = 'account.payment'
is_donation = fields.Boolean(string="Is Donation", related="payment_transaction_id.is_donation", help="Is the pa... | 33.9 | 339 |
6,921 | 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.exceptions import ValidationError
from odoo.http import request
from odoo.tools.json import scriptsafe as json_safe
from odoo.addons.payment import utils as payment_utils
from odoo.add... | 50.889706 | 6,921 |
412 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from odoo.http import request
from odoo.addons.portal.controllers.portal import CustomerPortal
class CustomerPortalPasswordPolicy(CustomerPortal):
def _prepare_portal_layout_values(self):
d = super()._prepare_portal_layout_values()
d['password_minimum_length'] = request.env... | 41.2 | 412 |
340 | py | PYTHON | 15.0 | {
'name': "Password Policy support for Signup",
'depends': ['auth_password_policy', 'portal'],
'category': 'Tools',
'auto_install': True,
'data': ['views/templates.xml'],
'assets': {
'web.assets_frontend': [
'auth_password_policy_portal/static/**/*',
],
},
'li... | 26.153846 | 340 |
812 | py | PYTHON | 15.0 | # -*- encoding: utf-8 -*-
{
'name': 'Digital Products',
'version': '0.1',
'summary': 'Sell digital products in your eCommerce store',
'category': 'Website/Website',
'description': """
Sell e-goods in your eCommerce store (e.g. webinars, articles, e-books, video tutorials).
To do so, create the produ... | 32.48 | 812 |
294 | 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 Attachment(models.Model):
_inherit = ['ir.attachment']
product_downloadable = fields.Boolean("Downloadable from product portal", default=False)
| 26.727273 | 294 |
1,147 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class AccountInvoiceLine(models.Model):
_inherit = ['account.move.line']
def get_digital_purchases(self):
partner = self.env.user.partner_id
# Get paid invoices
... | 35.84375 | 1,147 |
3,141 | 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']
attachment_count = fields.Integer(compute='_compute_attachment_count', string="File")
def _comp... | 49.857143 | 3,141 |
4,767 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
import io
import os
import mimetypes
from odoo import http
from odoo.exceptions import AccessError
from odoo.http import request
from odoo.addons.sale.controllers.portal import CustomerPortal
class Websi... | 45.836538 | 4,767 |
2,124 | py | PYTHON | 15.0 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os.path
try:
import GeoIP # Legacy
except ImportError:
GeoIP = None
try:
import geoip2
import geoip2.database
except ImportError:
geoip2 = None
class GeoIPResolver(object):
def __init__(self, fname):
self.fname = fname
tr... | 32.181818 | 2,124 |
480 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Web Routing',
'summary': 'Web Routing',
'sequence': '9100',
'category': 'Hidden',
'description': """
Proposes advanced routing options not available in web or base to keep
base modules simp... | 25.263158 | 480 |
0 | py | PYTHON | 15.0 | 0 | 0 | |
28,433 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
import logging
import os
import re
import traceback
import unicodedata
import werkzeug.exceptions
import werkzeug.routing
import werkzeug.urls
# optional python-slugify import (https://github.com/un33k/python-slugify)
try:
import slugify as slugify_lib
except ImportError:
slugify_lib =... | 41.147612 | 28,433 |
470 | py | PYTHON | 15.0 | # -*- coding: ascii -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models
from odoo.addons.http_routing.models.ir_http import slug, unslug_url
class IrUiView(models.Model):
_inherit = ["ir.ui.view"]
@api.model
def _prepare_qcontext(self):
qco... | 29.375 | 470 |
894 | 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.web.controllers.main import WebClient, Home, Session
class Routing(Home):
@http.route('/website/translations/<string:unique>', type='http', auth... | 37.25 | 894 |
1,048 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': "Sale Matrix",
'summary': "Add variants to Sales Order through a grid entry.",
'description': """
This module allows to fill Sales Order rapidly
by choosing product variants quantity ... | 31.757576 | 1,048 |
1,848 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import odoo.tests
from odoo.addons.product_matrix.tests import common
@odoo.tests.tagged('post_install', '-at_install')
class TestSaleMatrixUi(common.TestMatrixCommon):
"""
This test needs sale_management ... | 45.073171 | 1,848 |
8,324 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import json
from odoo import api, fields, models, _
from odoo.exceptions import ValidationError
class SaleOrder(models.Model):
_inherit = 'sale.order'
report_grids = fields.Boolean(
string="Print Varian... | 47.565714 | 8,324 |
858 | 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 ProductTemplate(models.Model):
_inherit = 'product.template'
product_add_mode = fields.Selection([
('configurator', 'Product Configurator'),
('matrix',... | 40.857143 | 858 |
761 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Quotation Builder',
'category': 'Sales/Sales',
'summary': 'Build great quotation templates',
'website': 'https://www.odoo.com/app/sales',
'version': '1.0',
'description': "Design great ... | 36.238095 | 761 |
2,305 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
from odoo.tools.translate import html_translate
class SaleOrderTemplate(models.Model):
_inherit = "sale.order.template"
website_description = fields.Html('Website Descripti... | 37.786885 | 2,305 |
3,148 | 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.translate import html_translate
class SaleOrder(models.Model):
_inherit = 'sale.order'
website_description = fields.Html('Website Description', sanitize_att... | 40.358974 | 3,148 |
1,162 | 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.tools.translate import html_translate
class ProductTemplate(models.Model):
_inherit = "product.template"
quotation_only_description = fields.Html('Quotation Only ... | 48.416667 | 1,162 |
589 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, api
class ResCompany(models.Model):
_inherit = 'res.company'
@api.model
def _set_default_sale_order_template_id_if_empty(self):
template = self.env.ref('sale_quotation_buil... | 34.647059 | 589 |
823 | 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.http_routing.models.ir_http import unslug
from odoo.addons.portal.controllers import portal
class CustomerPortal(portal.CustomerPortal):
@http.r... | 43.315789 | 823 |
789 | py | PYTHON | 15.0 | {
'name': 'Barcode',
'version': '2.0',
'category': 'Hidden',
'summary': 'Scan and Parse Barcodes',
'depends': ['web'],
'data': [
'data/barcodes_data.xml',
'views/barcodes_view.xml',
'security/ir.model.access.csv',
],
'installable': True,
'auto_install': Fa... | 28.178571 | 789 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.