size int64 0 304k | ext stringclasses 1
value | lang stringclasses 1
value | branch stringclasses 1
value | content stringlengths 0 304k | avg_line_length float64 0 238 | max_line_length int64 0 304k |
|---|---|---|---|---|---|---|
3,725 | py | PYTHON | 15.0 | # Copyright 2022 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import _, api, fields, models
from odoo.exceptions import ValidationError
from odoo.tools.misc import groupby
class AccountMove(models.Model):
_inherit = "account.move"
@api.constrains("line_ids")
de... | 40.934066 | 3,725 |
530 | py | PYTHON | 15.0 | # Copyright 2022 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class ProductCategory(models.Model):
_inherit = "product.category"
property_account_discount_categ_id = fields.Many2one(
"account.account",
company_dependent=True,
... | 35.333333 | 530 |
792 | py | PYTHON | 15.0 | # Copyright 2022 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class AccountMoveLine(models.Model):
_inherit = "account.move.line"
discount_split_by_sale_line_id = fields.Many2one("sale.order.line", copy=False)
is_split_line = fields.Boolea... | 34.434783 | 792 |
2,662 | py | PYTHON | 15.0 | # Copyright 2022 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
class SaleOrderLine(models.Model):
_inherit = "sale.order.line"
origin_price_unit = fields.Float(digits="Product Price")
def _prepare_invoice_line(self, **optional_values)... | 40.333333 | 2,662 |
786 | py | PYTHON | 15.0 | # Copyright 2022 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class ProductTemplate(models.Model):
_inherit = "product.template"
property_account_discount_id = fields.Many2one(
"account.account",
company_dependent=True,
... | 34.173913 | 786 |
356 | py | PYTHON | 15.0 | # Copyright 2022 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class ResCompany(models.Model):
_inherit = "res.company"
account_split_discount_line = fields.Boolean(
"Split Discount Lines",
default=False, # Do not set to True, ... | 27.384615 | 356 |
507 | py | PYTHON | 15.0 | # Copyright 2022 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class ResConfigSettings(models.TransientModel):
_inherit = "res.config.settings"
account_split_discount_line = fields.Boolean(
"Split Discount Lines",
help="If set, ... | 31.6875 | 507 |
596 | py | PYTHON | 15.0 | # Copyright 2018 Tecnativa - Sergio Teruel
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Sale Order General Discount",
"summary": "General discount per sale order",
"version": "15.0.1.0.0",
"development_status": "Production/Stable",
"category": "Sales",
"website": "... | 37.25 | 596 |
4,525 | py | PYTHON | 15.0 | # Copyright 2018 Tecnativa - Sergio Teruel
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from lxml import etree
from odoo.tests import TransactionCase
class TestSaleOrderLineInput(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.partner = cls.env... | 35.629921 | 4,525 |
1,789 | py | PYTHON | 15.0 | # Copyright 2018 Tecnativa - Sergio Teruel
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from lxml import etree
from odoo import api, fields, models
class SaleOrder(models.Model):
_inherit = "sale.order"
general_discount = fields.Float(
string="Discount (%)",
compute="_com... | 34.403846 | 1,789 |
1,056 | py | PYTHON | 15.0 | # Copyright 2018 Tecnativa - Sergio Teruel
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
class SaleOrderLine(models.Model):
_inherit = "sale.order.line"
discount = fields.Float(
compute="_compute_discount",
store=True,
readonly=F... | 33 | 1,056 |
450 | py | PYTHON | 15.0 | # Copyright 2018 Tecnativa - Sergio Teruel
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
class ResPartner(models.Model):
_inherit = "res.partner"
sale_discount = fields.Float(
string="Discount",
digits="Discount",
company_depend... | 25 | 450 |
720 | py | PYTHON | 15.0 | # Copyright 2017 Tecnativa - Sergio Teruel
# Copyright 2017-2018 Tecnativa - Carlos Dauden
# Copyright 2017 Camptocamp SA
# Copyright 2021 Tecnativa - João Marques
# License AGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
{
"name": "Sale Order Invoicing Finished Task",
"summary": "Control invoice order l... | 37.842105 | 719 |
7,322 | py | PYTHON | 15.0 | # Copyright 2017 Tecnativa - Sergio Teruel
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo.exceptions import ValidationError
from odoo.tests import common
class TestInvoicefinishedTask(common.TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
c... | 39.365591 | 7,322 |
2,263 | py | PYTHON | 15.0 | # Copyright 2017 Tecnativa - Sergio Teruel
# Copyright 2017 Tecnativa - Carlos Dauden
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
class SaleOrder(models.Model):
_inherit = "sale.order"
@api.depends(
"state", "order_line.invoice_status", "orde... | 32.328571 | 2,263 |
435 | py | PYTHON | 15.0 | # Copyright 2017 Tecnativa - Sergio Teruel
# Copyright 2017 Tecnativa - Carlos Dauden
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import fields, models
class ProductTemplate(models.Model):
_inherit = "product.template"
invoicing_finished_task = fields.Boolean(
string="... | 31.071429 | 435 |
2,137 | py | PYTHON | 15.0 | # Copyright 2017 Camptocamp SA
# Copyright 2017 Tecnativa - Sergio Teruel
# Copyright 2017 Tecnativa - Carlos Dauden
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import _, api, fields, models
from odoo.exceptions import ValidationError
class ProjectTaskType(models.Model):
_inherit =... | 31.426471 | 2,137 |
931 | py | PYTHON | 15.0 | # Copyright 2014 Carlos Sánchez Cifuentes <csanchez@grupovermon.com>
# Copyright 2015-2020 Tecnativa - Pedro M. Baeza
# Copyright 2015 Oihane Crucelaegui <oihanecrucelaegi@avanzosc.es>
# Copyright 2016 Vicent Cubells <vicent.cubells@tecnativa.com>
# Copyright 2017 David Vidal <david.vidal@tecnativa.com>
# Copyright 201... | 40.434783 | 930 |
4,464 | py | PYTHON | 15.0 | # Copyright 2015 Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
# Copyright 2016 Vicent Cubells <vicent.cubells@tecnativa.com>
# Copyright 2017 David Vidal <david.vidal@tecnativa.com>
# Copyright 2018 Duc Dao Dong <duc.dd@komit-consulting.com>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo.... | 42.113208 | 4,464 |
1,432 | py | PYTHON | 15.0 | # Copyright 2014 Carlos Sánchez Cifuentes <csanchez@grupovermon.com>
# Copyright 2015-2020 Tecnativa - Pedro M. Baeza
# Copyright 2015 Oihane Crucelaegui <oihanecrucelaegi@avanzosc.es>
# Copyright 2016 Vicent Cubells <vicent.cubells@tecnativa.com>
# Copyright 2017 David Vidal <david.vidal@tecnativa.com>
# License AGPL-... | 40.885714 | 1,431 |
1,572 | py | PYTHON | 15.0 | # Copyright 2018-2016 Tecnativa - Pedro M. Baeza
# Copyright 2020 - Iván Todorovich
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import SUPERUSER_ID, api
def post_init_hook(cr, registry):
"""At installation time, propagate the parent sales team to the children
contacts that have... | 34.152174 | 1,571 |
762 | py | PYTHON | 15.0 | # Copyright 2016-2020 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Sales documents permissions by channels (teams)",
"summary": "New group for seeing only sales channel's documents",
"version": "15.0.1.0.2",
"category": "Sales",
"website": "h... | 40.105263 | 762 |
3,921 | py | PYTHON | 15.0 | # Copyright 2016-2020 Tecnativa - Pedro M. Baeza
# Copyright 2021 Tecnativa - Víctor Martínez
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from lxml import etree
from ..hooks import post_init_hook
from .common import TestCommon
class TestSalesTeamSecurity(TestCommon):
@classmethod
def se... | 44.033708 | 3,919 |
5,464 | py | PYTHON | 15.0 | # Copyright 2016-2020 Tecnativa - Pedro M. Baeza
# Copyright 2021 Tecnativa - Víctor Martínez
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo.tests import common
class TestCommon(common.TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.tea... | 44.770492 | 5,462 |
2,141 | py | PYTHON | 15.0 | # Copyright 2020 Tecnativa - Pedro M. Baeza
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import api, models, tools
from odoo.osv import expression
from odoo.tools import config
class IrRule(models.Model):
_inherit = "ir.rule"
@api.model
@tools.conditional(
"xml" not... | 36.913793 | 2,141 |
3,914 | py | PYTHON | 15.0 | # Copyright 2016-2018 Tecnativa - Pedro M. Baeza
# Copyright 2021 Tecnativa - Víctor Martínez
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from lxml import etree
from odoo import api, fields, models
class ResPartner(models.Model):
_inherit = "res.partner"
# add indexes for better perfor... | 38.732673 | 3,912 |
855 | py | PYTHON | 15.0 | # Copyright 2019 Tecnativa - Ernesto Tejeda
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Sale order line price history",
"version": "15.0.1.0.0",
"category": "Sales Management",
"author": "Tecnativa," "Odoo Community Association (OCA)",
"website": "https://github.com/OC... | 34.2 | 855 |
7,006 | py | PYTHON | 15.0 | # Copyright 2018 Tecnativa - Ernesto Tejeda
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo.tests.common import TransactionCase
class TestSaleOrderLinePriceHistory(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.partner_1 = cls.env.ref("b... | 44.341772 | 7,006 |
396 | py | PYTHON | 15.0 | # Copyright 2021 Tecnativa - David Vidal
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class SaleOrderLine(models.Model):
_inherit = "sale.order.line"
# In core this a related field. We need to trigger its value on view, so we can
# have it even when we'r... | 36 | 396 |
4,511 | py | PYTHON | 15.0 | # Copyright 2019 Tecnativa - Ernesto Tejeda
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
class SaleOrderLinePriceHistory(models.TransientModel):
_name = "sale.order.line.price.history"
_description = "Sale order line price history"
@api.model
de... | 33.414815 | 4,511 |
767 | py | PYTHON | 15.0 | # Copyright 2011 Akretion, Sodexis
# Copyright 2018 Akretion
# Copyright 2019 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Sale Exception",
"summary": "Custom exceptions on sale order",
"version": "15.0.1.0.0",
"category": "Generic Modules/Sale",
"aut... | 31.958333 | 767 |
4,705 | py | PYTHON | 15.0 | # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
import mock
from odoo.tests import TransactionCase
class TestSaleExceptionMultiRecord(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=Tru... | 37.64 | 4,705 |
6,441 | py | PYTHON | 15.0 | # Copyright 2011 Akretion, Sodexis
# Copyright 2018 Akretion
# Copyright 2019 Camptocamp SA
# Copyright 2021 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
from odoo.exceptions import ValidationError
from odoo.tests import Form, TransactionCase
class TestSaleException(Tran... | 37.005747 | 6,439 |
617 | py | PYTHON | 15.0 | # Copyright 2011 Akretion, Sodexis
# Copyright 2018 Akretion
# Copyright 2019 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
class SaleExceptionConfirm(models.TransientModel):
_name = "sale.exception.confirm"
_inherit = ["exception.rule.confi... | 32.473684 | 617 |
1,801 | py | PYTHON | 15.0 | # © 2019 Akretion
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import html
from odoo import api, fields, models
class SaleOrderLine(models.Model):
_inherit = ["sale.order.line", "base.exception.method"]
_name = "sale.order.line"
exception_ids = fields.Many2many(
"excepti... | 33.333333 | 1,800 |
2,568 | py | PYTHON | 15.0 | # Copyright 2011 Akretion, Sodexis
# Copyright 2018 Akretion
# Copyright 2019 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models
class ExceptionRule(models.Model):
_inherit = "exception.rule"
model = fields.Selection(
selection_add... | 28.853933 | 2,568 |
547 | py | PYTHON | 15.0 | # Copyright 2021 ForgeFlow S.L. (https://www.forgeflow.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Sale Order Line Delivery State",
"summary": "Show the delivery state on the sale order line",
"version": "15.0.1.0.1",
"category": "Product",
"website": "https://gi... | 34.1875 | 547 |
4,486 | py | PYTHON | 15.0 | # Copyright 2021 ForgeFlow S.L. (https://www.forgeflow.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from unittest import mock
from odoo.tests import TransactionCase
class TestSaleLineDeliveryState(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
... | 38.672414 | 4,486 |
2,703 | py | PYTHON | 15.0 | # Copyright 2021 ForgeFlow S.L. (https://www.forgeflow.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
from odoo.tools import float_compare, float_is_zero
class SaleOrderLine(models.Model):
_inherit = "sale.order.line"
delivery_state = fields.Selecti... | 32.963415 | 2,703 |
706 | py | PYTHON | 15.0 | # Copyright 2014-2021 Akretion France (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# Copyright 2016-2019 Sodexis (http://sodexis.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Sale Start End Dates",
"version": "15.0.1.0.1",
"category":... | 39.222222 | 706 |
4,378 | py | PYTHON | 15.0 | # Copyright (C) 2018 Serpent Consulting Services Pvt. Ltd.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import datetime
from odoo.exceptions import ValidationError
from odoo.tests.common import TransactionCase
class TestSaleStartEndDates(TransactionCase):
def setUp(self):
super().setU... | 38.403509 | 4,378 |
6,623 | py | PYTHON | 15.0 | # Copyright 2014-2021 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# Copyright 2016-2021 Sodexis (http://sodexis.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from dateutil.relativedelta import relativedelta
from odoo import _, api, fields, models... | 38.730994 | 6,623 |
582 | py | PYTHON | 15.0 | # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Sale product set layout",
"category": "Sale",
"author": "ACSONE SA/NV, Anybox, Odoo Community Association (OCA)",
"version": "15.0.1.0.1",
"license": "AGPL-3",
"website": "https://github.com/OCA/sale-workflow",
"summ... | 29.1 | 582 |
1,468 | py | PYTHON | 15.0 | from odoo.tests import common
class TestProductSetLayout(common.TransactionCase):
"""Test Product set"""
def setUp(self):
super(TestProductSetLayout, self).setUp()
self.product_set_add = self.env["product.set.add"]
def test_add_set(self):
so = self.env.ref("sale.sale_order_6")
... | 35.804878 | 1,468 |
318 | py | PYTHON | 15.0 | from odoo import fields, models
class ProductSetLine(models.Model):
_inherit = "product.set.line"
product_id = fields.Many2one(required=False)
display_type = fields.Selection(
[
("line_section", "Section"),
("line_note", "Note"),
]
)
name = fields.Char()
| 22.714286 | 318 |
504 | py | PYTHON | 15.0 | from odoo import models
class ProductSetAdd(models.TransientModel):
_inherit = "product.set.add"
def prepare_sale_order_line_data(self, set_line, max_sequence=0):
"""
Adds specific sections data to lines
"""
sol_data = super().prepare_sale_order_line_data(set_line, max_sequenc... | 29.647059 | 504 |
454 | py | PYTHON | 15.0 | # Copyright 2017 ForgeFlow S.L.
# Copyright 2017 Serpent Consulting Services Pvt. Ltd.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import SUPERUSER_ID
from odoo.api import Environment
def post_init_hook(cr, pool):
"""
Fetches all the sale order and resets the sequence of t... | 30.266667 | 454 |
643 | py | PYTHON | 15.0 | # Copyright 2017 ForgeFlow S.L.
# Copyright 2017 Serpent Consulting Services Pvt. Ltd.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Sale Order Line Sequence",
"summary": "Propagates SO line sequence to invoices and stock picking.",
"version": "15.0.1.0.0",
"author": ... | 37.823529 | 643 |
1,238 | py | PYTHON | 15.0 | # Copyright 2019 Ecosoft Co., Ltd (http://ecosoft.co.th/)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html)
from odoo.tests.common import TransactionCase
class TestSaleOrderLineSequence(TransactionCase):
def setUp(self):
super(TestSaleOrderLineSequence, self).setUp()
self.sale_... | 35.371429 | 1,238 |
2,328 | py | PYTHON | 15.0 | # Copyright 2017 ForgeFlow S.L.
# Copyright 2017 Serpent Consulting Services Pvt. Ltd.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models
class SaleOrder(models.Model):
_inherit = "sale.order"
@api.depends("order_line")
def _compute_max_line_sequen... | 33.73913 | 2,328 |
563 | py | PYTHON | 15.0 | # Copyright 2017-To Day Akretion
# @author Sébastien BEAU <sebastien.beau@akretion.com>
# @author: Mourad EL HADJ MIMOUNE <mourad.elhadj.mimoune@akretion.com>
{
"name": "Sale shipping info helper",
"version": "15.0.1.0.0",
"category": "Sales",
"license": "AGPL-3",
"development_status": "Production... | 33.058824 | 562 |
4,506 | py | PYTHON | 15.0 | # Copyright 2017 Akretion (Mourad EL HADJ MIMOUNE <mourad.elhadj.mimoune@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.tests import Form, common
from odoo.tools import float_compare
class TestDeliveryCost(common.TransactionCase):
def setUp(self):
super(Tes... | 37.865546 | 4,506 |
1,922 | py | PYTHON | 15.0 | # Copyright 2017-To Day Akretion
# @author Sébastien BEAU <sebastien.beau@akretion.com>
# @author: Mourad EL HADJ MIMOUNE <mourad.elhadj.mimoune@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
class SaleOrder(models.Model):
_inherit = "sale.orde... | 38.42 | 1,921 |
481 | py | PYTHON | 15.0 | # Copyright 2018 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
{
"name": "GraphQL Demo",
"version": "14.0.1.0.0",
"license": "LGPL-3",
"author": "ACSONE SA/NV, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/rest-framework",
"depends": ["grap... | 32.066667 | 481 |
2,836 | py | PYTHON | 15.0 | # Copyright 2018 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
# disable undefined variable error, which erroneously triggers
# on forward declarations of classes in lambdas
# pylint: disable=E0602
import graphene
from odoo import _
from odoo.exceptions import UserError
from odoo.addo... | 28.079208 | 2,836 |
2,333 | py | PYTHON | 15.0 | # Copyright 2018 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
import logging
from graphene.test import Client
from odoo.tests import TransactionCase
from ..schema import schema
class TestGraphene(TransactionCase):
@classmethod
def setUpClass(cls):
super(TestGraphene... | 33.328571 | 2,333 |
5,974 | py | PYTHON | 15.0 | # Copyright 2018 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
import json
from werkzeug.urls import url_encode
from odoo.tests import HttpCase
from odoo.tests.common import HOST
from odoo.tools import config, mute_logger
class TestController(HttpCase):
def url_open_json(self, ur... | 37.78481 | 5,970 |
1,078 | py | PYTHON | 15.0 | # Copyright 2018 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from odoo import http
from odoo.addons.graphql_base import GraphQLControllerMixin
from ..schema import schema
class GraphQLController(http.Controller, GraphQLControllerMixin):
# The GraphiQL route, providing an IDE f... | 37.172414 | 1,078 |
275 | py | PYTHON | 15.0 | # Copyright 2022 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
class ExtendableRegistriesDatabase(dict):
"""Holds an extendable classses registry for each database"""
_extendable_registries_database = ExtendableRegistriesDatabase()
| 30.555556 | 275 |
520 | py | PYTHON | 15.0 | # Copyright 2022 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
{
"name": "Extendable",
"summary": """
Extendable classes registry loader for Odoo""",
"version": "15.0.1.0.1",
"development_status": "Beta",
"maintainers": ["lmignon"],
"license": "LGPL-3"... | 32.5 | 520 |
2,226 | py | PYTHON | 15.0 | # Copyright 2022 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
from contextlib import contextmanager
import odoo
from odoo import api
from odoo.tests import common
from extendable.context import extendable_registry
def _get_addon_name(full_name: str) -> str:
# The (Odoo) modu... | 35.903226 | 2,226 |
795 | py | PYTHON | 15.0 | # Copyright 2022 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
from contextlib import contextmanager
from odoo import models
from odoo.http import request
from extendable import context
from ..registry import _extendable_registries_database
class IrHttp(models.AbstractModel):
... | 26.5 | 795 |
2,293 | py | PYTHON | 15.0 | # Copyright 2022 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
"""
Extendale classes Loader
========================
Load the extendable classes at the build of a registry.
"""
from typing import List, Optional
import odoo
from odoo import api, models
from extendable.registry im... | 33.720588 | 2,293 |
758 | py | PYTHON | 15.0 | # Copyright 2018 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
{
"name": "Base Rest Demo",
"summary": """
Demo addon for Base REST""",
"version": "15.0.1.0.2",
"development_status": "Beta",
"license": "LGPL-3",
"author": "ACSONE SA/NV, " "Odoo Community As... | 27.071429 | 758 |
771 | py | PYTHON | 15.0 | # Copyright 2019 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from marshmallow import fields
from odoo.addons.datamodel.core import Datamodel
from odoo.addons.datamodel.fields import NestedModel
class PartnerInfo(Datamodel):
_name = "partner.info"
_inherit = "partner.short.in... | 36.714286 | 771 |
347 | py | PYTHON | 15.0 | # Copyright 2019 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from marshmallow import fields
from odoo.addons.datamodel.core import Datamodel
class StateInfo(Datamodel):
_name = "state.info"
id = fields.Integer(required=True, allow_none=False)
name = fields.String(requir... | 26.692308 | 347 |
351 | py | PYTHON | 15.0 | # Copyright 2019 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from marshmallow import fields
from odoo.addons.datamodel.core import Datamodel
class CountryInfo(Datamodel):
_name = "country.info"
id = fields.Integer(required=True, allow_none=False)
name = fields.String(re... | 27 | 351 |
368 | py | PYTHON | 15.0 | # Copyright 2019 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from marshmallow import fields
from odoo.addons.datamodel.core import Datamodel
class PartnerSearchParam(Datamodel):
_name = "partner.search.param"
id = fields.Integer(required=False, allow_none=False)
name = ... | 28.307692 | 368 |
362 | py | PYTHON | 15.0 | # Copyright 2019 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from marshmallow import fields
from odoo.addons.datamodel.core import Datamodel
class PartnerShortInfo(Datamodel):
_name = "partner.short.info"
id = fields.Integer(required=True, allow_none=False)
name = field... | 27.846154 | 362 |
2,007 | py | PYTHON | 15.0 | # Copyright 2018 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
import jsondiff
from .common import CommonCase, get_canonical_json
class TestOpenAPI(CommonCase):
def _fix_server_url(self, openapi_def):
# The server url depends of base_url. base_url depends of the odoo
... | 40.14 | 2,007 |
1,605 | py | PYTHON | 15.0 | # Copyright 2018 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
import json
import os
from odoo.addons.base_rest.controllers.main import _PseudoCollection
from odoo.addons.base_rest.tests.common import BaseRestCase
from odoo.addons.component.core import WorkContext
from odoo.addons.exten... | 35.666667 | 1,605 |
4,405 | py | PYTHON | 15.0 | # Copyright 2018 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
import json
import odoo.tools
from odoo.tests import HttpCase
from odoo.tests.common import tagged
from odoo.addons.base_rest.tests.common import RegistryMixin
@tagged("-at_install", "post_install")
class TestException(Htt... | 43.186275 | 4,405 |
1,635 | py | PYTHON | 15.0 | # Copyright 2018 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from odoo.http import controllers_per_module
from ..controllers.main import (
BaseRestDemoJwtApiController,
BaseRestDemoNewApiController,
BaseRestDemoPrivateApiController,
BaseRestDemoPublicApiController,
)
f... | 30.849057 | 1,635 |
558 | py | PYTHON | 15.0 | # Copyright 2021 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
import pydantic
from .country_info import CountryInfo
from .partner_short_info import PartnerShortInfo
from .state_info import StateInfo
class PartnerInfo(PartnerShortInfo):
street: str
street2: str = None
zip... | 27.9 | 558 |
199 | py | PYTHON | 15.0 | # Copyright 2021 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from .naive_orm_model import NaiveOrmModel
class StateInfo(NaiveOrmModel):
id: int
name: str
| 19.9 | 199 |
201 | py | PYTHON | 15.0 | # Copyright 2021 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from .naive_orm_model import NaiveOrmModel
class CountryInfo(NaiveOrmModel):
id: int
name: str
| 20.1 | 201 |
372 | py | PYTHON | 15.0 | # Copyright 2021 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from extendable_pydantic import ExtendableModelMeta
from odoo.addons.pydantic import utils
from pydantic import BaseModel
class NaiveOrmModel(BaseModel, metaclass=ExtendableModelMeta):
class Config:
orm_mode =... | 26.571429 | 372 |
290 | py | PYTHON | 15.0 | # Copyright 2021 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from extendable_pydantic import ExtendableModelMeta
from pydantic import BaseModel
class PartnerSearchParam(BaseModel, metaclass=ExtendableModelMeta):
id: int = None
name: str = None
| 24.166667 | 290 |
206 | py | PYTHON | 15.0 | # Copyright 2021 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from .naive_orm_model import NaiveOrmModel
class PartnerShortInfo(NaiveOrmModel):
id: int
name: str
| 20.6 | 206 |
1,142 | py | PYTHON | 15.0 | # Copyright 2018 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from odoo.addons.base_rest.controllers import main
class BaseRestDemoPublicApiController(main.RestController):
_root_path = "/base_rest_demo_api/public/"
_collection_name = "base.rest.demo.public.services"
_defa... | 35.6875 | 1,142 |
288 | py | PYTHON | 15.0 | # Copyright 2021 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from odoo.addons.component.core import Component
class PingJwtService(Component):
_inherit = "ping.service"
_name = "ping.jwt.service"
_collection = "base.rest.demo.jwt.services"
| 28.8 | 288 |
1,798 | py | PYTHON | 15.0 | # Copyright 2018 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
import base64
from odoo import _
from odoo.exceptions import MissingError
from odoo.http import request
from odoo.addons.base_rest.components.service import skip_secure_response
from odoo.addons.component.core import Compone... | 31.54386 | 1,798 |
3,635 | py | PYTHON | 15.0 | # Copyright 2018 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from werkzeug.exceptions import MethodNotAllowed
from odoo import _
from odoo.exceptions import (
AccessDenied,
AccessError,
MissingError,
UserError,
ValidationError,
)
from odoo.http import SessionExpire... | 25.964286 | 3,635 |
2,773 | py | PYTHON | 15.0 | # Copyright 2018 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from odoo.addons.base_rest.components.service import to_int
from odoo.addons.component.core import Component
class PingService(Component):
_inherit = "base.rest.service"
_name = "ping.service"
_usage = "ping"
... | 32.623529 | 2,773 |
2,660 | py | PYTHON | 15.0 | # Copyright 2018 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from odoo.addons.base_rest import restapi
from odoo.addons.base_rest_datamodel.restapi import Datamodel
from odoo.addons.component.core import Component
class PartnerNewApiService(Component):
_inherit = "base.rest.servic... | 36.438356 | 2,660 |
2,100 | py | PYTHON | 15.0 | # Copyright 2018 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from odoo.addons.base_rest import restapi
from odoo.addons.base_rest_pydantic.restapi import PydanticModel, PydanticModelList
from odoo.addons.component.core import Component
from ..pydantic_models.partner_info import Partner... | 35 | 2,100 |
5,477 | py | PYTHON | 15.0 | # Copyright 2018 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from odoo.addons.base_rest.components.service import to_bool, to_int
from odoo.addons.component.core import Component
class PartnerService(Component):
_inherit = "base.rest.service"
_name = "partner.service"
_usa... | 33.601227 | 5,477 |
550 | py | PYTHON | 15.0 | # Copyright 2020 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
{
"name": "Base Rest Datamodel",
"summary": """
Datamodel binding for base_rest""",
"version": "15.0.1.1.0",
"license": "LGPL-3",
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",
... | 32.352941 | 550 |
3,506 | py | PYTHON | 15.0 | # Copyright 2020 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
import marshmallow
from apispec.ext.marshmallow.openapi import OpenAPIConverter
from marshmallow.exceptions import ValidationError
from odoo import _
from odoo.exceptions import UserError
from odoo.addons.base_rest import r... | 35.06 | 3,506 |
2,089 | py | PYTHON | 15.0 | # Copyright 2021 Wakari SRL
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
import mock
from odoo.exceptions import UserError
from odoo.addons.datamodel import fields
from odoo.addons.datamodel.core import Datamodel
from odoo.addons.datamodel.tests import common
from .. import restapi
class TestDat... | 39.415094 | 2,089 |
3,325 | py | PYTHON | 15.0 | # Copyright 2021 Wakari SRL
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
import marshmallow
import mock
from odoo.addons.base_rest_datamodel import restapi
from odoo.addons.datamodel import fields
from odoo.addons.datamodel.core import Datamodel
from odoo.addons.datamodel.tests import common
class... | 43.75 | 3,325 |
667 | py | PYTHON | 15.0 | # Copyright 2021 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
{
"name": "Base Rest Auth Api Key",
"summary": """
Base Rest: Add support for the auth_api_key security policy into the
openapi documentation""",
"version": "15.0.1.0.0",
"license": "LGPL-3",
... | 30.318182 | 667 |
550 | py | PYTHON | 15.0 | # Copyright 2021 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from odoo.addons.component.core import AbstractComponent
from ..apispec.rest_method_security_plugin import RestMethodSecurityPlugin
class BaseRestService(AbstractComponent):
_inherit = "base.rest.service"
def _get... | 32.352941 | 550 |
1,340 | py | PYTHON | 15.0 | # Copyright 2021 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from apispec import BasePlugin
class RestMethodSecurityPlugin(BasePlugin):
def __init__(self, service):
super(RestMethodSecurityPlugin, self).__init__()
self._service = service
# pylint: disabl... | 38.285714 | 1,340 |
1,064 | py | PYTHON | 15.0 | import setuptools
with open('VERSION.txt', 'r') as f:
version = f.read().strip()
setuptools.setup(
name="odoo-addons-oca-rest-framework",
description="Meta package for oca-rest-framework Odoo addons",
version=version,
install_requires=[
'odoo-addon-base_rest>=15.0dev,<15.1dev',
'od... | 36.689655 | 1,064 |
100 | py | PYTHON | 15.0 | import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
| 16.666667 | 100 |
100 | py | PYTHON | 15.0 | import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
| 16.666667 | 100 |
100 | py | PYTHON | 15.0 | import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
| 16.666667 | 100 |
100 | py | PYTHON | 15.0 | import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
| 16.666667 | 100 |
100 | py | PYTHON | 15.0 | import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
| 16.666667 | 100 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.