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 |
|---|---|---|---|---|---|---|
552 | py | PYTHON | 15.0 | # Copyright 2017 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
{
"name": "Connector Tests",
"summary": "Automated tests for Connector, do not install.",
"version": "15.0.1.0.0",
"author": "Camptocamp,Odoo Community Association (OCA)",
"license": "LGPL-3",
"ca... | 30.666667 | 552 |
2,321 | py | PYTHON | 15.0 | # Copyright 2013-2017 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
import mock
from odoo.exceptions import UserError
from odoo.addons.component.tests.common import TransactionComponentCase
class TestRelatedActionBinding(TransactionComponentCase):
"""Test Related Actions wit... | 33.157143 | 2,321 |
2,136 | py | PYTHON | 15.0 | # Copyright 2013-2017 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
from odoo.addons.component.tests.common import TransactionComponentCase
class TestDefaultBinder(TransactionComponentCase):
"""Test the default binder implementation using Components"""
def setUp(self):
... | 48.545455 | 2,136 |
1,924 | py | PYTHON | 15.0 | # Copyright 2016 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
from odoo import fields, models
class TestBackend(models.Model):
_name = "test.backend"
_inherit = ["connector.backend"]
_description = "Backends for testing Connector"
class ConnectorTestRecord(models.M... | 26 | 1,924 |
612 | py | PYTHON | 15.0 | # Copyright 2016 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
from odoo.addons.component.core import Component
class ConnectorTestBinder(Component):
_name = "connector.test.binder"
_inherit = ["base.binder"]
_apply_on = ["connector.test.binding"]
class NoInheritsBin... | 27.818182 | 612 |
5,990 | py | PYTHON | 15.0 | # Copyright 2017 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
"""
Events Internals
================
Core classes for the events system.
"""
from odoo.addons.component.core import WorkContext
class EventWorkContext(WorkContext):
"""Work context used by the Events internal... | 37.4375 | 5,990 |
469 | py | PYTHON | 15.0 | # Copyright 2019 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
{
"name": "Components Events",
"version": "15.0.1.0.1",
"author": "Camptocamp," "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/connector",
"license": "LGPL-3",
"category": ... | 31.266667 | 469 |
17,026 | py | PYTHON | 15.0 | # Copyright 2017 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
import unittest
import mock
from odoo.tests.common import tagged
from odoo.addons.component.core import Component
from odoo.addons.component.tests.common import (
ComponentRegistryCase,
TransactionComponentReg... | 36.852814 | 17,026 |
4,127 | py | PYTHON | 15.0 | # Copyright 2017 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
"""
Base Model
==========
Extend the 'base' Odoo Model to add Events related features.
"""
from odoo import api, models
from odoo.addons.component.core import _component_databases
from ..components.event import Col... | 34.680672 | 4,127 |
9,356 | py | PYTHON | 15.0 | # Copyright 2017 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
"""
Events
======
Events are a notification system.
On one side, one or many listeners await for an event to happen. On
the other side, when such event happen, a notification is sent to
the listeners.
An example of ev... | 31.395973 | 9,356 |
719 | py | PYTHON | 15.0 | import setuptools
with open('VERSION.txt', 'r') as f:
version = f.read().strip()
setuptools.setup(
name="odoo-addons-oca-connector",
description="Meta package for oca-connector Odoo addons",
version=version,
install_requires=[
'odoo-addon-component>=15.0dev,<15.1dev',
'odoo-addon-c... | 31.26087 | 719 |
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 |
367 | py | PYTHON | 15.0 | # Copyright 2017 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
class ComponentException(Exception):
"""Base Exception for the components"""
class NoComponentError(ComponentException):
"""No component has been found"""
class SeveralComponentError(ComponentException):
... | 26.214286 | 367 |
34,488 | py | PYTHON | 15.0 | # Copyright 2017 Camptocamp SA
# Copyright 2017 Odoo
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
"""
Core
====
Core classes for the components.
The most common classes used publicly are:
* :class:`Component`
* :class:`AbstractComponent`
* :class:`WorkContext`
"""
import logging
import oper... | 36.885561 | 34,488 |
3,670 | py | PYTHON | 15.0 | # Copyright 2019 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
"""
Components Builder
==================
Build the components at the build of a registry.
"""
import odoo
from odoo import models
from .core import DEFAULT_CACHE_SIZE, ComponentRegistry, _component_databases
class... | 38.229167 | 3,670 |
675 | py | PYTHON | 15.0 | # Copyright 2017 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
{
"name": "Components",
"summary": "Add capabilities to register and use decoupled components,"
" as an alternative to model classes",
"version": "15.0.1.0.2",
"author": "Camptocamp," "Odoo Community ... | 30.681818 | 675 |
3,052 | py | PYTHON | 15.0 | # Copyright 2017 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
from odoo.addons.component.core import ComponentRegistry, WorkContext
from .common import TransactionComponentRegistryCase
class TestWorkOn(TransactionComponentRegistryCase):
"""Test on WorkContext
This model... | 41.808219 | 3,052 |
9,723 | py | PYTHON | 15.0 | # Copyright 2017 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
# Tell pylint to not bother us for all our fake component classes
# pylint: disable=consider-merging-classes-inherited
import mock
from odoo.addons.component.core import AbstractComponent, Component
from .common impor... | 34.115789 | 9,723 |
16,804 | py | PYTHON | 15.0 | # Copyright 2017 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
from contextlib import contextmanager
from odoo.addons.component.core import Component
from odoo.addons.component.exception import NoComponentError, SeveralComponentError
from .common import TransactionComponentRegistr... | 43.309278 | 16,804 |
8,045 | py | PYTHON | 15.0 | # Copyright 2017 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
import copy
import unittest
from contextlib import contextmanager
import odoo
from odoo import api
from odoo.tests import common
from odoo.addons.component.core import ComponentRegistry, MetaComponent, _get_addon_name
... | 36.73516 | 8,045 |
6,162 | py | PYTHON | 15.0 | # Copyright 2017 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
from odoo.addons.component.core import AbstractComponent, Component
from .common import TransactionComponentRegistryCase
class TestLookup(TransactionComponentRegistryCase):
"""Test the ComponentRegistry
Tests... | 32.09375 | 6,162 |
3,511 | py | PYTHON | 15.0 | # Copyright 2017 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
"""
Collection Model
================
This is the base Model shared by all the Collections.
In the context of the Connector, a collection is the Backend.
The `_name` given to the Collection Model will be the name
to us... | 34.762376 | 3,511 |
349 | py | PYTHON | 15.0 | # Copyright 2017 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
from ..core import AbstractComponent
class BaseComponent(AbstractComponent):
"""This is the base component for every component
It is implicitely inherited by all components.
All your base are belong to us... | 23.266667 | 349 |
971 | py | PYTHON | 15.0 | # Copyright 2012 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
from odoo.addons.queue_job.exception import JobError, RetryableJobError
# Connector related errors
class ConnectorException(Exception):
"""Base Exception for the connectors"""
class NoConnectorUnitError(Connecto... | 23.682927 | 971 |
2,967 | py | PYTHON | 15.0 | # Copyright 2013 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
import hashlib
import logging
import struct
_logger = logging.getLogger(__name__)
def pg_try_advisory_lock(env, lock):
"""Try to acquire a Postgres transactional advisory lock.
The function tries to acquire a... | 38.038462 | 2,967 |
564 | py | PYTHON | 15.0 | # Copyright 2013 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
{
"name": "Connector",
"version": "15.0.1.0.4",
"author": "Camptocamp,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/connector",
"license": "LGPL-3",
"category": "Generic Mo... | 31.333333 | 564 |
2,698 | py | PYTHON | 15.0 | # Copyright 2017 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
import mock
from odoo import api
from odoo.modules.registry import Registry
from odoo.tests import common
from odoo.addons.component.core import WorkContext
from odoo.addons.component.tests.common import TransactionCom... | 40.268657 | 2,698 |
2,115 | py | PYTHON | 15.0 | # Copyright 2017 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
import mock
from odoo.tools import frozendict
from odoo.addons.component.core import Component
from odoo.addons.component.tests.common import TransactionComponentRegistryCase
from odoo.addons.component_event.components... | 35.847458 | 2,115 |
30,880 | py | PYTHON | 15.0 | # Copyright 2013 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
import mock
from odoo.addons.component.core import Component, WorkContext
from odoo.addons.component.tests.common import TransactionComponentRegistryCase
from odoo.addons.connector.components.mapper import (
MapOpti... | 33.097535 | 30,880 |
1,588 | py | PYTHON | 15.0 | # Copyright 2018 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
import mock
from odoo import api
from odoo.modules.registry import Registry
from odoo.tests import common
from odoo.addons.component.core import WorkContext
from odoo.addons.component.tests.common import TransactionCompone... | 36.090909 | 1,588 |
3,950 | py | PYTHON | 15.0 | # Copyright 2013 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
from odoo import fields, models
class ConnectorBackend(models.AbstractModel):
"""An instance of an external backend to synchronize with.
The backends have to ``_inherit`` this model in the connectors
modu... | 32.644628 | 3,950 |
1,533 | py | PYTHON | 15.0 | # Copyright 2017 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
from odoo import _, models
class QueueJob(models.Model):
_inherit = "queue.job"
def related_action_unwrap_binding(self, component_usage="binder"):
"""Open a form view with the unwrapped record.
... | 34.840909 | 1,533 |
34,554 | py | PYTHON | 15.0 | # Copyright 2017 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
"""
Mappers
=======
Mappers are the components responsible to transform
external records into Odoo records and conversely.
"""
import logging
from collections import namedtuple
from contextlib import contextmanager
... | 32.783681 | 34,554 |
1,781 | py | PYTHON | 15.0 | # Copyright 2013 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
"""
Backend Adapter
===============
An external adapter has a common interface to speak with the backend.
It translates the basic orders (search, read, write) to the protocol
used by the backend.
"""
from odoo.addons... | 27.828125 | 1,781 |
2,685 | py | PYTHON | 15.0 | # Copyright 2018 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
import logging
import psycopg2
from odoo.addons.component.core import Component
from ..exception import RetryableJobError
_logger = logging.getLogger(__name__)
class RecordLocker(Component):
"""Component allowi... | 38.357143 | 2,685 |
4,397 | py | PYTHON | 15.0 | # Copyright 2017 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
"""
Base Component
==============
The connector proposes a 'base' Component, which can be used in
the ``_inherit`` of your own components. This is not a
requirement. It is already inherited by every component
provide... | 32.330882 | 4,397 |
5,226 | py | PYTHON | 15.0 | # Copyright 2013 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
"""
Binders
=======
Binders are components that know how to find the external ID for an
Odoo ID, how to find the Odoo ID for an external ID and how to
create the binding between them.
"""
from odoo import fields, mode... | 34.84 | 5,226 |
16,229 | py | PYTHON | 15.0 | # Copyright 2013 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
"""
Synchronizer
============
A synchronizer orchestrates a synchronization with a backend. It's the actor
who runs the flow and glues the logic of an import or export (or else).
It uses other components for specialize... | 36.387892 | 16,229 |
1,587 | py | PYTHON | 15.0 | # Copyright 2013 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
"""
Listeners
=========
Listeners are Components notified when events happen.
Documentation in :mod:`odoo.addons.component_event.components.event`
The base listener for the connectors add a method
:meth:`ConnectorListe... | 31.74 | 1,587 |
11,960 | py | PYTHON | 15.0 | #
# Connectors documentation build configuration file, created by
# sphinx-quickstart on Mon Feb 4 11:35:44 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values... | 31.808511 | 11,960 |
496 | py | PYTHON | 15.0 | # © 2014 David BEAL Akretion, Sodexis
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
{
"name": "Connector Base Product",
"version": "15.0.1.0.0",
"author": "Openerp Connector Core Editors, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/connector",
"licen... | 29.117647 | 495 |
573 | py | PYTHON | 15.0 | # Copyright 2019 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
{
"name": "Components Tests",
"summary": "Automated tests for Components, do not install.",
"version": "15.0.1.0.0",
"author": "Camptocamp,Odoo Community Association (OCA)",
"license": "LGPL-3",
"... | 33.705882 | 573 |
1,224 | py | PYTHON | 15.0 | # Copyright 2019 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
from odoo.addons.component.tests.common import TransactionComponentCase
class TestComponentInheritance(TransactionComponentCase):
def setUp(self):
super().setUp()
self.collection = self.env["test.co... | 40.8 | 1,224 |
967 | py | PYTHON | 15.0 | # Copyright 2013-2019 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
from odoo.addons.component.tests.common import TransactionComponentCase
from odoo.addons.test_component.components.components import UserTestComponent
class TestComponentCollection(TransactionComponentCase):
d... | 40.291667 | 967 |
328 | py | PYTHON | 15.0 | # Copyright 2016 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
from odoo import fields, models
class TestComponentCollection(models.Model):
_name = "test.component.collection"
_description = "Test Component Collection"
_inherit = ["collection.base"]
name = fields... | 25.230769 | 328 |
817 | py | PYTHON | 15.0 | # Copyright 2017 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
from odoo.addons.component.core import AbstractComponent, Component
class BaseComponent(AbstractComponent):
_inherit = "base"
def test_inherit_base(self):
return "test_inherit_base"
class Mapper(Abst... | 23.342857 | 817 |
567 | py | PYTHON | 15.0 | # © 2016 ForgeFlow S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Account Move Line Stock Info",
"version": "15.0.1.1.0",
"depends": ["stock_account"],
"author": "ForgeFlow," "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/stock-logistics-... | 33.294118 | 566 |
6,983 | py | PYTHON | 15.0 | # Copyright 2019 ForgeFlow S.L. (https://www.forgeflow.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo.tests.common import TransactionCase
class TestAccountMoveLineStockInfo(TransactionCase):
def setUp(self):
super(TestAccountMoveLineStockInfo, self).setUp()
s... | 40.132184 | 6,983 |
360 | py | PYTHON | 15.0 | # Copyright 2019 ForgeFlow S.L. (https://www.forgeflow.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
class AccountMoveLine(models.Model):
_inherit = "account.move.line"
stock_move_id = fields.Many2one(
comodel_name="stock.move", string="St... | 30 | 360 |
752 | py | PYTHON | 15.0 | # Copyright 2019 ForgeFlow S.L. (https://www.forgeflow.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models
class StockMove(models.Model):
_inherit = "stock.move"
account_move_line_ids = fields.One2many(
comodel_name="account.move.line",
... | 30.08 | 752 |
709 | py | PYTHON | 15.0 | # Copyright 2017-2020 ForgeFlow, S.L.
# Copyright 2021 Jacques-Etienne Baudoux (BCIM) <je@bcim.be>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Procurement Auto Create Group",
"version": "15.0.1.0.0",
"development_status": "Production/Stable",
"license": "AGPL-3",
... | 41.705882 | 709 |
8,973 | py | PYTHON | 15.0 | # Copyright 2017-2020 ForgeFlow, S.L.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo.tests.common import TransactionCase
class TestProcurementAutoCreateGroup(TransactionCase):
def setUp(self):
super(TestProcurementAutoCreateGroup, self).setUp()
self.group_obj = se... | 38.021186 | 8,973 |
917 | py | PYTHON | 15.0 | # Copyright 2017-2020 ForgeFlow, S.L.
# Copyright 2021 Jacques-Etienne Baudoux (BCIM) <je@bcim.be>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import api, models
class ProcurementGroup(models.Model):
_inherit = "procurement.group"
@api.model
def _get_rule(self, produc... | 36.68 | 917 |
1,335 | py | PYTHON | 15.0 | # Copyright 2017-2020 ForgeFlow, S.L.
# Copyright 2021 Jacques-Etienne Baudoux (BCIM) <je@bcim.be>
# 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 StockRule(models.Model):
_inherit = "stock.rule"
auto_c... | 39.264706 | 1,335 |
419 | py | PYTHON | 15.0 | # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import SUPERUSER_ID, api
def enable_multi_locations(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
ResConfig = env["res.config.settings"]
default_values = ResConfig.default_get(list(ResConfig.fields_get()))
default_v... | 41.9 | 419 |
901 | py | PYTHON | 15.0 | # Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
# Copyright 2018 Camptocamp SA
# Copyright 2020 Tecnativa - João Marques
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
{
"name": "Move Stock Location",
"version": "15.0.1.2.0",
"author": "Julius Network Solutions, "
... | 33.333333 | 900 |
5,780 | py | PYTHON | 15.0 | # Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
# Copyright 2018 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
from odoo.tests import Form, common
class TestsCommon(common.TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
... | 34.404762 | 5,780 |
11,132 | py | PYTHON | 15.0 | # Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
# Copyright 2018 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
from odoo.exceptions import ValidationError
from .test_common import TestsCommon
class TestMoveLocation(TestsCommon):
def setUp(self):
supe... | 44 | 11,132 |
2,846 | py | PYTHON | 15.0 | # Copyright Iryna Vyshnevska 2020 Camptocamp
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import odoo.tests.common as common
class TestFillwithStock(common.TransactionCase):
def setUp(self):
super(TestFillwithStock, self).setUp()
self.env = self.env(
context=dict(
... | 31.622222 | 2,846 |
6,374 | py | PYTHON | 15.0 | # Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
# Copyright 2018 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 import float_compare
class StockMoveLocationWizardLi... | 40.08805 | 6,374 |
13,368 | py | PYTHON | 15.0 | # Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
# Copyright 2018 Camptocamp SA
# Copyright 2019 Tecnativa - Sergio Teruel
# Copyright 2023 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
from itertools import groupby
from odoo import api, fields, models... | 39.087719 | 13,368 |
1,011 | py | PYTHON | 15.0 | # Copyright 2019 Tecnativa - Sergio Teruel
# Copyright 2023 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
class StockPickingType(models.Model):
_inherit = "stock.picking.type"
show_move_onhand = fields.Boolean(
string="... | 37.444444 | 1,011 |
604 | py | PYTHON | 15.0 | # Copyright 2019 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
from odoo import api, fields, models
class StockMove(models.Model):
_inherit = "stock.move"
location_move = fields.Boolean(
string="Part of move location",
help="Whether this move is a part of stock... | 30.2 | 604 |
1,664 | py | PYTHON | 15.0 | # Copyright Jacques-Etienne Baudoux 2016 Camptocamp
# Copyright Iryna Vyshnevska 2020 Camptocamp
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
from odoo import _, models
from odoo.exceptions import UserError
class StockPicking(models.Model):
_inherit = "stock.picking"
def button_fillwithsto... | 32.627451 | 1,664 |
360 | py | PYTHON | 15.0 | # Copyright 2019 Tecnativa - Ernesto Tejeda
# License AGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
def pre_init_hook(cr):
cr.execute(
"""ALTER TABLE stock_quant
ADD COLUMN adjustment_cost numeric
DEFAULT 0"""
)
cr.execute(
"""ALTER TABLE stock_quant
ALTER COLUMN... | 24 | 360 |
651 | py | PYTHON | 15.0 | # Copyright 2019 Tecnativa - Ernesto Tejeda
# Copyright 2019 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Stock Quant Cost Info",
"summary": "Shows the cost of the quants",
"version": "15.0.1.1.0",
"author": "Tecnativa, Odoo Community Association... | 38.294118 | 651 |
1,428 | py | PYTHON | 15.0 | # Copyright 2019 Tecnativa - Ernesto Tejeda
# Copyright 2019 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo.tests.common import TransactionCase, tagged
@tagged("post_install", "-at_install")
class TestStockQuantCostInfo(TransactionCase):
def setUp(self):
... | 38.594595 | 1,428 |
744 | py | PYTHON | 15.0 | # Copyright 2019 Tecnativa - Ernesto Tejeda
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
class StockQuant(models.Model):
_inherit = "stock.quant"
currency_id = fields.Many2one(
comodel_name="res.currency", string="Currency", related="company_i... | 33.818182 | 744 |
679 | py | PYTHON | 15.0 | # Copyright 2018 Camptocamp SA
# Copyright 2016-19 ForgeFlow S.L. (https://www.forgeflow.com)
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
{
"name": "Stock Available Unreserved",
"summary": "Quantity of stock available for immediate use",
"version": "15.0.1.0.0",
"author": "For... | 39.941176 | 679 |
17,235 | py | PYTHON | 15.0 | # Copyright 2018 Camptocamp SA
# Copyright 2016-19 ForgeFlow S.L. (https://www.forgeflow.com)
# Copyright 2019 JARSA Sistemas S.A. de C.V.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from odoo.tests.common import TransactionCase
class TestStockLogisticsWarehouse(TransactionCase):
@class... | 46.707317 | 17,235 |
879 | py | PYTHON | 15.0 | # Copyright 2018 Camptocamp SA
# Copyright 2016-19 ForgeFlow S.L. (https://www.forgeflow.com)
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from odoo import api, fields, models
class StockQuant(models.Model):
_inherit = "stock.quant"
contains_unreserved = fields.Boolean(
stri... | 33.807692 | 879 |
1,691 | py | PYTHON | 15.0 | # Copyright 2018 Camptocamp SA
# Copyright 2016-19 ForgeFlow S.L. (https://www.forgeflow.com)
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from odoo import api, fields, models
class ProductTemplate(models.Model):
_inherit = "product.template"
qty_available_not_res = fields.Float(
... | 38.431818 | 1,691 |
2,967 | py | PYTHON | 15.0 | # Copyright 2018 Camptocamp SA
# Copyright 2016-19 ForgeFlow S.L. (https://www.forgeflow.com)
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from odoo import _, api, fields, models
from odoo.exceptions import UserError
from odoo.tools.float_utils import float_round
from odoo.addons.stock.models... | 38.038462 | 2,967 |
647 | py | PYTHON | 15.0 | # Copyright 2014 Numérigraphe
# Copyright 2016 Sodexis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Stock available to promise",
"version": "15.0.1.0.0",
"author": "Numérigraphe, Sodexis, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/stock-logi... | 32.25 | 645 |
6,924 | py | PYTHON | 15.0 | # Copyright 2014 Numérigraphe
# Copyright 2016 Sodexis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.tests.common import TransactionCase
class TestStockLogisticsWarehouse(TransactionCase):
def test_res_config(self):
"""Test the config file"""
stock_setting = self.... | 38.461111 | 6,923 |
3,120 | py | PYTHON | 15.0 | # Copyright 2014 Numérigraphe
# Copyright 2016 Sodexis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models
from odoo.addons.stock.models.product import OPERATORS
class ProductTemplate(models.Model):
_inherit = "product.template"
@api.depends(
"p... | 37.130952 | 3,119 |
3,162 | py | PYTHON | 15.0 | # Copyright 2014 Numérigraphe
# Copyright 2016 Sodexis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models
from odoo.addons.stock.models.product import OPERATORS
class ProductProduct(models.Model):
"""Add a field for the stock available to promise.
Usef... | 35.122222 | 3,161 |
2,761 | py | PYTHON | 15.0 | # Copyright 2014 Numérigraphe
# Copyright 2016 Sodexis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models
class ResConfigSettings(models.TransientModel):
"""Add options to easily install the submodules"""
_inherit = "res.config.settings"
@api.model... | 36.8 | 2,760 |
549 | py | PYTHON | 15.0 | # Copyright 2019 ForgeFlow, S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
{
"name": "Stock Orderpoint Move Link",
"summary": "Link Reordering rules to stock moves",
"version": "15.0.1.0.0",
"license": "LGPL-3",
"website": "https://github.com/OCA/stock-logistics-warehous... | 34.3125 | 549 |
4,272 | py | PYTHON | 15.0 | # Copyright 2019 ForgeFlow S.L.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import ast
from odoo.tests.common import TransactionCase
class TestStockOrderpointMoveLink(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.product_obj = cls.env["produ... | 36.827586 | 4,272 |
891 | py | PYTHON | 15.0 | # Copyright 2019 ForgeFlow, S.L., Ecosoft
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from odoo import models
class StockRule(models.Model):
_inherit = "stock.rule"
def _get_stock_move_values(
self,
product_id,
product_qty,
product_uom,
locati... | 26.205882 | 891 |
711 | py | PYTHON | 15.0 | # Copyright 2019 ForgeFlow, S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from odoo import fields, models
class StockMove(models.Model):
_inherit = "stock.move"
orderpoint_ids = fields.Many2many(
comodel_name="stock.warehouse.orderpoint", string="Linked Reordering Rules"
... | 32.318182 | 711 |
666 | py | PYTHON | 15.0 | # Copyright 2019 ForgeFlow S.L.
# (http://www.forgeflow.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import models
class StockWarehouseOrderpoint(models.Model):
_inherit = "stock.warehouse.orderpoint"
def action_view_stock_picking(self):
action = self.env.re... | 31.714286 | 666 |
542 | py | PYTHON | 15.0 | # Copyright 2020 Camptocamp SA
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl)
{
"name": "Stock packaging calculator",
"summary": "Compute product quantity to pick by packaging",
"version": "15.0.1.0.0",
"development_status": "Alpha",
"category": "Warehouse Management",
"website"... | 36.133333 | 542 |
2,409 | py | PYTHON | 15.0 | # Copyright 2021 Camptocamp SA
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl)
from .common import TestCommon
class TestAsStr(TestCommon):
def test_as_str(self):
self.assertEqual(self.product_a.product_qty_by_packaging_as_str(10), "10 Units")
self.assertEqual(
self.prod... | 37.061538 | 2,409 |
1,327 | py | PYTHON | 15.0 | # Copyright 2020 Camptocamp SA
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl)
from odoo.tests import TransactionCase
class TestCommon(TransactionCase):
at_install = False
post_install = True
maxDiff = None
@classmethod
def setUpClass(cls):
super().setUpClass()
cl... | 31.595238 | 1,327 |
729 | py | PYTHON | 15.0 | # Copyright 2021 Camptocamp SA
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl)
def make_pkg_values(record, **kw):
"""Helper to generate test values for packaging."""
name = record.name
if record._name == "uom.uom":
is_unit = True
barcode = None
qty = record.factor
... | 28.038462 | 729 |
5,771 | py | PYTHON | 15.0 | # Copyright 2020 Camptocamp SA
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl)
from .common import TestCommon
from .utils import make_pkg_values
class TestCalc(TestCommon):
def test_contained_mapping(self):
self.assertEqual(
self.product_a.packaging_contained_mapping,
... | 35.623457 | 5,771 |
2,052 | py | PYTHON | 15.0 | # Copyright 2021 Camptocamp SA
# @author: Simone Orsi <simone.orsi@camptocamp.com>
# @author: Sébastien Alix <sebastien.alix@camptocamp.com>
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl)
from odoo import api, fields, models
class ProductQtyByPackagingMixin(models.AbstractModel):
"""Allow display... | 41.857143 | 2,051 |
7,864 | py | PYTHON | 15.0 | # Copyright 2020 Camptocamp SA
# @author: Simone Orsi <simone.orsi@camptocamp.com>
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl)
import unicodedata
from collections import namedtuple
from odoo import api, models
from odoo.tools import float_compare
from odoo.addons.base_sparse_field.models.fields i... | 36.920188 | 7,864 |
743 | py | PYTHON | 15.0 | # Copyright 2018 Tecnativa - Sergio Teruel
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Stock Secondary Unit",
"summary": "Get product quantities in a secondary unit",
"version": "15.0.1.0.0",
"development_status": "Production/Stable",
"category": "stock",
"website... | 35.380952 | 743 |
10,073 | 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 Form, TransactionCase, tagged
@tagged("-at_install", "post_install")
class TestProductSecondaryUnit(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass(... | 43.795652 | 10,073 |
2,437 | 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
from odoo.tools.float_utils import float_round
class StockMove(models.Model):
_inherit = ["stock.move", "product.secondary.unit.mixin"]
_name = "stock.move"
_sec... | 37.492308 | 2,437 |
1,689 | 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
from odoo.tools.float_utils import float_round
class StockProductSecondaryUnit(models.AbstractModel):
_name = "stock.product.secondary.unit"
_description = "Stock Pr... | 35.1875 | 1,689 |
799 | py | PYTHON | 15.0 | # Copyright 2019 ForgeFlow S.L. (https://www.forgeflow.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Stock Demand Estimate Matrix",
"summary": "Allows to create demand estimates.",
"version": "15.0.1.2.0",
"author": "ForgeFlow, Odoo Community Association (OCA)",
... | 39.95 | 799 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.