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 |
|---|---|---|---|---|---|---|
2,123 | py | PYTHON | 15.0 | # Copyright 2020 Tecnativa - Ernesto Tejeda
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo.exceptions import ValidationError
from odoo.tests import TransactionCase
class TestProductCategoryActive(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()... | 40.826923 | 2,123 |
978 | py | PYTHON | 15.0 | # Copyright 2020 Tecnativa - Ernesto Tejeda
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import _, api, fields, models
from odoo.exceptions import ValidationError
class ProductCategory(models.Model):
_inherit = "product.category"
active = fields.Boolean(
default=Tr... | 32.6 | 978 |
578 | py | PYTHON | 15.0 | # Copyright 2020 Vauxoo, S.A. de C.V.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
{
"name": "Product Order No Name",
"summary": "Speedup product retrieve",
"version": "15.0.1.0.0",
"development_status": "Production/Stable",
"category": "Technical Settings",
"website": "https... | 36.125 | 578 |
192 | py | PYTHON | 15.0 | from odoo import fields, models
class ProductTemplate(models.Model):
_inherit = "product.template"
_order = "priority desc, default_code"
default_code = fields.Char(index=True)
| 24 | 192 |
142 | py | PYTHON | 15.0 | from odoo import models
class ProductProduct(models.Model):
_inherit = "product.product"
_order = "priority desc, default_code, id"
| 23.666667 | 142 |
760 | py | PYTHON | 15.0 | # Copyright 2017 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Product State",
"summary": """
Module introducing a state field on product template""",
"author": "ACSONE SA/NV, Odoo Community Association (OCA)",
"website": "http... | 34.545455 | 760 |
2,938 | py | PYTHON | 15.0 | # Copyright 2021 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
import logging
from odoo.exceptions import UserError, ValidationError
from odoo.tests.common import TransactionCase
_logger = logging.getLogger(__name__)
class TestProductState(TransactionCase):
... | 33.011236 | 2,938 |
1,762 | py | PYTHON | 15.0 | # Copyright 2017 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import _, api, fields, models
from odoo.exceptions import ValidationError
class ProductState(models.Model):
_name = "product.state"
_description = "Product State"
_order = "s... | 35.959184 | 1,762 |
2,166 | py | PYTHON | 15.0 | # Copyright 2017-2021 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import _, api, fields, models
from odoo.exceptions import UserError
class ProductTemplate(models.Model):
_inherit = "product.template"
state = fields.Char(
string=... | 33.84375 | 2,166 |
418 | py | PYTHON | 15.0 | # Copyright 2020 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Product Category Product Link",
"summary": """
Allows to get products from a category""",
"version": "15.0.1.0.0",
"license": "AGPL-3",
"author": "ACSONE SA/NV,Odoo Community Association... | 32.153846 | 418 |
320 | py | PYTHON | 15.0 | # Copyright 2021 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class ProductCategory(models.Model):
_inherit = "product.category"
product_template_ids = fields.One2many(
"product.template", "categ_id", string="Products Templates"
)
| 24.615385 | 320 |
260 | py | PYTHON | 15.0 | # Copyright 2021 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class ProductTemplate(models.Model):
_inherit = "product.template"
categ_id = fields.Many2one(
index=True,
)
| 20 | 260 |
803 | py | PYTHON | 15.0 | # © 2016 Antiun Ingeniería S.L. - Jairo Llopis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import logging
_logger = logging.getLogger(__name__)
try:
from odoo.addons.base_multi_image.hooks import (
pre_init_hook_for_submodules,
uninstall_hook_for_submodules,
)
except ... | 32.04 | 801 |
885 | py | PYTHON | 15.0 | # © 2014-2016 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# © 2015 Antiun Ingeniería S.L. - Jairo Llopis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Multiple Images in Products",
"version": "15.0.1.0.0",
"author": "Antiun Ingeniería, "
"Tecnativa, "
"LasLabs, "
... | 27.53125 | 881 |
8,188 | py | PYTHON | 15.0 | # © 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# Copyright 2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3).
from odoo.tests import common
from .. import hooks
class TestProductMultiImage(common.TransactionCase):
def setUp(self):
super().setUp()
self.transp... | 36.549107 | 8,187 |
396 | py | PYTHON | 15.0 | # © 2014-2016 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# © 2015 Antiun Ingeniería S.L. - Jairo Llopis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models
class ProductTemplate(models.Model):
_name = "product.template"
_inherit = [_name, "base_multi_image.owner"]
... | 32.75 | 393 |
3,427 | py | PYTHON | 15.0 | # © 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3).
from odoo import api, fields, models
class ProductProduct(models.Model):
_name = "product.product"
_inherit = [_name, "base_multi_image.owner"]
# Make this field computed for getting onl... | 40.785714 | 3,426 |
843 | py | PYTHON | 15.0 | # © 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3).
from odoo import api, fields, models
class Image(models.Model):
_inherit = "base_multi_image.image"
product_variant_ids = fields.Many2many(
comodel_name="product.product",
st... | 38.272727 | 842 |
621 | py | PYTHON | 15.0 | # Copyright 2017 Tecnativa - Carlos Dauden
# Copyright 2018 Tecnativa - Vicent Cubells
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Product Supplierinfo Revision",
"version": "15.0.1.0.0",
"category": "Product",
"website": "https://github.com/OCA/product-attribute",
"a... | 32.684211 | 621 |
1,628 | py | PYTHON | 15.0 | # Copyright 2016 Tecnativa - Sergio Teruel
# Copyright 2018 Tecnativa - Vicent Cubells
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from datetime import datetime
from dateutil.relativedelta import relativedelta
from odoo.tests import common, tagged
@tagged("post_install", "-at_install")
class Te... | 37 | 1,628 |
1,063 | py | PYTHON | 15.0 | # Copyright 2017 Tecnativa - Carlos Dauden
# Copyright 2020 Tecnativa - João Marques
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
class ProductSupplierinfo(models.Model):
_inherit = "product.supplierinfo"
previous_info_id = fields.Many2one(
com... | 33.1875 | 1,062 |
1,560 | py | PYTHON | 15.0 | # Copyright 2017 Tecnativa - Carlos Dauden
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from dateutil.relativedelta import relativedelta
from odoo import fields, models
class ProductSupplierInfoDuplicateWizard(models.TransientModel):
_name = "product.supplierinfo.duplicate.wizard"
_descri... | 35.454545 | 1,560 |
574 | py | PYTHON | 15.0 | # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Product Manufacturer",
"version": "15.0.1.0.2",
"summary": "Adds manufacturers and attributes on the product view.",
"website": "https://github.com/OCA/product-attribu... | 38.266667 | 574 |
5,116 | py | PYTHON | 15.0 | # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo.tests.common import TransactionCase
class TestProductManufacturer(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))
... | 39.658915 | 5,116 |
3,974 | py | PYTHON | 15.0 | # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models
class ProductTemplate(models.Model):
_inherit = "product.template"
manufacturer = fields.Many2one(
comodel_name="res.partner",
co... | 41.831579 | 3,974 |
492 | py | PYTHON | 15.0 | # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
class ProductProduct(models.Model):
_inherit = "product.product"
manufacturer = fields.Many2one(comodel_name="res.partner")
manufacturer_pname = f... | 37.846154 | 492 |
639 | py | PYTHON | 15.0 | # Copyright 2018 Tecnativa - Sergio Teruel
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Product Secondary Unit",
"summary": "Set a secondary unit per product",
"version": "15.0.2.0.1",
"development_status": "Production/Stable",
"category": "Product",
"website": "ht... | 37.588235 | 639 |
1,017 | py | PYTHON | 15.0 | # Copyright 2021 Tecnativa - Sergio Teruel
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
class SecondaryUnitFake(models.Model):
_name = "secondary.unit.fake"
_inherit = "product.secondary.unit.mixin"
_description = "Secondary unit fake model for test... | 36.321429 | 1,017 |
5,379 | py | PYTHON | 15.0 | # Copyright 2021 Tecnativa - Sergio Teruel
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo_test_helper import FakeModelLoader
from odoo.tests import TransactionCase
class TestProductSecondaryUnitMixin(TransactionCase, FakeModelLoader):
@classmethod
def setUpClass(cls):
supe... | 41.061069 | 5,379 |
2,198 | py | PYTHON | 15.0 | # Copyright 2018 Tecnativa - Sergio Teruel
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo.tests import TransactionCase, tagged
@tagged("post_install", "-at_install")
class TestProductSecondaryUnit(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
... | 36.633333 | 2,198 |
5,483 | py | PYTHON | 15.0 | # Copyright 2021 Tecnativa - Sergio Teruel
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
from odoo.tools.float_utils import float_round
class ProductSecondaryUnitMixin(models.AbstractModel):
"""
Mixin model that allows to compute a field from a secondary... | 38.886525 | 5,483 |
688 | 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 ProductTemplate(models.Model):
_inherit = "product.template"
secondary_uom_ids = fields.One2many(
comodel_name="product.secondary.unit",
inver... | 29.913043 | 688 |
1,225 | py | PYTHON | 15.0 | # Copyright 2023 Tecnativa - Sergio Teruel
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
class ProductProduct(models.Model):
_inherit = "product.product"
secondary_uom_ids = fields.One2many(
comodel_name="product.secondary.unit",
inverse... | 35 | 1,225 |
2,294 | 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 ProductSecondaryUnit(models.Model):
_name = "product.secondary.unit"
_description = "Product Secondary Unit"
name = fields.Char(required=True, translate=T... | 33.246377 | 2,294 |
772 | py | PYTHON | 15.0 | # Copyright 2015 OdooMRP team
# Copyright 2015 AvanzOSC
# Copyright 2015-18 Tecnativa
# Copyright 2017-18 ForgeFlow
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Product Supplierinfo for Customers",
"summary": "Allows to define prices for customers in the products",
"versi... | 35.090909 | 772 |
7,199 | py | PYTHON | 15.0 | # Copyright 2015 OdooMRP team
# Copyright 2015 AvanzOSC
# Copyright 2015 Tecnativa
# Copyright 2018 ForgeFlow
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo.tests.common import TransactionCase
class TestProductSupplierinfoForCustomer(TransactionCase):
@classmethod
def setUpCla... | 41.373563 | 7,199 |
425 | py | PYTHON | 15.0 | # Copyright 2015 OdooMRP team
# Copyright 2015 AvanzOSC
# Copyright 2015 Tecnativa
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
class ProductPricelistItem(models.Model):
_inherit = "product.pricelist.item"
base = fields.Selection(
selection_add... | 30.357143 | 425 |
1,678 | py | PYTHON | 15.0 | # Copyright 2019 ForgeFlow S.L.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import api, models
class ProductSupplierInfo(models.Model):
_inherit = "product.supplierinfo"
@api.model
def search(self, args, offset=0, limit=None, order=None, count=False):
res = sup... | 39.023256 | 1,678 |
721 | py | PYTHON | 15.0 | # Copyright 2019 Tecnativa - Pedro M. Baeza
# Copyright 2019 ForgeFlow S.L.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import _, api, fields, models
class ProductCustomerInfo(models.Model):
_inherit = "product.supplierinfo"
_name = "product.customerinfo"
_description =... | 32.772727 | 721 |
628 | py | PYTHON | 15.0 | # Copyright 2015 OdooMRP team
# Copyright 2015 AvanzOSC
# Copyright 2015 Tecnativa
# Copyright 2019 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
class ProductTemplate(models.Model):
_inherit = "product.template"
customer_ids ... | 28.545455 | 628 |
5,027 | py | PYTHON | 15.0 | # Copyright 2015 OdooMRP team
# Copyright 2015 AvanzOSC
# Copyright 2015 Tecnativa
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
import datetime
from odoo import api, models
class ProductProduct(models.Model):
_inherit = "product.product"
def name_get(self):
res = super(Produ... | 37.237037 | 5,027 |
654 | py | PYTHON | 15.0 | # Copyright 2015 OdooMRP team
# Copyright 2015 AvanzOSC
# Copyright 2015 Tecnativa
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import api, models
class ResPartner(models.Model):
_inherit = "res.partner"
@api.model
def default_get(self, fields):
res = super(ResP... | 29.727273 | 654 |
528 | py | PYTHON | 15.0 | # Copyright 2020 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Product Category Code",
"summary": """
Allows to define a code on product categories""",
"version": "15.0.1.0.0",
"license": "AGPL-3",
"author": "ACSONE SA/NV,Odoo Community Association ... | 27.789474 | 528 |
607 | py | PYTHON | 15.0 | # Copyright 2021 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import odoo.tests.common as common
class TestProductCategoryCode(common.TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
vals = {
"name":... | 26.391304 | 607 |
493 | py | PYTHON | 15.0 | # Copyright 2021 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import _, api, fields, models
class ProductCategory(models.Model):
_inherit = "product.category"
code = fields.Char(
default="/",
index=True,
)
@api.returns("self", lambda value:... | 24.65 | 493 |
693 | py | PYTHON | 15.0 | # Copyright 2020 ForgeFlow
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Product ABC Classification",
"summary": "Includes ABC classification for inventory management",
"version": "15.0.1.0.0",
"author": "ForgeFlow, Odoo Community Association (OCA)",
"website": "ht... | 34.65 | 693 |
1,018 | py | PYTHON | 15.0 | # Copyright 2020 ForgeFlow
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models
class ProductCategory(models.Model):
_inherit = "product.category"
abc_classification_profile_id = fields.Many2one("abc.classification.profile")
product_variant_ids = fie... | 39.153846 | 1,018 |
2,689 | py | PYTHON | 15.0 | # Copyright 2020 ForgeFlow
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models
class ProductTemplate(models.Model):
_inherit = "product.template"
abc_classification_profile_id = fields.Many2one(
"abc.classification.profile",
compute="_co... | 36.337838 | 2,689 |
9,806 | py | PYTHON | 15.0 | # Copyright 2020 ForgeFlow
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from datetime import timedelta
from odoo import _, api, fields, models
from odoo.exceptions import ValidationError
from odoo.tools import float_is_zero
class ABCClassificationProfile(models.Model):
_name = "abc.class... | 40.520661 | 9,806 |
2,820 | py | PYTHON | 15.0 | # Copyright 2020 ForgeFlow
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import _, api, fields, models
from odoo.exceptions import ValidationError
class ABCClassificationProfileLevel(models.Model):
_name = "abc.classification.profile.level"
_description = "ABC Classification... | 38.630137 | 2,820 |
457 | py | PYTHON | 15.0 | # Copyright 2021 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Product Pricelist Per Contact",
"version": "15.0.1.0.0",
"category": "Product",
"website": "https://github.com/OCA/product-attribute",
"author": "Tecnativa, Odoo Community Associat... | 32.642857 | 457 |
602 | py | PYTHON | 15.0 | # Copyright 2021 Camptocamp SA
# @author Iván Todorovich <ivan.todorovich@gmail.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Inventory Product Template Tags",
"summary": "Show product tags menu in Inventory app",
"version": "15.0.1.0.0",
"license": "AGPL-3",
"auth... | 37.5625 | 601 |
482 | py | PYTHON | 15.0 | # Copyright 2019 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
{
"name": "Scheduled Actions as Queue Jobs",
"version": "15.0.1.0.0",
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/queue",
"license... | 34.428571 | 482 |
1,685 | py | PYTHON | 15.0 | # Copyright 2019 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.tests.common import TransactionCase
class TestQueueJobCron(TransactionCase):
def setUp(self):
super().setUp()
def test_queue_job_cron(self):
QueueJob = self.env["q... | 41.097561 | 1,685 |
2,177 | py | PYTHON | 15.0 | # Copyright 2019 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
import logging
from odoo import api, fields, models
_logger = logging.getLogger(__name__)
class IrCron(models.Model):
_inherit = "ir.cron"
run_as_queue_job = fields.Boolean(
help="... | 35.688525 | 2,177 |
1,167 | py | PYTHON | 15.0 | # Copyright 2012-2016 Camptocamp
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
class BaseQueueJobError(Exception):
"""Base queue job error"""
class JobError(BaseQueueJobError):
"""A job had an error"""
class NoSuchJobError(JobError):
"""The job does not exist."""
class FailedJo... | 27.139535 | 1,167 |
4,316 | py | PYTHON | 15.0 | # copyright 2016 Camptocamp
# license lgpl-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
import json
from datetime import date, datetime
import dateutil
import lxml
from odoo import fields, models
from odoo.tools.func import lazy
class JobSerialized(fields.Field):
"""Provide the storage for job fields s... | 35.089431 | 4,316 |
1,087 | py | PYTHON | 15.0 | # Copyright 2020 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import logging
logger = logging.getLogger(__name__)
def post_init_hook(cr, registry):
# this is the trigger that sends notifications when jobs change
logger.info("Create queue_job_notify trigger")
cr.execute(
... | 32.939394 | 1,087 |
27,668 | py | PYTHON | 15.0 | # Copyright 2013-2020 Camptocamp
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
import hashlib
import inspect
import logging
import os
import sys
import uuid
import weakref
from datetime import datetime, timedelta
from functools import total_ordering
from random import randint
import odoo
from .... | 30.983203 | 27,668 |
1,334 | py | PYTHON | 15.0 | # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
{
"name": "Job Queue",
"version": "15.0.2.3.0",
"author": "Camptocamp,ACSONE SA/NV,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/queue",
"license": "LGPL-3",
"category": "Generic Modules",
"depends":... | 36.054054 | 1,334 |
19,985 | py | PYTHON | 15.0 | # Copyright 2019 Camptocamp
# Copyright 2019 Guewen Baconnier
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
import itertools
import logging
import os
import uuid
from collections import defaultdict, deque
from .job import Job
_logger = logging.getLogger(__name__)
def group(*delayables):
"... | 31.820064 | 19,983 |
902 | py | PYTHON | 15.0 | # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
from odoo.tools.sql import column_exists, table_exists
def migrate(cr, version):
if table_exists(cr, "queue_job") and not column_exists(
cr, "queue_job", "exec_time"
):
# Disable trigger otherwise the update takes ages.
... | 27.333333 | 902 |
1,371 | py | PYTHON | 15.0 | # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
import logging
from odoo import SUPERUSER_ID, api
_logger = logging.getLogger(__name__)
def migrate(cr, version):
with api.Environment.manage():
env = api.Environment(cr, SUPERUSER_ID, {})
_logger.info("Computing exception name... | 29.170213 | 1,371 |
1,420 | py | PYTHON | 15.0 | # license lgpl-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
from odoo.tests import common
class TestWizards(common.TransactionCase):
def setUp(self):
super().setUp()
self.job = (
self.env["queue.job"]
.with_context(
_job_edit_sentinel=self.env["queue... | 29.583333 | 1,420 |
2,284 | py | PYTHON | 15.0 | # copyright 2020 Camptocamp
# license lgpl-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
from odoo import exceptions
from odoo.tests import common
class TestJobFunction(common.TransactionCase):
def test_function_name_compute(self):
function = self.env["queue.job.function"].create(
{"mo... | 40.070175 | 2,284 |
5,876 | py | PYTHON | 15.0 | # copyright 2016 Camptocamp
# license lgpl-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
import json
from datetime import date, datetime
from lxml import etree
from odoo.tests import common
# pylint: disable=odoo-addons-relative-import
# we are testing, we want to test as we were an external consumer of the ... | 38.657895 | 5,876 |
15,028 | py | PYTHON | 15.0 | # Copyright 2019 Camptocamp
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import doctest
import logging
import sys
import typing
from contextlib import contextmanager
from itertools import groupby
from operator import attrgetter
from unittest import TestCase, mock
from odoo.addons.queue_job.delay imp... | 33.174393 | 15,028 |
350 | py | PYTHON | 15.0 | # Copyright 2015-2016 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
# pylint: disable=odoo-addons-relative-import
# we are testing, we want to test as we were an external consumer of the API
from odoo.addons.queue_job.jobrunner import runner
from .common import load_doctests
load_... | 35 | 350 |
354 | py | PYTHON | 15.0 | # Copyright 2015-2016 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
# pylint: disable=odoo-addons-relative-import
# we are testing, we want to test as we were an external consumer of the API
from odoo.addons.queue_job.jobrunner import channels
from .common import load_doctests
loa... | 35.4 | 354 |
2,284 | py | PYTHON | 15.0 | # copyright 2018 Camptocamp
# license lgpl-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
from psycopg2 import IntegrityError
import odoo
from odoo.tests import common
class TestJobChannel(common.TransactionCase):
def setUp(self):
super().setUp()
self.Channel = self.env["queue.job.channel"... | 38.711864 | 2,284 |
943 | py | PYTHON | 15.0 | # copyright 2020 Camptocamp
# license lgpl-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
from odoo import exceptions
from odoo.tests import common
class TestJobWriteProtected(common.TransactionCase):
def test_create_error(self):
with self.assertRaises(exceptions.AccessError):
self.env[... | 37.72 | 943 |
10,049 | py | PYTHON | 15.0 | # copyright 2019 Camptocamp
# license agpl-3.0 or later (http://www.gnu.org/licenses/agpl.html)
import unittest
from unittest import mock
from odoo.addons.queue_job.delay import Delayable, DelayableGraph
class TestDelayable(unittest.TestCase):
def setUp(self):
super().setUp()
self.recordset = mo... | 37.04428 | 10,039 |
18,026 | py | PYTHON | 15.0 | # Copyright 2013-2020 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
import logging
import random
from datetime import datetime, timedelta
from odoo import _, api, exceptions, fields, models
from odoo.osv import expression
from odoo.tools import config, html_escape
from odoo.addons... | 35.765873 | 18,026 |
3,417 | py | PYTHON | 15.0 | # Copyright 2013-2020 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
from odoo import _, api, exceptions, fields, models
class QueueJobChannel(models.Model):
_name = "queue.job.channel"
_description = "Job Channels"
name = fields.Char()
complete_name = fields.Char... | 36.351064 | 3,417 |
346 | py | PYTHON | 15.0 | # Copyright 2020 Camptocamp
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
from odoo import fields, models
class IrModelFields(models.Model):
_inherit = "ir.model.fields"
ttype = fields.Selection(
selection_add=[("job_serialized", "Job Serialized")],
ondelete={"job_seria... | 26.615385 | 346 |
9,426 | py | PYTHON | 15.0 | # Copyright 2013-2020 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
import ast
import logging
import re
from collections import namedtuple
from odoo import _, api, exceptions, fields, models, tools
from ..fields import JobSerialized
_logger = logging.getLogger(__name__)
regex_j... | 35.977099 | 9,426 |
10,352 | py | PYTHON | 15.0 | # Copyright 2016 Camptocamp
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
import functools
import logging
from odoo import api, models
from ..delay import Delayable
from ..job import DelayableRecordset
_logger = logging.getLogger(__name__)
class Base(models.AbstractModel):
"""The base mo... | 38.058824 | 10,352 |
18,946 | py | PYTHON | 15.0 | # Copyright (c) 2015-2016 ACSONE SA/NV (<http://acsone.eu>)
# Copyright 2015-2016 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
"""
What is the job runner?
-----------------------
The job runner is the main process managing the dispatch of delayed jobs to
available Odoo workers
How ... | 35.479401 | 18,946 |
36,655 | py | PYTHON | 15.0 | # Copyright (c) 2015-2016 ACSONE SA/NV (<http://acsone.eu>)
# Copyright 2015-2016 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
import logging
from functools import total_ordering
from heapq import heappop, heappush
from weakref import WeakValueDictionary
from ..exception import Cha... | 33.969416 | 36,653 |
209 | py | PYTHON | 15.0 | import odoo
from .runner import QueueJobRunner
def main():
odoo.tools.config.parse_config()
runner = QueueJobRunner.from_environ_or_config()
runner.run()
if __name__ == "__main__":
main()
| 16.076923 | 209 |
429 | py | PYTHON | 15.0 | # Copyright 2013-2020 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
from odoo import models
class SetJobsToDone(models.TransientModel):
_inherit = "queue.requeue.job"
_name = "queue.jobs.to.done"
_description = "Set all selected jobs to done"
def set_done(self):
... | 28.6 | 429 |
765 | py | PYTHON | 15.0 | # Copyright 2013-2020 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
from odoo import fields, models
class QueueRequeueJob(models.TransientModel):
_name = "queue.requeue.job"
_description = "Wizard to requeue a selection of jobs"
def _default_job_ids(self):
res... | 30.6 | 765 |
531 | py | PYTHON | 15.0 | # Copyright 2013-2020 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
from odoo import models
class SetJobsToCancelled(models.TransientModel):
_inherit = "queue.requeue.job"
_name = "queue.jobs.to.cancelled"
_description = "Cancel all selected jobs"
def set_cancelle... | 31.235294 | 531 |
9,787 | py | PYTHON | 15.0 | # Copyright (c) 2015-2016 ACSONE SA/NV (<http://acsone.eu>)
# Copyright 2013-2016 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
import logging
import random
import time
import traceback
from io import StringIO
from psycopg2 import OperationalError, errorcodes
from werkzeug.exceptio... | 32.952862 | 9,787 |
725 | py | PYTHON | 15.0 | import setuptools
with open('VERSION.txt', 'r') as f:
version = f.read().strip()
setuptools.setup(
name="odoo-addons-oca-queue",
description="Meta package for oca-queue Odoo addons",
version=version,
install_requires=[
'odoo-addon-base_export_async>=15.0dev,<15.1dev',
'odoo-addon-q... | 31.521739 | 725 |
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 |
100 | py | PYTHON | 15.0 | import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
| 16.666667 | 100 |
475 | py | PYTHON | 15.0 | {
"name": "Queue Job Cron Jobrunner",
"summary": "Run jobs without a dedicated JobRunner",
"version": "15.0.2.0.0",
"development_status": "Alpha",
"author": "Camptocamp SA, Odoo Community Association (OCA)",
"maintainers": ["ivantodorovich"],
"website": "https://github.com/OCA/queue",
"l... | 29.6875 | 475 |
3,270 | py | PYTHON | 15.0 | # Copyright 2022 Camptocamp SA (https://www.camptocamp.com).
# @author Iván Todorovich <ivan.todorovich@camptocamp.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from datetime import timedelta
from freezegun import freeze_time
from odoo import fields
from odoo.tests.common import TransactionCa... | 46.042254 | 3,269 |
5,937 | py | PYTHON | 15.0 | # Copyright 2022 Camptocamp SA (https://www.camptocamp.com).
# @author Iván Todorovich <ivan.todorovich@camptocamp.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
import logging
import traceback
from io import StringIO
from psycopg2 import OperationalError
from odoo import _, api, models, tools... | 35.333333 | 5,936 |
397 | py | PYTHON | 15.0 | # Copyright 2022 Camptocamp SA (https://www.camptocamp.com).
# @author Iván Todorovich <ivan.todorovich@camptocamp.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import fields, models
class IrCron(models.Model):
_inherit = "ir.cron"
queue_job_runner = fields.Boolean(
... | 30.461538 | 396 |
721 | py | PYTHON | 15.0 | # @author Stéphane Bidoul <stephane.bidoul@acsone.eu>
# @author Sébastien BEAU <sebastien.beau@akretion.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Asynchronous Import",
"summary": "Import CSV files in the background",
"version": "14.0.1.0.1",
"author": "Akretion, A... | 39.944444 | 719 |
541 | py | PYTHON | 15.0 | # Copyright 2017 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import _, models
class QueueJob(models.Model):
""" Job status and result """
_inherit = "queue.job"
def _related_action_attachment(self):
res_id = self.kwargs.get("att_id")
action = ... | 25.761905 | 541 |
6,749 | py | PYTHON | 15.0 | # Copyright 2014 ACSONE SA/NV (http://acsone.eu).
# Copyright 2013 Akretion (http://www.akretion.com).
# @author Stéphane Bidoul <stephane.bidoul@acsone.eu>
# @author Sébastien BEAU <sebastien.beau@akretion.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
import base64
import csv
from io import By... | 37.071429 | 6,747 |
666 | py | PYTHON | 15.0 | # Copyright 2014 ACSONE SA/NV (http://acsone.eu)
# @author Stéphane Bidoul <stephane.bidoul@acsone.eu>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Test suite for base_import_async",
"version": "14.0.1.0.1",
"author": "ACSONE SA/NV, Odoo Community Association (OCA)",
"lice... | 33.25 | 665 |
8,070 | py | PYTHON | 15.0 | # Copyright 2014 ACSONE SA/NV (http://acsone.eu)
# @author Stéphane Bidoul <stephane.bidoul@acsone.eu>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import os
import odoo.tests.common as common
from odoo.addons.base_import_async.models.base_import_import import (
OPT_CHUNK_SIZE,
OPT_HAS_HEA... | 38.793269 | 8,069 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.