Initial commit: Test packages

This commit is contained in:
Ernad Husremovic 2025-08-29 15:20:52 +02:00
commit 080accd21c
338 changed files with 32413 additions and 0 deletions

View file

@ -0,0 +1,52 @@
# Website Modules Test
This module contains tests related to website modules.
It allows to test website business code when another website module is
installed.
## Installation
```bash
pip install odoo-bringout-oca-ocb-test_website_modules
```
## Dependencies
This addon depends on:
- theme_default
- website
- website_blog
- website_event_sale
- website_slides
## Manifest Information
- **Name**: Website Modules Test
- **Version**: 1.0
- **Category**: Hidden
- **License**: LGPL-3
- **Installable**: True
## Source
Based on [OCA/OCB](https://github.com/OCA/OCB) branch 16.0, addon `test_website_modules`.
## License
This package maintains the original LGPL-3 license from the upstream Odoo project.
## Documentation
- Overview: doc/OVERVIEW.md
- Architecture: doc/ARCHITECTURE.md
- Models: doc/MODELS.md
- Controllers: doc/CONTROLLERS.md
- Wizards: doc/WIZARDS.md
- Reports: doc/REPORTS.md
- Security: doc/SECURITY.md
- Install: doc/INSTALL.md
- Usage: doc/USAGE.md
- Configuration: doc/CONFIGURATION.md
- Dependencies: doc/DEPENDENCIES.md
- Troubleshooting: doc/TROUBLESHOOTING.md
- FAQ: doc/FAQ.md

View file

@ -0,0 +1,32 @@
# Architecture
```mermaid
flowchart TD
U[Users] -->|HTTP| V[Views and QWeb Templates]
V --> C[Controllers]
V --> W[Wizards Transient Models]
C --> M[Models and ORM]
W --> M
M --> R[Reports]
DX[Data XML] --> M
S[Security ACLs and Groups] -. enforces .-> M
subgraph Test_website_modules Module - test_website_modules
direction LR
M:::layer
W:::layer
C:::layer
V:::layer
R:::layer
S:::layer
DX:::layer
end
classDef layer fill:#eef8ff,stroke:#6ea8fe,stroke-width:1px
```
Notes
- Views include tree/form/kanban templates and report templates.
- Controllers provide website/portal routes when present.
- Wizards are UI flows implemented with `models.TransientModel`.
- Data XML loads data/demo records; Security defines groups and access.

View file

@ -0,0 +1,3 @@
# Configuration
Refer to Odoo settings for test_website_modules. Configure related models, access rights, and options as needed.

View file

@ -0,0 +1,3 @@
# Controllers
This module does not define custom HTTP controllers.

View file

@ -0,0 +1,9 @@
# Dependencies
This addon depends on:
- [theme_default](../../odoo-bringout-oca-ocb-theme_default)
- [website](../../odoo-bringout-oca-ocb-website)
- [website_blog](../../odoo-bringout-oca-ocb-website_blog)
- [website_event_sale](../../odoo-bringout-oca-ocb-website_event_sale)
- [website_slides](../../odoo-bringout-oca-ocb-website_slides)

View file

@ -0,0 +1,4 @@
# FAQ
- Q: Which Odoo version? A: 16.0 (OCA/OCB packaged).
- Q: How to enable? A: Start server with --addon test_website_modules or install in UI.

View file

@ -0,0 +1,7 @@
# Install
```bash
pip install odoo-bringout-oca-ocb-test_website_modules"
# or
uv pip install odoo-bringout-oca-ocb-test_website_modules"
```

View file

@ -0,0 +1,11 @@
# Models
Detected core models and extensions in test_website_modules.
```mermaid
classDiagram
```
Notes
- Classes show model technical names; fields omitted for brevity.
- Items listed under _inherit are extensions of existing models.

View file

@ -0,0 +1,6 @@
# Overview
Packaged Odoo addon: test_website_modules. Provides features documented in upstream Odoo 16 under this addon.
- Source: OCA/OCB 16.0, addon test_website_modules
- License: LGPL-3

View file

@ -0,0 +1,3 @@
# Reports
This module does not define custom reports.

View file

@ -0,0 +1,8 @@
# Security
This module does not define custom security rules or access controls beyond Odoo defaults.
Default Odoo security applies:
- Base user access through standard groups
- Model access inherited from dependencies
- No custom row-level security rules

View file

@ -0,0 +1,5 @@
# Troubleshooting
- Ensure Python and Odoo environment matches repo guidance.
- Check database connectivity and logs if startup fails.
- Validate that dependent addons listed in DEPENDENCIES.md are installed.

View file

@ -0,0 +1,7 @@
# Usage
Start Odoo including this addon (from repo root):
```bash
python3 scripts/nix_odoo_web_server.py --db-name mydb --addon test_website_modules
```

View file

@ -0,0 +1,3 @@
# Wizards
This module does not include UI wizards.

View file

@ -0,0 +1,46 @@
[project]
name = "odoo-bringout-oca-ocb-test_website_modules"
version = "16.0.0"
description = "Website Modules Test - Odoo addon"
authors = [
{ name = "Ernad Husremovic", email = "hernad@bring.out.ba" }
]
dependencies = [
"odoo-bringout-oca-ocb-theme_default>=16.0.0",
"odoo-bringout-oca-ocb-website>=16.0.0",
"odoo-bringout-oca-ocb-website_blog>=16.0.0",
"odoo-bringout-oca-ocb-website_event_sale>=16.0.0",
"odoo-bringout-oca-ocb-website_slides>=16.0.0",
"requests>=2.25.1"
]
readme = "README.md"
requires-python = ">= 3.11"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Office/Business",
]
[project.urls]
homepage = "https://github.com/bringout/0"
repository = "https://github.com/bringout/0"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.build.targets.wheel]
packages = ["test_website_modules"]
[tool.rye]
managed = true
dev-dependencies = [
"pytest>=8.4.1",
]

