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 |
|---|---|---|---|---|---|---|
911 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from odoo import models, fields, api, _
class IrActionsReport(models.Model):
_inherit = 'ir.actions.report'
def retrieve_attachment(self, record):
# Override this method in order to force to re-render the pdf in case of
# using snailmail
if self.env.context.ge... | 37.958333 | 911 |
782 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models
class Contact(models.AbstractModel):
_inherit = 'ir.qweb.field.contact'
@api.model
def value_to_html(self, value, options):
if self.env.context.get('snailmail_layout'):
... | 41.157895 | 782 |
412 | 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"
snailmail_color = fields.Boolean(string='Color', default=True)
snailmail_cover = fields.Boolean(string='Add a Cover Page... | 37.454545 | 412 |
579 | 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'
snailmail_color = fields.Boolean(string='Print In Color', related='company_id.snailmail_col... | 48.25 | 579 |
22,328 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import re
import base64
import io
from PyPDF2 import PdfFileReader, PdfFileMerger, PdfFileWriter
from reportlab.platypus import Frame, Paragraph, KeepInFrame
from reportlab.lib.units import mm
from reportlab.lib.pagesize... | 42.287879 | 22,328 |
1,313 | py | PYTHON | 15.0 |
from odoo import api, fields, models
class Message(models.Model):
_inherit = 'mail.message'
snailmail_error = fields.Boolean("Snailmail message in error", compute="_compute_snailmail_error", search="_search_snailmail_error")
letter_ids = fields.One2many(comodel_name='snailmail.letter', inverse_name='mes... | 42.354839 | 1,313 |
1,756 | 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.addons.snailmail.country_utils import SNAILMAIL_COUNTRIES
class ResPartner(models.Model):
_inherit = "res.partner"
def write(self, vals):
letter_address_vals = {... | 39.909091 | 1,756 |
617 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': "Gift Card for sales module",
'summary': "Use gift card in your sales orders",
'description': """Integrate gift card mechanism in sales orders.""",
'category': 'Sales/Sales',
'version': '1.0... | 30.85 | 617 |
2,197 | 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.addons.sale_gift_card.tests.common import TestSaleGiftCardCommon
from odoo.exceptions import UserError
from odoo.tests.common import tagged
@tagged('-at_install', 'post_install')
class... | 39.945455 | 2,197 |
1,653 | 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
class TestSaleGiftCardCommon(TestSaleProductAttributeValueCommon):
@classmethod
def setUpClass(cl... | 31.788462 | 1,653 |
2,455 | 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.addons.sale_gift_card.tests.common import TestSaleGiftCardCommon
from odoo.tests.common import tagged
@tagged('-at_install', 'post_install')
class TestBuyGiftCard(TestSaleGiftCardCommo... | 39.596774 | 2,455 |
4,950 | 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 SaleOrder(models.Model):
_inherit = "sale.order"
gift_card_count = fields.Integer(compute="_compute_gift_card_count")
@api.depends("order_line.generated_gift_... | 44.594595 | 4,950 |
1,013 | 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_line_id = fields.Many2one("sale.order.line", copy=False, readonly=True,
help="Sal... | 42.208333 | 1,013 |
1,447 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Repairs',
'version': '1.0',
'sequence': 230,
'category': 'Inventory/Inventory',
'summary': 'Repair damaged products',
'description': """
The aim is to have a complete module to manage ... | 32.886364 | 1,447 |
17,260 | 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
@tagged('post_install', '-at_install')
class TestRepair(AccountTestInvoicingCommon):
@classmethod
def ... | 49.597701 | 17,260 |
1,482 | 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 MakeInvoice(models.TransientModel):
_name = 'repair.order.make_invoice'
_description = 'Create Mass Invoice (repair)'
group = fields.Boolean('Group by partner inv... | 43.588235 | 1,482 |
609 | 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 StockWarnInsufficientQtyRepair(models.TransientModel):
_name = 'stock.warn.insufficient.qty.repair'
_inherit = 'stock.warn.insufficient.qty'
_description = 'Warn Insuffi... | 33.833333 | 609 |
44,325 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
from collections import defaultdict
from random import randint
from markupsafe import Markup
from odoo import api, fields, models, _
from odoo.exceptions import UserError, ValidationError
from odoo.tools import float_compare, is_html_empty
... | 51.065668 | 44,325 |
703 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from odoo import models, fields
class AccountMove(models.Model):
_inherit = 'account.move'
repair_ids = fields.One2many('repair.order', 'invoice_id', readonly=True, copy=False)
def unlink(self):
repairs = self.sudo().repair_ids.filtered(lambda repair: repair.state != 'ca... | 31.954545 | 703 |
499 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# 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 == 'repair.order':
s... | 38.384615 | 499 |
1,461 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from collections import defaultdict
from odoo import api, fields, models, _
class ProductionLot(models.Model):
_inherit = 'stock.production.lot'
repair_order_ids = fields.Many2many('repair.order', string="Repair Orders", compute="_compute_repair_order_ids")
repair_order_count = fi... | 37.461538 | 1,461 |
968 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, api
class MrpStockReport(models.TransientModel):
_inherit = 'stock.traceability.report'
@api.model
def _get_reference(self, move_line):
res_model, res_id, ref = super(MrpStockReport, self)._get_re... | 37.230769 | 968 |
580 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class Product(models.Model):
_inherit = "product.product"
def _count_returned_sn_products(self, sn_lot):
res = self.env['repair.line'].search_count([
('type', '=', '... | 32.222222 | 580 |
986 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Adyen Payment Acquirer',
'version': '2.0',
'category': 'Accounting/Payment Acquirers',
'sequence': 340,
'summary': 'Payment Acquirer: Adyen Implementation',
'description': """Adyen Payment Acquirer""",
'de... | 36.518519 | 986 |
4,539 | py | PYTHON | 15.0 | import re
from odoo import _
from odoo.exceptions import UserError
from odoo.addons.payment import utils as payment_utils
def format_partner_name(partner_name):
""" Format the partner name to comply with the payload structure of the API request.
:param str partner_name: The name of the partner making the p... | 39.815789 | 4,539 |
1,316 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
# Endpoints of the API.
# See https://docs.adyen.com/api-explorer/#/CheckoutService/v67/overview for Checkout API
# See https://docs.adyen.com/api-explorer/#/Recurring/v49/overview for Recurring API
API_ENDPOINT_VERSIONS = {
'/disable': 49,... | 37.6 | 1,316 |
745 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.payment.tests.common import PaymentCommon
class AdyenCommon(PaymentCommon):
@classmethod
def setUpClass(cls, chart_template_ref=None):
super().setUpClass(chart_template_ref=chart_template_ref)
cls.ady... | 35.47619 | 745 |
2,754 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
from unittest.mock import patch
from odoo.exceptions import UserError
from odoo.tests import tagged
from odoo.tools import mute_logger
from odoo.addons.payment import utils as payment_utils
from .common import AdyenCommon
@tagged('post_ins... | 39.342857 | 2,754 |
12,583 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
import pprint
from odoo import _, api, fields, models
from odoo.exceptions import UserError, ValidationError
from odoo.addons.payment import utils as payment_utils
from odoo.addons.payment_adyen import utils as adyen_utils
from... | 43.539792 | 12,583 |
1,766 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import _, fields, models
from odoo.exceptions import UserError, ValidationError
class PaymentToken(models.Model):
_inherit = 'payment.token'
adyen_shopper_reference = fields.Char(
string="Shopper Reference", help="T... | 32.703704 | 1,766 |
428 | 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 AccountPaymentMethod(models.Model):
_inherit = 'account.payment.method'
@api.model
def _get_payment_method_information(self):
res = super()._get_payment_method_in... | 30.571429 | 428 |
5,878 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
import re
import requests
from odoo import _, api, fields, models
from odoo.exceptions import ValidationError
from odoo.addons.payment_adyen.const import API_ENDPOINT_VERSIONS
_logger = logging.getLogger(__name__)
class Pay... | 43.220588 | 5,878 |
18,045 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
import binascii
import hashlib
import hmac
import json
import logging
import pprint
from werkzeug import urls
from odoo import _, http
from odoo.exceptions import ValidationError
from odoo.http import request
from odoo.tools.pyc... | 51.11898 | 18,045 |
1,518 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
"name": """Indian - E-waybill""",
"version": "1.03.00",
"icon": "/l10n_in/static/description/icon.png",
"category": "Accounting/Localizations/EDI",
"depends": [
"l10n_in_edi",
],
"des... | 38.923077 | 1,518 |
4,602 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.l10n_in_edi.tests.test_edi_json import TestEdiJson
from odoo.tests import tagged
@tagged("post_install_l10n", "post_install", "-at_install")
class TestEdiEwaybillJson(TestEdiJson):
def test_edi_json(self):
(self.i... | 40.017391 | 4,602 |
6,124 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import json
from odoo import fields, models, api, _
from odoo.exceptions import UserError
class AccountMove(models.Model):
_inherit = "account.move"
# Transaction Details
l10n_in_type_id = fields.Many2one(... | 49.788618 | 6,124 |
31,949 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import re
import json
from datetime import timedelta
from odoo import models, fields, api, _
from odoo.tools import html_escape
from odoo.exceptions import AccessError
from odoo.addons.iap import jsonrpc
from odoo.addon... | 52.461412 | 31,949 |
761 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class ResCompany(models.Model):
_inherit = "res.company"
l10n_in_edi_ewaybill_username = fields.Char("E-Waybill (IN) Username", groups="base.group_system")
l10n_in_edi_ewayb... | 42.277778 | 761 |
1,171 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, fields, _
from odoo.exceptions import UserError
from odoo.tools import html_escape
class ResConfigSettings(models.TransientModel):
_inherit = "res.config.settings"
l10n_in_edi_ewaybill... | 50.913043 | 1,171 |
1,012 | 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 EWayBillType(models.Model):
_name = "l10n.in.ewaybill.type"
_description = "E-Waybill Document Type"
name = fields.Char("Type")
code = fields.Char("Type Code")
... | 31.625 | 1,012 |
21,354 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import _lt
ERROR_CODES = {
"100": _lt("Invalid json"),
"101": _lt("Invalid Username"),
"102": _lt("Invalid Password"),
"103": _lt("Invalid Client -Id"),
"104": _lt("Invalid Client -Id"),
... | 65.907407 | 21,354 |
790 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Product Availability Notifications',
'category': 'Website/Website',
'summary': 'Notify the user when a product is back in stock',
'description': """
Allow the user to select if he wants to rece... | 29.259259 | 790 |
3,633 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.website_sale_stock.tests.test_website_sale_stock_product_warehouse import TestWebsiteSaleStockProductWarehouse
class TestWishlistEmail(TestWebsiteSaleStockProductWarehouse):
@classmethod
def se... | 41.758621 | 3,633 |
1,012 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class ProductTemplate(models.Model):
_inherit = "product.template"
def _get_combination_info(self, combination=False, product_id=False, add_qty=1, pricelist=False, parent_combination=Fals... | 40.48 | 1,012 |
2,318 | 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 ProductWishlist(models.Model):
_inherit = "product.wishlist"
stock_notification = fields.Boolean(default=False, required=True)
def _add_to_wishlist(self, pricelist_... | 42.925926 | 2,318 |
574 | 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
class WebsiteSaleStockWishlist(WebsiteSale):
@http.route(['/shop/wishlist/notify/<model("product.... | 44.153846 | 574 |
643 | 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.addons.website_sale.controllers.variant import WebsiteSaleVariantController
class WebsiteSaleStockWishlistVariantController(WebsiteSaleVariantController):
@http.route()
def get_c... | 49.461538 | 643 |
926 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
{
'name' : 'Import/Export Invoices From XML/PDF',
'description':"""
Electronic Data Interchange
=======================================
EDI is the electronic interchange of business information using a standardized format.
This is the base module for import and export of invoices in var... | 33.071429 | 926 |
11,729 | 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.addons.account_edi.tests.common import AccountEdiTestCommon, _mocked_post_two_steps, _generate_mocked_needs_web_services, _mocked_cancel_failed, _generate_mocked_support_batching
from u... | 47.873469 | 11,729 |
10,085 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.modules.module import get_module_resource
from odoo.addons.account.tests.common import AccountTestInvoicingCommon
from contextlib import contextmanager
from unittest.mock import patch
from unittest import mock
... | 46.474654 | 10,085 |
1,192 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from odoo.addons.account.tests.common import AccountTestInvoicingCommon
from odoo.tests import tagged
@tagged('post_install', '-at_install')
class TestImportVendorBill(AccountTestInvoicingCommon):
def test_retrieve_partner(self):
def retrieve_partner(vat, import_vat):
... | 54.181818 | 1,192 |
37,399 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from collections import defaultdict
from odoo import api, fields, models, _
from odoo.exceptions import UserError
from odoo.tools import frozendict
class AccountMove(models.Model):
_inherit = 'account.move'
e... | 52.015299 | 37,399 |
29,434 | 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.pdf import OdooPdfFileReader, OdooPdfFileWriter
from odoo.osv import expression
from odoo.tools import html_escape
from odoo.exceptions import RedirectWarning
from lx... | 42.596237 | 29,434 |
728 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from odoo import models, fields, api, _
class IrActionsReport(models.Model):
_inherit = 'ir.actions.report'
def _post_pdf(self, save_in_attachment, pdf_content=None, res_ids=None):
# OVERRIDE to embed some EDI documents inside the PDF.
if self.model == 'account.move' ... | 45.5 | 728 |
640 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from odoo import api, models, fields, _
from odoo.exceptions import UserError
class IrAttachment(models.Model):
_inherit = 'ir.attachment'
@api.ondelete(at_uninstall=False)
def _unlink_except_government_document(self):
linked_edi_documents = self.env['account.edi.document'... | 45.714286 | 640 |
4,193 | 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, _
from odoo.exceptions import UserError
from collections import defaultdict
class AccountJournal(models.Model):
_inherit = 'account.journal'
edi_format_ids = fields.Many2... | 50.518072 | 4,193 |
1,611 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from odoo import api, models
class MailTemplate(models.Model):
_inherit = "mail.template"
def _get_edi_attachments(self, document):
"""
Will return the information about the attachment of the edi document for adding the attachment in the mail.
Can be overridde... | 37.465116 | 1,611 |
1,488 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from odoo import models
class UoM(models.Model):
_inherit = 'uom.uom'
def _get_unece_code(self):
""" Returns the UNECE code used for international trading for corresponding to the UoM as per
https://unece.org/fileadmin/DAM/cefact/recommendations/rec20/rec20_rev3_Annex... | 39.157895 | 1,488 |
2,994 | 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 AccountPayment(models.Model):
_inherit = 'account.payment'
edi_show_cancel_button = fields.Boolean(
compute='_compute_edi_show_cancel_button')
edi_show... | 43.391304 | 2,994 |
13,194 | 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
from psycopg2 import OperationalError
import base64
import logging
_logger = logging.getLogger(__name__)
DEFAULT_BLOCKING_LEVEL = 'error'
... | 50.1673 | 13,194 |
3,047 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
"name": "Ecuadorian Accounting",
"version": "3.3",
"description": """
Functional
----------
This module adds accounting features for Ecuadorian localization, which
represent the minimum requirements to oper... | 37.097561 | 3,042 |
1,110 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
import logging
from odoo import api, models
_logger = logging.getLogger(__name__)
class AccountChartTemplate(models.Model):
_inherit = "account.chart.template"
@api.model
def _get_demo_data_move(self):
ref = self.env.ref
cid = self.env.company.id
model, d... | 44.4 | 1,110 |
1,735 | 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 AccountTax(models.Model):
_inherit = "account.tax"
l10n_ec_code_base = fields.Char(
string="Code base",
help="Tax declaration code of the base amount prio... | 31.735849 | 1,682 |
7,770 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models, api
from odoo.addons.l10n_ec.models.res_partner import verify_final_consumer
_DOCUMENTS_MAPPING = {
"01": [
'ec_dt_01',
'ec_dt_02',
'ec_dt_04',
'ec_dt... | 31.45749 | 7,770 |
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 SriPayment(models.Model):
_name = "l10n_ec.sri.payment"
_description = "SRI Payment Method"
name = fields.Char("Name")
code = fields.Char("Code")
| 23.384615 | 304 |
805 | py | PYTHON | 15.0 | from odoo import fields, models
class AccountJournal(models.Model):
_inherit = "account.journal"
l10n_ec_entity = fields.Char(string="Emission Entity", size=3, default="001")
l10n_ec_emission = fields.Char(string="Emission Point", size=3, default="001")
l10n_ec_emission_address_id = fields.Many2one(... | 33.541667 | 805 |
1,411 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models, _
from odoo.exceptions import UserError
import re
class L10nLatamDocumentType(models.Model):
_inherit = "l10n_latam.document.type"
internal_type = fields.Selection(
selection_add=[
... | 36.179487 | 1,411 |
775 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
_TYPE_EC = [
("vat12", "VAT 12%"),
("vat14", "VAT 14%"),
("zero_vat", "VAT 0%"),
("not_charged_vat", "VAT Not Charged"),
("exempt_vat", "VAT Exempt"),
("withhold_v... | 28.807692 | 749 |
274 | py | PYTHON | 15.0 | from odoo import models
class ResCompany(models.Model):
_inherit = "res.company"
def _localization_use_documents(self):
self.ensure_one()
return self.account_fiscal_country_id.code == "EC" or super(ResCompany, self)._localization_use_documents()
| 27.4 | 274 |
2,682 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, api, _
from odoo.exceptions import ValidationError
import logging
_logger = logging.getLogger(__name__)
def verify_final_consumer(vat):
all_number_9 = False
try:
all_number_9 = vat and all(int(number... | 47.052632 | 2,682 |
1,041 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
{
'name': 'Czech - Accounting',
'version': '1.0',
'author': '26HOUSE',
'website': 'http://www.26house.com',
'category': 'Accounting/Localizations/Account Charts',
'description': """
Czech accounting chart and localization. With Chart of Accounts with taxes and basic fis... | 27.810811 | 1,029 |
907 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name' : 'Analytic Accounting',
'version': '1.1',
'category': 'Accounting/Accounting',
'depends' : ['base', 'mail', 'uom'],
'description': """
Module for defining analytic accounting object.
=======... | 31.275862 | 907 |
348 | 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'
group_analytic_accounting = fields.Boolean(string='Analytic Accounting', implied_group='analytic.... | 38.666667 | 348 |
10,872 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from collections import defaultdict
from odoo import api, fields, models, _
from odoo.osv import expression
from odoo.exceptions import ValidationError
class AccountAnalyticDistribution(models.Model):
_name = 'acco... | 53.294118 | 10,872 |
1,436 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Newsletter Subscribe Button',
'summary': 'Attract visitors to subscribe to mailing lists',
'description': """
This module brings a new building block with a mailing list widget to drop on any page ... | 38.810811 | 1,436 |
736 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import odoo
import odoo.tests
@odoo.tests.common.tagged('post_install', '-at_install')
class TestSnippets(odoo.tests.HttpCase):
def test_01_newsletter_popup(self):
self.start_tour("/?enable_editor=1", "new... | 38.736842 | 736 |
849 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class ResCompany(models.Model):
_inherit = "res.company"
def _get_social_media_links(self):
social_media_links = super()._get_social_media_links()
website_id = self.env[... | 44.684211 | 849 |
2,361 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import _
from odoo.http import route, request
from odoo.addons.mass_mailing.controllers import main
class MassMailController(main.MassMailController):
@route('/website_mass_mailing/is_subscriber', type='... | 46.294118 | 2,361 |
1,881 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'pos_sale',
'version': '1.1',
'category': 'Hidden',
'sequence': 6,
'summary': 'Link module between Point of Sale and Sales',
'description': """
This module adds a custom Sales Team for... | 37.62 | 1,881 |
3,402 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import odoo
from odoo.addons.point_of_sale.tests.common import TestPoSCommon
@odoo.tests.tagged('post_install', '-at_install')
class TestPoSSaleReport(TestPoSCommon):
def setUp(self):
super(TestPoSSaleRep... | 41.487805 | 3,402 |
12,020 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import odoo
from odoo.addons.point_of_sale.tests.test_frontend import TestPointOfSaleHttpCommon
from odoo.tests.common import Form
@odoo.tests.tagged('post_install', '-at_install')
class TestPoSSale(TestPointOfSaleHttp... | 44.684015 | 12,020 |
1,376 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _
from odoo.exceptions import UserError, ValidationError
from datetime import datetime
import pytz
class CrmTeam(models.Model):
_inherit = 'crm.team'
pos_config_ids = fiel... | 44.387097 | 1,376 |
4,887 | 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 SaleOrder(models.Model):
_inherit = 'sale.order'
pos_order_line_ids = fields.One2many('pos.order.line', 'sale_order_origin_id', string="Order lines Transfered to P... | 50.381443 | 4,887 |
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 PosSession(models.Model):
_inherit = 'pos.session'
crm_team_id = fields.Many2one('crm.team', related='config_id.crm_team_id', string="Sales Team", readonly=True)
| 31.1 | 311 |
1,088 | 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 AccessError
class PosConfig(models.Model):
_inherit = 'pos.config'
crm_team_id = fields.Many2one(
'crm.team', string="Sales Team", onde... | 43.52 | 1,088 |
781 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class StockPicking(models.Model):
_inherit = 'stock.picking'
def _create_move_from_pos_order_lines(self, lines):
lines_to_unreserve = self.env['pos.order.line']
for line... | 41.105263 | 781 |
6,991 | 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_compare, float_is_zero
class PosOrder(models.Model):
_inherit = 'pos.order'
currency_rate = fields.Float(compute='_compute_currency_rate', s... | 52.962121 | 6,991 |
5,285 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import tools
from odoo import api, fields, models
class SaleReport(models.Model):
_inherit = "sale.report"
@api.model
def _get_done_states(self):
done_states = super(SaleReport, self)._ge... | 43.677686 | 5,285 |
2,058 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Sales',
'version': '1.0',
'category': 'Sales/Sales',
'sequence': 5,
'summary': 'From quotations to invoices',
'description': """
Manage sales quotations and orders
=====================... | 31.661538 | 2,058 |
14,107 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.sale.tests.common import TestSaleCommon
from odoo.tests import Form, tagged
@tagged('-at_install', 'post_install')
class TestSaleOrder(TestSaleCommon):
@classmethod
def setUpClass(cls, chart_t... | 40.305714 | 14,107 |
290 | py | PYTHON | 15.0 | import odoo.tests
# Part of Odoo. See LICENSE file for full copyright and licensing details.
@odoo.tests.tagged('post_install', '-at_install')
class TestUi(odoo.tests.HttpCase):
def test_01_sale_tour(self):
self.start_tour("/web", 'sale_tour', login="admin", step_delay=100)
| 32.222222 | 290 |
1,387 | 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_all_sale_total = fields.Boolean('All Sales')
kpi_all_sale_total_value =... | 47.827586 | 1,387 |
9,677 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _
from odoo.exceptions import UserError, ValidationError
class SaleOrderTemplate(models.Model):
_name = "sale.order.template"
_description = "Quotation Template"
def _... | 55.936416 | 9,677 |
13,129 | 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 SUPERUSER_ID, api, fields, models, _
from odoo.exceptions import UserError, ValidationError
from odoo.tools import is_html_empty
class SaleOrder(models.Model):
_inhe... | 44.656463 | 13,129 |
447 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class ResCompany(models.Model):
_inherit = "res.company"
_check_company_auto = True
sale_order_template_id = fields.Many2one(
"sale.order.template", string="Default ... | 29.8 | 447 |
1,169 | 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 ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
group_sale_order_template = fields.Boolean(
"Quotation Templates", implied_group='s... | 41.75 | 1,169 |
2,006 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from functools import partial
from odoo import http
from odoo.tools import formatLang
from odoo.exceptions import AccessError, MissingError
from odoo.http import request
from odoo.addons.sale.controllers import portal
... | 38.576923 | 2,006 |
893 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
{
'name': 'Mail Tests (Full)',
'version': '1.0',
'category': 'Hidden',
'sequence': 9876,
'summary': 'Mail Tests: performances and tests specific to mail with all sub-modules',
'description': """This module contains tests related to various mail features
and mail-related ... | 27.90625 | 893 |
3,802 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.test_mail_full.tests.common import TestMailFullCommon, TestMailFullRecipients
class TestPhoneBlacklist(TestMailFullCommon, TestMailFullRecipients):
""" TODO """
@classmethod
def setUpClass... | 46.365854 | 3,802 |
9,753 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.test_mail_full.tests.common import TestMailFullCommon, TestMailFullRecipients
from odoo.tests import tagged
from odoo.tools import mute_logger
class TestSMSActionsCommon(TestMailFullCommon, TestMailFul... | 49.01005 | 9,753 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.