Files
Yamen Ahmad 3e83d8d7d5 feat: add complete EnCoach backend — Odoo 19 + all addons
Includes:
- Odoo 19 framework (odoo/)
- 27 custom EnCoach addons (new_project/custom_addons/)
  - encoach_core, encoach_api, encoach_lms_api, encoach_adaptive_api
  - encoach_exam, encoach_taxonomy, encoach_adaptive, encoach_assignment
  - encoach_ai, encoach_ai_grading, encoach_ai_generation, encoach_ai_media
  - encoach_courseware, encoach_communication, encoach_subscription
  - encoach_notification, encoach_approval, encoach_branding
  - encoach_classroom, encoach_registration, encoach_stats
  - encoach_faq, encoach_ticket, encoach_training, encoach_resources
  - encoach_adaptive_ai, encoach_sis
- 21 OpenEduCat Enterprise modules (new_project/enterprise-19/)
- 14 OpenEduCat Community modules (new_project/openeducat_erp-19.0/)
- Configuration: odoo.conf, requirements.txt, scripts
- 200+ REST API endpoints with JWT authentication
- SRS and test documentation

Made-with: Cursor
2026-04-01 17:10:04 +04:00

76 lines
2.9 KiB
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from freezegun import freeze_time
from odoo.addons.stock.tests.common import TestStockCommon
from odoo.tests import Form
from odoo import Command, fields
class TestStockReplenish(TestStockCommon):
def test_base_delay(self):
"""Open the replenish view and check if delay is taken into account
in the base date computation
"""
push_location = self.env['stock.location'].create({
'location_id': self.stock_location.location_id.id,
'name': 'push location',
})
route_no_delay = self.env['stock.route'].create({
'name': 'new route',
'rule_ids': [Command.create({
'name': 'create a move to push location',
'location_src_id': self.stock_location.id,
'location_dest_id': push_location.id,
'company_id': self.env.company.id,
'action': 'push',
'auto': 'manual',
'picking_type_id': self.picking_type_in.id,
'delay': 0,
})],
})
route_delay = self.env['stock.route'].create({
'name': 'new route',
'rule_ids': [Command.create({
'name': 'create a move to push location',
'location_src_id': self.stock_location.id,
'location_dest_id': push_location.id,
'company_id': self.env.company.id,
'action': 'push',
'auto': 'manual',
'picking_type_id': self.picking_type_in.id,
'delay': 2,
}),
(0, False, {
'name': 'create a move to push location',
'location_src_id': push_location.id,
'location_dest_id': self.stock_location.id,
'company_id': self.env.company.id,
'action': 'push',
'auto': 'manual',
'picking_type_id': self.picking_type_in.id,
'delay': 4,
})],
})
with freeze_time("2023-01-01"):
wizard = Form(self.env['product.replenish'])
wizard.route_id = route_no_delay
self.assertEqual(fields.Datetime.from_string('2023-01-01 00:00:00'), wizard._values['date_planned'])
wizard.route_id = route_delay
self.assertEqual(fields.Datetime.from_string('2023-01-07 00:00:00'), wizard._values['date_planned'])
def test_replenish_no_routes(self):
product = self.env['product.template'].create({
'name': 'Brand new product',
'is_storable': True,
})
self.assertEqual(len(product.route_ids), 0)
wizard = Form(self.env['product.replenish'].with_context(default_product_tmpl_id=product.id))
self.assertEqual(wizard._values['quantity'], 1)