Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
86d3e4dfcc | ||
|
|
b9ddad46ab | ||
|
|
d24606a757 |
Generated
-3
@@ -1,3 +0,0 @@
|
|||||||
# Default ignored files
|
|
||||||
/shelf/
|
|
||||||
/workspace.xml
|
|
||||||
-16
@@ -1,16 +0,0 @@
|
|||||||
<component name="InspectionProjectProfileManager">
|
|
||||||
<profile version="1.0">
|
|
||||||
<option name="myName" value="Project Default" />
|
|
||||||
<inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
|
|
||||||
<option name="ignoredPackages">
|
|
||||||
<value>
|
|
||||||
<list size="3">
|
|
||||||
<item index="0" class="java.lang.String" itemvalue="email_validator" />
|
|
||||||
<item index="1" class="java.lang.String" itemvalue="freezegun" />
|
|
||||||
<item index="2" class="java.lang.String" itemvalue="python-dateutil" />
|
|
||||||
</list>
|
|
||||||
</value>
|
|
||||||
</option>
|
|
||||||
</inspection_tool>
|
|
||||||
</profile>
|
|
||||||
</component>
|
|
||||||
-6
@@ -1,6 +0,0 @@
|
|||||||
<component name="InspectionProjectProfileManager">
|
|
||||||
<settings>
|
|
||||||
<option name="USE_PROJECT_PROFILE" value="false" />
|
|
||||||
<version value="1.0" />
|
|
||||||
</settings>
|
|
||||||
</component>
|
|
||||||
Generated
-7
@@ -1,7 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="Black">
|
|
||||||
<option name="sdkName" value="Python 3.10" />
|
|
||||||
</component>
|
|
||||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.10" project-jdk-type="Python SDK" />
|
|
||||||
</project>
|
|
||||||
Generated
-8
@@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectModuleManager">
|
|
||||||
<modules>
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/testserver.iml" filepath="$PROJECT_DIR$/.idea/testserver.iml" />
|
|
||||||
</modules>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
Generated
-8
@@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module type="PYTHON_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager">
|
|
||||||
<content url="file://$MODULE_DIR$" />
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
||||||
Generated
-6
@@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="VcsDirectoryMappings">
|
|
||||||
<mapping directory="" vcs="Git" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
Executable → Regular
@@ -3,4 +3,4 @@
|
|||||||
from . import controllers
|
from . import controllers
|
||||||
from . import models
|
from . import models
|
||||||
from . import wizard
|
from . import wizard
|
||||||
from .hooks import post_init_hook
|
from .hooks import post_init_hook
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
'website': "http://www.open2bizz.tech",
|
'website': "http://www.open2bizz.tech",
|
||||||
'category': 'Tools',
|
'category': 'Tools',
|
||||||
'license': "AGPL-3",
|
'license': "AGPL-3",
|
||||||
'version': '16.0.1.0.0',
|
'version': '15.0.1.0.0',
|
||||||
'module_type': 'official',
|
'module_type': 'official',
|
||||||
'depends': ['mail','base',],
|
'depends': ['mail','base',],
|
||||||
'data': [
|
'data': [
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from . import controllers
|
from . import controllers
|
||||||
@@ -37,4 +37,4 @@ def post_init_hook(cr, registry):
|
|||||||
except subprocess.TimeoutExpired:
|
except subprocess.TimeoutExpired:
|
||||||
_logger.error("MailHog install script timed out after 300 seconds")
|
_logger.error("MailHog install script timed out after 300 seconds")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
_logger.error("Failed to run MailHog install script: %s", e)
|
_logger.error("Failed to run MailHog install script: %s", e)
|
||||||
@@ -3,3 +3,5 @@
|
|||||||
|
|
||||||
# MailHog is now accessed via the internal proxy controller at /mailcatcher/
|
# MailHog is now accessed via the internal proxy controller at /mailcatcher/
|
||||||
# so no dynamic URL computation is needed anymore.
|
# so no dynamic URL computation is needed anymore.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||||
"access_mailcatcher_install_warning_wizard","mailcatcher.install.warning.wizard","model_mailcatcher_install_warning_wizard","base.group_user",1,1,1,1
|
"access_mailcatcher_install_warning_wizard","mailcatcher.install.warning.wizard","model_mailcatcher_install_warning_wizard","base.group_user",1,1,1,1
|
||||||
|
|||||||
|
@@ -1,20 +1,18 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="document" id="module-name">
|
<div class="document" id="module-name">
|
||||||
<h1 class="title">mailcatcher_menu</h1>
|
<h1 class="title">mailcatcher_menu</h1>
|
||||||
<p>
|
<p>
|
||||||
This module is ONLY for test environments In DC Open2Bizz
|
This module is ONLY for test environments In DC Open2Bizz
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Module is developed by Open2Bizz. Bug reports: support@open2bizz.eu
|
Module is developed by Open2Bizz. Bug reports: support@open2bizz.eu
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<img src="https://www.open2bizz.tech/logo.png" style="max-height: 100px;">
|
<img src="https://www.open2bizz.tech/logo.png" style="max-height: 100px;">
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
</html>
|
||||||
</html>
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
'website': "http://www.open2bizz.tech",
|
'website': "http://www.open2bizz.tech",
|
||||||
'category': 'Tools',
|
'category': 'Tools',
|
||||||
'license': "AGPL-3",
|
'license': "AGPL-3",
|
||||||
'version': '16.0.1.0.0',
|
'version': '15.0.1.0.0',
|
||||||
'depends': ['mail', 'base', 'mailcatcher_menu'],
|
'depends': ['mail', 'base', 'mailcatcher_menu'],
|
||||||
'data': [
|
'data': [
|
||||||
'views/templates.xml',
|
'views/templates.xml',
|
||||||
@@ -18,5 +18,3 @@
|
|||||||
],
|
],
|
||||||
'post_init_hook': 'post_init_hook',
|
'post_init_hook': 'post_init_hook',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
'website': "http://www.open2bizz.tech",
|
'website': "http://www.open2bizz.tech",
|
||||||
'category': 'Tools',
|
'category': 'Tools',
|
||||||
'license': "AGPL-3",
|
'license': "AGPL-3",
|
||||||
'version': '16.0.1.0.0',
|
'version': '15.0.1.0.0',
|
||||||
'depends': ['testserver_o2b','website'],
|
'depends': ['testserver_o2b','website'],
|
||||||
'data': [
|
'data': [
|
||||||
'views/templates.xml',
|
'views/templates.xml',
|
||||||
|
|||||||
+115
-42
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from odoo import api, fields, models, SUPERUSER_ID
|
from odoo import api, SUPERUSER_ID
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -10,55 +10,128 @@ _logger = logging.getLogger(__name__)
|
|||||||
def post_init_hook(cr, registry):
|
def post_init_hook(cr, registry):
|
||||||
env = api.Environment(cr, SUPERUSER_ID, {})
|
env = api.Environment(cr, SUPERUSER_ID, {})
|
||||||
|
|
||||||
model_website_page = env['ir.model'].search([
|
Website = env['website'].sudo()
|
||||||
('model', '=', 'website.page')
|
WebsitePage = env['website.page'].sudo()
|
||||||
])
|
|
||||||
|
|
||||||
test_view = env['ir.model.data']._xmlid_to_res_id(
|
# ---------------------------------------------------------
|
||||||
'testserver_website_o2b.testserver_page_website'
|
# 1. Get the generic TEST page template
|
||||||
|
# ---------------------------------------------------------
|
||||||
|
test_view = env.ref(
|
||||||
|
'testserver_website_o2b.testserver_page_website',
|
||||||
|
raise_if_not_found=False,
|
||||||
)
|
)
|
||||||
|
|
||||||
if model_website_page:
|
if not test_view:
|
||||||
for page in env['website.page'].search([]):
|
_logger.error(
|
||||||
_logger.error("________Disable page %s", page.id)
|
"Testserver website template "
|
||||||
page.write({
|
"'testserver_website_o2b.testserver_page_website' not found."
|
||||||
'is_published': False,
|
)
|
||||||
})
|
return
|
||||||
|
|
||||||
new_page = env['website.page'].create({
|
# ---------------------------------------------------------
|
||||||
'name': "Testbeeld",
|
# 2. Unpublish all existing website pages
|
||||||
'url': "/testmodus",
|
# ---------------------------------------------------------
|
||||||
'view_id': test_view,
|
pages = WebsitePage.search([])
|
||||||
'is_published': True,
|
|
||||||
|
if pages:
|
||||||
|
_logger.info(
|
||||||
|
"Unpublishing %s existing website pages.",
|
||||||
|
len(pages),
|
||||||
|
)
|
||||||
|
|
||||||
|
pages.write({
|
||||||
|
'website_published': False,
|
||||||
})
|
})
|
||||||
|
|
||||||
for website in env['website'].search([]):
|
# ---------------------------------------------------------
|
||||||
website.write({
|
# 3. Create a TEST homepage for every website
|
||||||
'domain': False,
|
# ---------------------------------------------------------
|
||||||
'homepage_url': new_page.url,
|
websites = Website.search([])
|
||||||
})
|
|
||||||
|
|
||||||
module_ecommerce = env['ir.module.module'].search([
|
for website in websites:
|
||||||
('name', '=', 'website_sale')
|
_logger.info(
|
||||||
])
|
"Creating test homepage for website %s (%s).",
|
||||||
|
website.name,
|
||||||
|
website.id,
|
||||||
|
)
|
||||||
|
|
||||||
if module_ecommerce and module_ecommerce.state == 'installed':
|
# Each website gets its own ir.ui.view.
|
||||||
# Disable payment options
|
#
|
||||||
for payment_method in env['payment.method'].search([]):
|
# In Odoo 15 website.page.website_id is related to
|
||||||
payment_method.write({
|
# view_id.website_id. Therefore we should not use the same
|
||||||
'active': False,
|
# ir.ui.view for multiple websites.
|
||||||
})
|
website_test_view = test_view.copy({
|
||||||
_logger.error(
|
'name': 'Test environment - %s' % website.name,
|
||||||
"________Disable payment method %s",
|
'key': '%s.website_%s' % (test_view.key, website.id),
|
||||||
payment_method.id,
|
'website_id': website.id,
|
||||||
|
})
|
||||||
|
|
||||||
|
test_page = WebsitePage.create({
|
||||||
|
'url': '/testmodus',
|
||||||
|
'view_id': website_test_view.id,
|
||||||
|
'website_published': True,
|
||||||
|
'website_indexed': False,
|
||||||
|
})
|
||||||
|
|
||||||
|
# Odoo 15 uses homepage_id, NOT homepage_url.
|
||||||
|
website.write({
|
||||||
|
'domain': False,
|
||||||
|
'homepage_id': test_page.id,
|
||||||
|
})
|
||||||
|
|
||||||
|
_logger.info(
|
||||||
|
"Test homepage %s assigned to website %s.",
|
||||||
|
test_page.id,
|
||||||
|
website.id,
|
||||||
|
)
|
||||||
|
|
||||||
|
# ---------------------------------------------------------
|
||||||
|
# 4. Disable all payment acquirers
|
||||||
|
# ---------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Odoo 15 uses payment.acquirer.
|
||||||
|
# payment.provider belongs to later Odoo versions.
|
||||||
|
#
|
||||||
|
if env.registry.get('payment.acquirer'):
|
||||||
|
payment_acquirers = env['payment.acquirer'].sudo().search([
|
||||||
|
('state', '!=', 'disabled'),
|
||||||
|
])
|
||||||
|
|
||||||
|
if payment_acquirers:
|
||||||
|
_logger.info(
|
||||||
|
"Disabling %s payment acquirers.",
|
||||||
|
len(payment_acquirers),
|
||||||
)
|
)
|
||||||
|
|
||||||
# Disable products
|
payment_acquirers.write({
|
||||||
for product in env['product.template'].search([]):
|
'state': 'disabled',
|
||||||
product.write({
|
|
||||||
'website_published': False,
|
|
||||||
})
|
})
|
||||||
_logger.error(
|
|
||||||
"________Disable product %s",
|
# ---------------------------------------------------------
|
||||||
product.id,
|
# 5. Unpublish all webshop products
|
||||||
)
|
# ---------------------------------------------------------
|
||||||
|
#
|
||||||
|
# website_published only exists on product.template when the
|
||||||
|
# relevant website/eCommerce functionality is installed.
|
||||||
|
#
|
||||||
|
if env.registry.get('product.template'):
|
||||||
|
ProductTemplate = env['product.template'].sudo()
|
||||||
|
|
||||||
|
if 'website_published' in ProductTemplate._fields:
|
||||||
|
published_products = ProductTemplate.search([
|
||||||
|
('website_published', '=', True),
|
||||||
|
])
|
||||||
|
|
||||||
|
if published_products:
|
||||||
|
_logger.info(
|
||||||
|
"Unpublishing %s webshop products.",
|
||||||
|
len(published_products),
|
||||||
|
)
|
||||||
|
|
||||||
|
published_products.write({
|
||||||
|
'website_published': False,
|
||||||
|
})
|
||||||
|
|
||||||
|
_logger.info(
|
||||||
|
"Testserver website neutralization completed successfully."
|
||||||
|
)
|
||||||
@@ -1,48 +1,75 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<data>
|
<data>
|
||||||
<!-- Banner for web layout (website Odoo) -->
|
|
||||||
|
<!-- Banner for web layout -->
|
||||||
<template id="testserver_banner_website" name="TOP banner test front" inherit_id="website.layout">
|
<template id="testserver_banner_website" name="TOP banner test front" inherit_id="website.layout">
|
||||||
<xpath expr="//body" position="before">
|
<xpath expr="//body" position="before">
|
||||||
<div>
|
<div>
|
||||||
<span style="text-align: center;color: #FFFFFF;background-color: #006CFE;position: relative;display: block;font-size: 16px;">
|
<span style="text-align: center;
|
||||||
|
color: #FFFFFF;
|
||||||
|
background-color: #006CFE;
|
||||||
|
position: relative;
|
||||||
|
display: block;
|
||||||
|
font-size: 16px;">
|
||||||
***** This is a test environment *****
|
***** This is a test environment *****
|
||||||
<a href="https://www.open2bizz.tech/helpdesk" target="_blank" style="color: #000000;">
|
<a href="https://www.open2bizz.tech/helpdesk" target="_blank" style="color: #000000;">
|
||||||
See website to report issue's.
|
See website to report issue's.
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</xpath>
|
</xpath>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<!-- Replacement layout (website Odoo) -->
|
|
||||||
|
<!-- Test environment page -->
|
||||||
<template id="testserver_page_website" name="Website page front">
|
<template id="testserver_page_website" name="Website page front">
|
||||||
<t t-name="website.test-env">
|
|
||||||
<t t-call="website.layout">
|
<t t-call="website.layout">
|
||||||
<div id="wrap" class="oe_structure oe_empty">
|
<div id="wrap" class="oe_structure oe_empty">
|
||||||
<section class="s_banner parallax s_parallax_is_fixed pb96 o_colored_level pt40"
|
|
||||||
data-scroll-background-ratio="1"
|
<section class="s_banner parallax s_parallax_is_fixed pb96 o_colored_level pt40" data-scroll-background-ratio="1" data-snippet="s_banner" data-name="Banner" style="background-image: none;">
|
||||||
data-snippet="s_banner" data-name="Banner" style="background-image: none;">
|
|
||||||
<span class="s_parallax_bg oe_img_bg o_bg_img_center"
|
<span class="s_parallax_bg oe_img_bg o_bg_img_center" style="background-image: url('https://hd-beamers.nl/wp-content/uploads/2014/05/Testbeeld-1280x720p_hd-ready.png'); background-position: 50% 0px;"/>
|
||||||
style="background-image: url("https://hd-beamers.nl/wp-content/uploads/2014/05/Testbeeld-1280x720p_hd-ready.png"); background-position: 50% 0px;"/>
|
|
||||||
<div class="o_we_bg_filter" style="background-image: linear-gradient(135deg, rgba(21, 25, 116, 0.71) 0%, rgba(226, 51, 255, 0.5) 100%);"/>
|
<div class="o_we_bg_filter" style="background-image: linear-gradient(135deg, rgba(21, 25, 116, 0.71) 0%, rgba(226, 51, 255, 0.5) 100%);"/>
|
||||||
<div class="container">
|
|
||||||
<div class="row s_nb_column_fixed">
|
<div class="container">
|
||||||
<div class="col-lg-6 jumbotron rounded o_cc o_cc1 pt32 pb32 o_colored_level" data-name="Box">
|
<div class="row s_nb_column_fixed">
|
||||||
<h1><font style="font-size: 62px;" class="o_default_snippet_text">TEST</font><br/></h1>
|
<div class="col-lg-6 jumbotron rounded o_cc o_cc1 pt32 pb32 o_colored_level" data-name="Box">
|
||||||
<p class="lead o_default_snippet_text">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
|
||||||
<a class="mb-2 btn btn-primary" href="/web/login" data-bs-original-title="" title="">Login</a>
|
<h1>
|
||||||
|
<font style="font-size: 62px;" class="o_default_snippet_text">
|
||||||
|
TEST
|
||||||
|
</font>
|
||||||
<br/>
|
<br/>
|
||||||
<br/>
|
</h1>
|
||||||
<a class="mb-2 btn btn-secondary" href="https://www.open2bizz.nl" data-bs-original-title="" title="">Open2Bizz</a>
|
|
||||||
</div>
|
<p class="lead o_default_snippet_text">
|
||||||
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit,
|
||||||
|
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<a class="mb-2 btn btn-primary" href="/web/login">
|
||||||
|
Login
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
<a class="mb-2 btn btn-secondary" href="https://www.open2bizz.nl">
|
||||||
|
Open2Bizz
|
||||||
|
</a>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</div>
|
||||||
</div>
|
|
||||||
</t>
|
</section>
|
||||||
|
</div>
|
||||||
</t>
|
</t>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
Reference in New Issue
Block a user