Compare commits
17
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5b874d250a | ||
|
|
b8c3e95031 | ||
|
|
35ab19922a | ||
|
|
90c1f6aa0e | ||
|
|
e971d66603 | ||
|
|
22ae42f73c | ||
|
|
a11b34b301 | ||
|
|
50aa6dd35c | ||
|
|
dff7231e6e | ||
|
|
05beaca92c | ||
|
|
0b7c12fdba | ||
|
|
614b78558e | ||
|
|
ca9836fca2 | ||
|
|
2b524051c3 | ||
|
|
1ee214c70a | ||
|
|
c8e217dd03 | ||
|
|
cc6e5e4eec |
Generated
+3
@@ -0,0 +1,3 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
<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
@@ -0,0 +1,6 @@
|
|||||||
|
<component name="InspectionProjectProfileManager">
|
||||||
|
<settings>
|
||||||
|
<option name="USE_PROJECT_PROFILE" value="false" />
|
||||||
|
<version value="1.0" />
|
||||||
|
</settings>
|
||||||
|
</component>
|
||||||
Generated
+7
@@ -0,0 +1,7 @@
|
|||||||
|
<?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
@@ -0,0 +1,8 @@
|
|||||||
|
<?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
@@ -0,0 +1,8 @@
|
|||||||
|
<?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
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Regular → Executable
@@ -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': '15.0.1.0.0',
|
'version': '16.0.1.0.0',
|
||||||
'module_type': 'official',
|
'module_type': 'official',
|
||||||
'depends': ['mail','base',],
|
'depends': ['mail','base',],
|
||||||
'data': [
|
'data': [
|
||||||
|
|||||||
@@ -1,3 +1,2 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from . import controllers
|
from . import controllers
|
||||||
@@ -3,5 +3,3 @@
|
|||||||
|
|
||||||
# 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,4 +1,5 @@
|
|||||||
<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>
|
||||||
@@ -15,4 +16,5 @@
|
|||||||
|
|
||||||
</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': '15.0.1.0.0',
|
'version': '16.0.1.0.0',
|
||||||
'depends': ['mail', 'base', 'mailcatcher_menu'],
|
'depends': ['mail', 'base', 'mailcatcher_menu'],
|
||||||
'data': [
|
'data': [
|
||||||
'views/templates.xml',
|
'views/templates.xml',
|
||||||
@@ -18,3 +18,5 @@
|
|||||||
],
|
],
|
||||||
'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': '15.0.1.0.0',
|
'version': '16.0.1.0.0',
|
||||||
'depends': ['testserver_o2b','website'],
|
'depends': ['testserver_o2b','website'],
|
||||||
'data': [
|
'data': [
|
||||||
'views/templates.xml',
|
'views/templates.xml',
|
||||||
|
|||||||
+34
-107
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from odoo import api, SUPERUSER_ID
|
from odoo import api, fields, models, SUPERUSER_ID
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -10,128 +10,55 @@ _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, {})
|
||||||
|
|
||||||
Website = env['website'].sudo()
|
model_website_page = env['ir.model'].search([
|
||||||
WebsitePage = env['website.page'].sudo()
|
('model', '=', 'website.page')
|
||||||
|
])
|
||||||
|
|
||||||
# ---------------------------------------------------------
|
test_view = env['ir.model.data']._xmlid_to_res_id(
|
||||||
# 1. Get the generic TEST page template
|
'testserver_website_o2b.testserver_page_website'
|
||||||
# ---------------------------------------------------------
|
|
||||||
test_view = env.ref(
|
|
||||||
'testserver_website_o2b.testserver_page_website',
|
|
||||||
raise_if_not_found=False,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if not test_view:
|
if model_website_page:
|
||||||
_logger.error(
|
for page in env['website.page'].search([]):
|
||||||
"Testserver website template "
|
_logger.error("________Disable page %s", page.id)
|
||||||
"'testserver_website_o2b.testserver_page_website' not found."
|
page.write({
|
||||||
)
|
'is_published': False,
|
||||||
return
|
|
||||||
|
|
||||||
# ---------------------------------------------------------
|
|
||||||
# 2. Unpublish all existing website pages
|
|
||||||
# ---------------------------------------------------------
|
|
||||||
pages = WebsitePage.search([])
|
|
||||||
|
|
||||||
if pages:
|
|
||||||
_logger.info(
|
|
||||||
"Unpublishing %s existing website pages.",
|
|
||||||
len(pages),
|
|
||||||
)
|
|
||||||
|
|
||||||
pages.write({
|
|
||||||
'website_published': False,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
# ---------------------------------------------------------
|
new_page = env['website.page'].create({
|
||||||
# 3. Create a TEST homepage for every website
|
'name': "Testbeeld",
|
||||||
# ---------------------------------------------------------
|
'url': "/testmodus",
|
||||||
websites = Website.search([])
|
'view_id': test_view,
|
||||||
|
'is_published': True,
|
||||||
for website in websites:
|
|
||||||
_logger.info(
|
|
||||||
"Creating test homepage for website %s (%s).",
|
|
||||||
website.name,
|
|
||||||
website.id,
|
|
||||||
)
|
|
||||||
|
|
||||||
# Each website gets its own ir.ui.view.
|
|
||||||
#
|
|
||||||
# In Odoo 15 website.page.website_id is related to
|
|
||||||
# view_id.website_id. Therefore we should not use the same
|
|
||||||
# ir.ui.view for multiple websites.
|
|
||||||
website_test_view = test_view.copy({
|
|
||||||
'name': 'Test environment - %s' % website.name,
|
|
||||||
'key': '%s.website_%s' % (test_view.key, website.id),
|
|
||||||
'website_id': website.id,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
test_page = WebsitePage.create({
|
for website in env['website'].search([]):
|
||||||
'url': '/testmodus',
|
|
||||||
'view_id': website_test_view.id,
|
|
||||||
'website_published': True,
|
|
||||||
'website_indexed': False,
|
|
||||||
})
|
|
||||||
|
|
||||||
# Odoo 15 uses homepage_id, NOT homepage_url.
|
|
||||||
website.write({
|
website.write({
|
||||||
'domain': False,
|
'domain': False,
|
||||||
'homepage_id': test_page.id,
|
'homepage_url': new_page.url,
|
||||||
})
|
})
|
||||||
|
|
||||||
_logger.info(
|
module_ecommerce = env['ir.module.module'].search([
|
||||||
"Test homepage %s assigned to website %s.",
|
('name', '=', 'website_sale')
|
||||||
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:
|
if module_ecommerce and module_ecommerce.state == 'installed':
|
||||||
_logger.info(
|
# Disable payment options
|
||||||
"Disabling %s payment acquirers.",
|
for payment_method in env['payment.method'].search([]):
|
||||||
len(payment_acquirers),
|
payment_method.write({
|
||||||
)
|
'active': False,
|
||||||
|
|
||||||
payment_acquirers.write({
|
|
||||||
'state': 'disabled',
|
|
||||||
})
|
})
|
||||||
|
_logger.error(
|
||||||
# ---------------------------------------------------------
|
"________Disable payment method %s",
|
||||||
# 5. Unpublish all webshop products
|
payment_method.id,
|
||||||
# ---------------------------------------------------------
|
|
||||||
#
|
|
||||||
# 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({
|
# Disable products
|
||||||
|
for product in env['product.template'].search([]):
|
||||||
|
product.write({
|
||||||
'website_published': False,
|
'website_published': False,
|
||||||
})
|
})
|
||||||
|
_logger.error(
|
||||||
_logger.info(
|
"________Disable product %s",
|
||||||
"Testserver website neutralization completed successfully."
|
product.id,
|
||||||
)
|
)
|
||||||
@@ -1,17 +1,10 @@
|
|||||||
<?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;
|
<span style="text-align: center;color: #FFFFFF;background-color: #006CFE;position: relative;display: block;font-size: 16px;">
|
||||||
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.
|
||||||
@@ -21,55 +14,35 @@
|
|||||||
</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"
|
||||||
<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-scroll-background-ratio="1"
|
||||||
|
data-snippet="s_banner" data-name="Banner" style="background-image: none;">
|
||||||
<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;"/>
|
<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;"/>
|
||||||
<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="container">
|
||||||
<div class="row s_nb_column_fixed">
|
<div class="row s_nb_column_fixed">
|
||||||
<div class="col-lg-6 jumbotron rounded o_cc o_cc1 pt32 pb32 o_colored_level" data-name="Box">
|
<div class="col-lg-6 jumbotron rounded o_cc o_cc1 pt32 pb32 o_colored_level" data-name="Box">
|
||||||
|
<h1><font style="font-size: 62px;" class="o_default_snippet_text">TEST</font><br/></h1>
|
||||||
<h1>
|
<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>
|
||||||
<font style="font-size: 62px;" class="o_default_snippet_text">
|
<a class="mb-2 btn btn-primary" href="/web/login" data-bs-original-title="" title="">Login</a>
|
||||||
TEST
|
|
||||||
</font>
|
|
||||||
<br/>
|
|
||||||
</h1>
|
|
||||||
|
|
||||||
<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/>
|
||||||
<br/>
|
<br/>
|
||||||
|
<a class="mb-2 btn btn-secondary" href="https://www.open2bizz.nl" data-bs-original-title="" title="">Open2Bizz</a>
|
||||||
<a class="mb-2 btn btn-secondary" href="https://www.open2bizz.nl">
|
|
||||||
Open2Bizz
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</t>
|
</t>
|
||||||
|
</t>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
Reference in New Issue
Block a user