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 |
|---|---|---|---|---|---|---|
10,592 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _
from odoo.tools.float_utils import float_compare, float_is_zero
class AccountMove(models.Model):
_inherit = 'account.move'
def _stock_account_prepare_anglo_saxon_in_line... | 57.879781 | 10,592 |
350 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class ResCompany(models.Model):
_inherit = 'res.company'
days_to_purchase = fields.Float(
string='Days to Purchase',
help="Days needed to confirm a PO, define wh... | 29.166667 | 350 |
5,344 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
from odoo.osv import expression
class ProductTemplate(models.Model):
_name = 'product.template'
_inherit = 'product.template'
@api.model
def _get_buy_route(self):
... | 44.165289 | 5,344 |
18,364 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from collections import defaultdict
from datetime import datetime
from dateutil.relativedelta import relativedelta
from itertools import groupby
from odoo.tools import float_compare
from odoo import api, fields, models,... | 54.654762 | 18,364 |
725 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
module_stock_dropshipping = fields.Boolean("Dropshipping")
days_to_purchase = fields.Fl... | 34.52381 | 725 |
2,335 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import timedelta, datetime, time
from collections import defaultdict
from odoo import api, fields, models
class ResPartner(models.Model):
_inherit = 'res.partner'
purchase_line_ids = fields.One2... | 48.645833 | 2,335 |
3,467 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import re
from odoo import api, fields, models
from odoo.exceptions import UserError
from odoo.osv.expression import expression
class PurchaseReport(models.Model):
_inherit = "purchase.report"
picking_type_id... | 49.528571 | 3,467 |
594 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models
class ReportStockRule(models.AbstractModel):
_inherit = 'report.stock.report_stock_rule'
@api.model
def _get_rule_loc(self, rule, product_id):
""" We override this meth... | 34.941176 | 594 |
3,492 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, tools
from odoo.exceptions import UserError
from odoo.osv.expression import expression
class VendorDelayReport(models.Model):
_name = "vendor.delay.report"
_description = "... | 38.8 | 3,492 |
1,711 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class ReplenishmentReport(models.AbstractModel):
_inherit = 'report.stock.report_product_product_replenishment'
def _compute_draft_quantity_count(self, product_template_ids, product_var... | 51.848485 | 1,711 |
1,363 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Peru - Accounting',
"version": "2.0",
'summary': "PCGE Simplified",
'category': 'Accounting/Localizations/Account Charts',
'author': 'Vauxoo, Odoo',
'website': 'https://www.odoo.com/documentation/15.0/applicati... | 34.948718 | 1,363 |
1,350 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from odoo import api, models
class AccountChartTemplate(models.Model):
_inherit = "account.chart.template"
@api.model
def _get_demo_data_move(self):
cid = self.env.company.id
model, data = super()._get_demo_data_move()
if self.env.company.account_fiscal_co... | 54 | 1,350 |
309 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class City(models.Model):
_inherit = "res.city"
l10n_pe_code = fields.Char('Code', help='This code will help with the '
'identification of each city in Peru.')
| 34.333333 | 309 |
2,420 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class AccountTax(models.Model):
_inherit = "account.tax"
l10n_pe_edi_tax_code = fields.Selection([
('1000', 'IGV - General Sales Tax'),
('1016', 'IVAP - Tax on Sale Paddy Rice'),
... | 39.032258 | 2,420 |
245 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, fields
class L10nLatamIdentificationType(models.Model):
_inherit = "l10n_latam.identification.type"
l10n_pe_vat_code = fields.Char()
| 27.222222 | 245 |
902 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, fields
from odoo.tools.sql import column_exists, create_column
class AccountMoveLine(models.Model):
_inherit = "account.move.line"
l10n_pe_group_id = fields.Many2one("account.group", related="account_id.group_... | 39.217391 | 902 |
453 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class L10nPeResCityDistrict(models.Model):
_name = 'l10n_pe.res.city.district'
_description = 'District'
_order = 'name'
name = fields.Char(translate=True)
city_id = fields.Many2one('res.cit... | 32.357143 | 453 |
375 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class ResCompany(models.Model):
_inherit = 'res.company'
def _localization_use_documents(self):
# OVERRIDE
self.ensure_one()
return self.account_fiscal_country_id... | 31.25 | 375 |
723 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details
from odoo import fields, models, api
class ResPartner(models.Model):
_inherit = 'res.partner'
l10n_pe_district = fields.Many2one(
'l10n_pe.res.city.district', string='District',
help='Districts are part of a province or... | 36.15 | 723 |
329 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Mrp Repairs',
'version': '1.0',
'category': 'Inventory/Inventory',
'depends': ['repair', 'mrp'],
'installable': True,
'auto_install': True,
'application': False,
'license': 'LG... | 23.5 | 329 |
5,387 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests import Form, tagged
from odoo.addons.mrp.tests.common import TestMrpCommon
@tagged('post_install', '-at_install')
class TestRepairTraceability(TestMrpCommon):
def test_tracking_repair_production(sel... | 40.810606 | 5,387 |
2,583 | py | PYTHON | 15.0 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models
class Repair(models.Model):
_inherit = 'repair.order'
@api.model
def create(self, vals):
res = super().create(vals)
res.action_explode()
return res
def write(self, vals):
... | 39.136364 | 2,583 |
849 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Copyright (C) 2019 Bohdan Lisnenko <bohdan.lisnenko@erp.co.ua>, ERP Ukraine
{
'name': 'Ukraine - Accounting',
'author': 'ERP Ukraine',
'website': 'https://erp.co.ua',
'version': '1.4',
'description'... | 30.321429 | 849 |
1,193 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
"name": "Vietnam - Accounting",
"version": "2.0.1",
"author": "General Solutions",
'website': 'http://gscom.vn',
'category': 'Accounting/Localizations/Account Charts',
"description": """
This i... | 27.744186 | 1,193 |
760 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from odoo import api, SUPERUSER_ID
FIXED_ACCOUNTS_MAP = {
'5221': '5211',
'5222': '5212',
'5223': '5213'
}
def _fix_revenue_deduction_accounts_code(env):
vn_template = env.ref('l10n_vn.vn_template')
for company in env['res.company'].with_context(active_test=False).sear... | 34.545455 | 760 |
507 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'SMS on Events',
'version': '1.0',
'category': 'Marketing/Events',
'description': """Schedule SMS in event management""",
'depends': ['event', 'sms'],
'data': [
'data/sms_data.xm... | 25.35 | 507 |
4,544 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from dateutil.relativedelta import relativedelta
from odoo.addons.event.tests.common import TestEventCommon
from odoo.addons.phone_validation.tools import phone_validation
from odoo.addons.sms.tests.common import SMSCas... | 49.934066 | 4,544 |
4,115 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class EventTypeMail(models.Model):
_inherit = 'event.type.mail'
@api.model
def _selection_template_model(self):
return super(EventTypeMail, self)._selection_tem... | 43.776596 | 4,115 |
386 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class Registration(models.Model):
_inherit = 'event.registration'
def _sms_get_number_fields(self):
""" This method returns the fields to use to find the number to use to
... | 29.692308 | 386 |
999 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models
from odoo.osv import expression
class SmsTemplate(models.Model):
_inherit = 'sms.template'
@api.model
def _name_search(self, name, args=None, operator='ilike', limit=100, name_... | 45.409091 | 999 |
650 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
{
'name': "Sparse Fields",
'summary': """Implementation of sparse fields.""",
'description': """
The purpose of this module is to implement "sparse" fields, i.e., fields
that are mostly null. This implementation circumvents the PostgreSQL
limitation on the num... | 34.210526 | 650 |
1,371 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from odoo.tests import common
class TestSparseFields(common.TransactionCase):
def test_sparse(self):
""" test sparse fields. """
record = self.env['sparse_fields.test'].create({})
self.assertFalse(record.data)
partner = self.env.ref('base.main_partner')
... | 34.275 | 1,371 |
4,066 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from collections import defaultdict
from odoo import models, fields, api, _
from odoo.exceptions import UserError
class Base(models.AbstractModel):
_inherit = 'base'
def _valid_field_parameter(self, field, name):
return name == 'sparse' or super()._valid_field_parameter(fiel... | 41.070707 | 4,066 |
2,834 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
import json
from odoo import fields
def monkey_patch(cls):
""" Return a method decorator to monkey-patch the given class. """
def decorate(func):
name = func.__name__
func.super = getattr(cls, name, None)
setattr(cls, name, func)
return func
return... | 29.831579 | 2,834 |
3,795 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Time Off',
'version': '1.5',
'category': 'Human Resources/Time Off',
'sequence': 85,
'summary': 'Allocate PTOs and follow leaves requests',
'website': 'https://www.odoo.com/app/time-off... | 40.37234 | 3,795 |
45,682 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import datetime, date, timedelta
import time
from dateutil.relativedelta import relativedelta
from freezegun import freeze_time
from pytz import timezone, UTC
from odoo import fields
from odoo.exceptions i... | 48.388771 | 45,679 |
1,133 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.base.models.ir_model import MODULE_UNINSTALL_FLAG
from odoo.tests import tagged, TransactionCase
@tagged('-at_install', 'post_install')
class TestHrLeaveUninstall(TransactionCase):
def test_unlink_... | 40.464286 | 1,133 |
36,145 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import datetime
from dateutil.relativedelta import relativedelta
from odoo import tests
from odoo.addons.hr_holidays.tests.common import TestHrHolidaysCommon
from odoo.exceptions import AccessError, UserEr... | 42.623821 | 36,145 |
3,750 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import datetime
from dateutil.relativedelta import relativedelta
from odoo.addons.hr_holidays.tests.common import TestHrHolidaysCommon
class TestChangeDepartment(TestHrHolidaysCommon):
def test_emplo... | 56.818182 | 3,750 |
44,929 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import datetime
from freezegun import freeze_time
from dateutil.relativedelta import relativedelta
from odoo.tests import tagged
from odoo.addons.hr_holidays.tests.common import TestHrHolidaysCommon
@tagged('post_inst... | 48.103854 | 44,929 |
10,157 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import tests
from odoo.addons.hr_holidays.tests.common import TestHrHolidaysCommon
from odoo.exceptions import AccessError, UserError
import time
@tests.tagged('access_rights', 'post_install', '-at_install')
... | 42.145228 | 10,157 |
13,840 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import date, datetime
from odoo.tests import tagged
from odoo.tests.common import TransactionCase
@tagged('company_leave')
class TestCompanyLeave(TransactionCase):
""" Test leaves for a whole company... | 42.453988 | 13,840 |
2,252 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.mail.tests.common import mail_new_test_user
from odoo.tests import common
class TestHrHolidaysCommon(common.TransactionCase):
def setUp(self):
super(TestHrHolidaysCommon, self).setUp()
... | 39.508772 | 2,252 |
14,151 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import time
from datetime import datetime
from dateutil.relativedelta import relativedelta
from freezegun import freeze_time
from psycopg2 import IntegrityError
from odoo import fields
from odoo.exceptions import Access... | 49.135417 | 14,151 |
2,623 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import date
from dateutil.relativedelta import relativedelta
from odoo import Command
from odoo.tests.common import tagged, TransactionCase
from odoo.tools.misc import DEFAULT_SERVER_DATE_FORMAT
@tagged(... | 39.149254 | 2,623 |
4,607 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import datetime
from dateutil.relativedelta import relativedelta
from odoo.addons.base.tests.common import TransactionCaseWithUserDemo
from odoo.tests.common import tagged, users, warmup
from odoo.tools.mi... | 45.166667 | 4,607 |
1,375 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.base.tests.common import HttpCase
from odoo.tests.common import tagged
from odoo.tests.common import users
from odoo.addons.hr_holidays.tests.common import TestHrHolidaysCommon
@tagged('post_install',... | 45.833333 | 1,375 |
1,442 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import datetime
from dateutil.relativedelta import relativedelta
from odoo.exceptions import AccessError
from odoo.addons.hr_holidays.tests.common import TestHrHolidaysCommon
class TestHrLeaveType(TestH... | 34.333333 | 1,442 |
13,482 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from datetime import date, datetime
from odoo.tests.common import Form
from odoo.addons.hr_holidays.tests.common import TestHrHolidaysCommon
from odoo.exceptions import ValidationError
class TestAutomaticLeaveDates(TestHrHolidaysCommon):
def setUp(self):
super(TestAutomaticLeaveD... | 46.171233 | 13,482 |
1,221 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import datetime, timedelta
from odoo import api, fields, models
class HrDepartureWizard(models.TransientModel):
_inherit = 'hr.departure.wizard'
cancel_leaves = fields.Boolean("Cancel Future Lea... | 45.222222 | 1,221 |
1,177 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import time
from odoo import api, fields, models
class HolidaysSummaryEmployee(models.TransientModel):
_name = 'hr.holidays.summary.employee'
_description = 'HR Time Off Summary Report By Employee'
date_f... | 37.967742 | 1,177 |
80,552 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Copyright (c) 2005-2006 Axelor SARL. (http://www.axelor.com)
import logging
import pytz
from collections import namedtuple, defaultdict
from datetime import datetime, timedelta, time
from pytz import timezone, UTC
... | 56.172943 | 80,552 |
1,673 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
from odoo import api, models
_logger = logging.getLogger(__name__)
class MailMessageSubtype(models.Model):
_inherit = 'mail.message.subtype'
def _get_department_subtype(self):
return s... | 33.46 | 1,673 |
3,002 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _
class AccrualPlan(models.Model):
_name = "hr.leave.accrual.plan"
_description = "Accrual Plan"
name = fields.Char('Name', required=True)
time_off_type_id = field... | 47.650794 | 3,002 |
2,253 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import datetime
from dateutil.relativedelta import relativedelta
from odoo import api, fields, models
class Department(models.Model):
_inherit = 'hr.department'
absence_of_today = fields.Integer(
com... | 46.9375 | 2,253 |
282 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class CalendarLeaves(models.Model):
_inherit = "resource.calendar.leaves"
holiday_id = fields.Many2one("hr.leave", string='Leave Request')
| 28.2 | 282 |
13,726 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import datetime
import calendar
from dateutil.relativedelta import relativedelta
from odoo import _, api, fields, models
from odoo.tools.date_utils import get_timedelta
DAYS = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri... | 45.450331 | 13,726 |
12,928 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import datetime
from dateutil.relativedelta import relativedelta
from odoo import _, api, fields, models
from odoo.exceptions import UserError
from odoo.tools.float_utils import float_round
class HrEmployeeBase(models... | 52.340081 | 12,928 |
44,063 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Copyright (c) 2005-2006 Axelor SARL. (http://www.axelor.com)
from collections import defaultdict
import logging
from datetime import datetime, time, timedelta
from dateutil.relativedelta import relativedelta
from od... | 56.636247 | 44,063 |
3,375 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class User(models.Model):
_inherit = "res.users"
leave_manager_id = fields.Many2one(related='employee_id.leave_manager_id')
show_leaves = fields.Boolean(related='employ... | 45 | 3,375 |
1,459 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models
from odoo.tools.misc import DEFAULT_SERVER_DATE_FORMAT
class ResPartner(models.Model):
_inherit = 'res.partner'
def _compute_im_status(self):
super(ResPartner, self)._compu... | 39.432432 | 1,459 |
30,947 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Copyright (c) 2005-2006 Axelor SARL. (http://www.axelor.com)
import datetime
import logging
from collections import defaultdict
from datetime import time, timedelta
from odoo import api, fields, models
from odoo.osv... | 54.968028 | 30,947 |
3,348 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, tools, SUPERUSER_ID
from odoo.addons.base.models.res_partner import _tz_get
class LeaveReportCalendar(models.Model):
_name = "hr.leave.report.calendar"
_description = 'Tim... | 40.829268 | 3,348 |
4,855 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, tools, _
from odoo.osv import expression
class LeaveReport(models.Model):
_name = "hr.leave.report"
_description = 'Time Off Summary / Report'
_auto = False
_order ... | 45.373832 | 4,855 |
4,774 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, tools, _
class LeaveReport(models.Model):
_name = "hr.leave.employee.type.report"
_description = 'Time Off Summary / Report'
_auto = False
_order = "date_from DESC,... | 45.903846 | 4,774 |
5,715 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import calendar
from datetime import timedelta
from dateutil.relativedelta import relativedelta
from odoo import api, fields, models, _
from odoo.exceptions import UserError
class HrHolidaySummaryReport(models.Abstrac... | 46.08871 | 5,715 |
2,130 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.mail.controllers.mail import MailController
from odoo import http
class HrHolidaysController(http.Controller):
@http.route('/leave/validate', type='http', auth='user', methods=['GET'])
def hr_... | 44.375 | 2,130 |
817 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Skills e-learning',
'category': 'Hidden',
'version': '1.0',
'summary': 'Add completed courses to resumé of your employees',
'description':
"""
E-learning and Skills for HR
=========... | 26.290323 | 815 |
1,896 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
from odoo.tools import html2plaintext
class SlideChannelPartner(models.Model):
_inherit = 'slide.channel.partner'
def _recompute_completion(self):
res = super(SlideChann... | 42.133333 | 1,896 |
355 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class ResumeLine(models.Model):
_inherit = 'hr.resume.line'
display_type = fields.Selection(selection_add=[('course', 'Course')])
channel_id = fields.Many2one('slide.channel... | 32.272727 | 355 |
530 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Project Expenses',
'version': '1.0',
'category': 'Services/expenses',
'summary': 'Project expenses',
'description': 'Bridge created to add the number of expenses linked to an AA to a proje... | 27.894737 | 530 |
2,426 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _, _lt
class Project(models.Model):
_inherit = 'project.project'
expenses_count = fields.Integer('# Expenses', compute='_compute_expenses_count', groups='hr_expense.group_h... | 41.118644 | 2,426 |
12,371 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Point of Sale',
'version': '1.0.1',
'category': 'Sales/Point of Sale',
'sequence': 40,
'summary': 'User-friendly PoS interface for shops and restaurants',
'description': "",
'depend... | 55.977376 | 12,371 |
103 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{}
| 25.75 | 103 |
45,993 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import odoo
from odoo.addons.point_of_sale.tests.common import TestPoSCommon
@odoo.tests.tagged('post_install', '-at_install')
class TestPosSimpleInvoicedOrders(TestPoSCommon):
"""
Each test case only make a s... | 57.635338 | 45,993 |
30,383 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import tools
from odoo.api import Environment
from odoo.tools import DEFAULT_SERVER_DATE_FORMAT
from odoo.addons.account.tests.common import AccountTestInvoicingHttpCommon
from datetime import date, timedelta
... | 42.140083 | 30,383 |
1,354 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import odoo
from odoo.addons.point_of_sale.tests.common import TestPoSCommon
@odoo.tests.tagged('post_install', '-at_install')
class TestReportPoSOrder(TestPoSCommon):
def setUp(self):
super(TestReportPoSOr... | 33.02439 | 1,354 |
2,447 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests.common import TransactionCase
class TestPointOfSale(TransactionCase):
def setUp(self):
super(TestPointOfSale, self).setUp()
# ignore pre-existing pricelists for the purpose of this ... | 38.84127 | 2,447 |
16,746 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import odoo
import time
from odoo import fields
from odoo.tests import common
class TestAngloSaxonCommon(common.TransactionCase):
def setUp(self):
super(TestAngloSaxonCommon, self).setUp()
self.PosM... | 54.72549 | 16,746 |
515 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests import HttpCase, tagged
from odoo import tools
@tagged('post_install', '-at_install')
class TestUi(HttpCase):
# Avoid "A Chart of Accounts is not yet installed in your current company."
# Everything ... | 32.1875 | 515 |
882 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import odoo.addons.web.tests.test_js
import odoo.tests
@odoo.tests.tagged("post_install", "-at_install")
class WebSuite(odoo.tests.HttpCase):
def setUp(self):
super().setUp()
env = self.env(user=sel... | 35.28 | 882 |
47,378 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import odoo
from odoo import tools
from odoo.addons.point_of_sale.tests.common import TestPoSCommon
@odoo.tests.tagged('post_install', '-at_install')
class TestPoSBasicConfig(TestPoSCommon):
""" Test PoS with basi... | 54.835648 | 47,378 |
18,286 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import odoo
from odoo import tools
from odoo.addons.point_of_sale.tests.common import TestPoSCommon
@odoo.tests.tagged('post_install', '-at_install')
class TestPoSMultipleReceivableAccounts(TestPoSCommon):
""" Test... | 63.493056 | 18,286 |
3,540 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import tools
import odoo
from odoo.addons.point_of_sale.tests.common import TestPoSCommon
@odoo.tests.tagged('post_install', '-at_install')
class TestPoSSetup(TestPoSCommon):
""" This group of tests is for... | 46.578947 | 3,540 |
33,500 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from random import randint
from datetime import datetime
from odoo import fields, tools
from odoo.addons.stock_account.tests.test_anglo_saxon_valuation_reconciliation_common import ValuationReconciliationTestCommon
from odoo.tests.common import Form
from odoo.tests import tagged
import logging... | 45.890411 | 33,500 |
65,758 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import time
import odoo
from odoo import fields, tools
from odoo.tools import float_compare, mute_logger, test_reports
from odoo.tests.common import Form
from odoo.addons.point_of_sale.tests.common import TestPointOfSal... | 42.922977 | 65,758 |
19,545 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import odoo
from odoo import tools
from odoo.tests.common import Form
from odoo.addons.point_of_sale.tests.common import TestPoSCommon
@odoo.tests.tagged('post_install', '-at_install')
class TestPoSOtherCurrencyConfig(... | 61.462264 | 19,545 |
22,163 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import tools
import odoo
from odoo.addons.point_of_sale.tests.common import TestPoSCommon
@odoo.tests.tagged('post_install', '-at_install')
class TestPoSWithFiscalPosition(TestPoSCommon):
""" Tests to pos ... | 59.101333 | 22,163 |
32,572 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import odoo
from odoo.addons.point_of_sale.tests.common import TestPoSCommon
@odoo.tests.tagged('post_install', '-at_install')
class TestPosSimpleOrders(TestPoSCommon):
"""
Each test case only make a single or... | 55.300509 | 32,572 |
31,480 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import tools
import odoo
from odoo.addons.point_of_sale.tests.common import TestPoSCommon
@odoo.tests.tagged('post_install', '-at_install')
class TestPoSProductsWithTax(TestPoSCommon):
""" Test normal con... | 58.18854 | 31,480 |
15,246 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
import odoo
from odoo.addons.point_of_sale.tests.common import TestPoSCommon
@odoo.tests.tagged('post_install', '-at_install')
class TestPosMargin(TestPoSCommon):
"""
Test the margin computation on orders with basic configuration
The tests contain the base scenarios.
"""
... | 38.115 | 15,246 |
13,937 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import tools
import odoo
from odoo.addons.point_of_sale.tests.common import TestPoSCommon
@odoo.tests.tagged('post_install', '-at_install')
class TestPoSStock(TestPoSCommon):
""" Tests for anglo saxon acco... | 52.791667 | 13,937 |
1,861 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models, _
from odoo.exceptions import UserError
class PosOpenStatement(models.TransientModel):
_name = 'pos.open.statement'
_description = 'Point of Sale Open Statement'
def open_stat... | 48.973684 | 1,861 |
1,310 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, _
from odoo.exceptions import UserError
from odoo.addons.account.wizard.pos_box import CashBox
class PosBox(CashBox):
_register = False
def run(self):
active_model = self.env.con... | 37.428571 | 1,310 |
1,969 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _
from odoo.exceptions import UserError
class PosDetails(models.TransientModel):
_name = 'pos.details.wizard'
_description = 'Point of Sale Details Report'
def _defaul... | 41.893617 | 1,969 |
2,926 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _
from odoo.tools import float_is_zero
class PosMakePayment(models.TransientModel):
_name = 'pos.make.payment'
_description = 'Point of Sale Make Payment Wizard'
def _... | 39.013333 | 2,926 |
755 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class PosCloseSessionWizard(models.TransientModel):
_name = "pos.close.session.wizard"
_description = "Close Session Wizard"
amount_to_balance = fields.Float("Amount to bala... | 37.75 | 755 |
1,272 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models, _
from odoo.exceptions import AccessError
class Digest(models.Model):
_inherit = 'digest.digest'
kpi_pos_total = fields.Boolean('POS Sales')
kpi_pos_total_value = fields.Mo... | 43.862069 | 1,272 |
1,612 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
from odoo import _, api, models
from odoo.exceptions import UserError
from odoo.tools import split_every
class AccountTax(models.Model):
_inherit = 'account.tax'
def write(self, vals):
forbidden_fields = {
'amount_type', 'amount', 'type_tax_use', 'tax_group_id', '... | 43.567568 | 1,612 |
2,925 | py | PYTHON | 15.0 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models, api
class AccountMove(models.Model):
_inherit = 'account.move'
pos_order_ids = fields.One2many('pos.order', 'account_move')
pos_payment_ids = fields.One2many('pos.payment',... | 45 | 2,925 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.