View file

@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.

View file

@ -0,0 +1,26 @@
# -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Website Modules Test',
'version': '1.0',
'category': 'Hidden',
'sequence': 9876,
'description': """This module contains tests related to website modules.
It allows to test website business code when another website module is
installed.""",
'depends': [
'theme_default',
'website',
'website_blog',
'website_event_sale',
'website_slides',
],
'installable': True,
'assets': {
'web.assets_tests': [
'test_website_modules/static/tests/**/*',
],
},
'license': 'LGPL-3',
}

View file

@ -0,0 +1,106 @@
odoo.define('test_website_modules.tour.configurator_flow', function (require) {
'use strict';
const tour = require('web_tour.tour');
const wTourUtils = require('website.tour_utils');
tour.register('configurator_flow', {
test: true,
url: '/web#action=website.action_website_configuration',
},
[
{
content: "click on create new website",
trigger: 'button[name="action_website_create_new"]',
}, {
content: "insert website name",
trigger: '[name="name"] input',
run: 'text Website Test',
}, {
content: "validate the website creation modal",
trigger: 'button.btn-primary',
},
// Configurator first screen
{
content: "click next",
trigger: 'button.o_configurator_show',
timeout: 20000, /* previous step create a new website, this could take a long time */
},
// Description screen
{
content: "select a website type",
trigger: 'a.o_change_website_type',
}, {
content: "insert a website industry",
trigger: '.o_configurator_industry input',
run: 'text ab',
}, {
content: "select a website industry from the autocomplete",
trigger: '.o_configurator_industry ul li a',
}, {
content: "select an objective",
trigger: '.o_configurator_purpose_dd a',
}, {
content: "choose from the objective list",
trigger: 'a.o_change_website_purpose',
},
// Palette screen
{
content: "chose a palette card",
trigger: '.palette_card',
},
// Features screen
{
content: "select Pricing",
trigger: '.card:contains("Pricing")',
}, {
content: "Events should be selected (module already installed)",
extra_trigger: '.card.border-success:contains("Pricing")',
trigger: '.card.card_installed:contains("Events")',
run: function () {}, // it's a check
}, {
content: "Slides should be selected (module already installed)",
trigger: '.card.card_installed:contains("eLearning")',
run: function () {}, // it's a check
}, {
content: "Success Stories (Blog) and News (Blog) should be selected (module already installed)",
extra_trigger: '.card.card_installed:contains("Success Stories")',
trigger: '.card.card_installed:contains("News")',
run: function () {}, // it's a check
}, {
content: "Click on build my website",
trigger: 'button.btn-primary',
}, {
content: "Loader should be shown",
trigger: '.o_website_loader_container',
run: function () {}, // it's a check
}, {
content: "Wait untill the configurator is finished",
trigger: '#oe_snippets.o_loaded',
timeout: 30000,
},
...wTourUtils.clickOnSave(),
{
content: "check menu and footer links are correct",
trigger: 'body:not(.editor_enable)', // edit mode left
run: function () {
const $iframe = this.$anchor.find('iframe.o_iframe:not(.o_ignore_in_tour)');
for (const menu of ['Home', 'Events', 'Courses', 'Pricing', 'News', 'Success Stories', 'Contact us']) {
if (!$iframe.contents().find(`#top_menu a:contains(${menu})`).length) {
console.error(`Missing ${menu} menu. It should have been created by the configurator.`);
}
}
for (const url of ['/', '/event', '/slides', '/pricing', '/blog/', '/blog/', '/contactus']) {
if (!$iframe.contents().find(`#top_menu a[href^='${url}']`).length) {
console.error(`Missing ${url} menu URL. It should have been created by the configurator.`);
}
}
for (const link of ['Privacy Policy', 'Contact us']) {
if (!$iframe.contents().find(`#footer ul a:contains(${link})`).length) {
console.error(`Missing ${link} footer link. It should have been created by the configurator.`);
}
}
},
},
]);
});

View file

@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import test_configurator

View file

@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import odoo.tests
from odoo.addons.website.tests.test_configurator import TestConfiguratorCommon
@odoo.tests.common.tagged('post_install', '-at_install')
class TestConfigurator(TestConfiguratorCommon):
def test_01_configurator_flow(self):
# If not enabled (like in demo data), landing on res.config will try
# to disable module_sale_quotation_builder and raise an issue
group_order_template = self.env.ref('sale_management.group_sale_order_template', raise_if_not_found=False)
if group_order_template:
self.env.ref('base.group_user').write({"implied_ids": [(4, group_order_template.id)]})
self.start_tour('/web#action=website.action_website_configuration', 'configurator_flow', login="admin")