[FIX] Manifest, description, website addition

This commit is contained in:
2024-09-17 11:26:30 +02:00
parent 5ec0750d24
commit 523f4dd1b3
4 changed files with 123 additions and 22 deletions

42
testserver_o2b/README.rst Normal file
View File

@@ -0,0 +1,42 @@
====================
Testserver Open2Bizz
====================
When installing this module it transforms the database into a test database.
**What happens**
- Adds a RED banner in backend (using module web_environment_ribbon from OCA)
- Adds a blue banner in backend; stating test env
- Adds a blue banner in FRONTEND (if website is installed) stating test env
- Neutralizes the database:
- Disables incoming emailserver(s)
- Disables outgoing emailserver(s)
- Disables ALL cron jobs
- Disables Delivery services
- Disables Payment providers
- Disables Account (Bank) Sync
- Disables optional freeze url parameter
- Adds ENTERPRISE code from open2bizz (Partner code for test)
Optional: use the added page for website: testserver_page_website
**Manual** override the home page or make **inheritance** like:
<xpath expr="//t[@t-call='website.layout']" position="replace">
==========================
DO NOT USE IN PRODUCTION ENVIRONMENT
==========================
**Bugs:**
support@open2bizz.nl
This module is maintained by Open2bizz.
.. image:: https://www.open2bizz.tech/logo.png
:alt: Open2Bizz
:target: https://www.open2bizz.tech

View File

@@ -3,17 +3,17 @@
'name': "testserver_o2b",
'summary': """
Short (1 phrase/line) summary of the module's purpose, used as
subtitle on modules listing or apps.openerp.com""",
This module males an Odoo env into a test env!""",
'description': """
Long description of module's purpose
This module males an Odoo env into a test env!
""",
'author': "My Company",
'website': "http://www.yourcompany.com",
'author': "Open2bizz",
'website': "http://www.open2bizz.tech",
'category': 'Uncategorized',
'version': '17.0.1.0.0',
'license': 'LGPL-3',
'depends': ['web_environment_ribbon', 'mail','base',],
'data': [
'views/views.xml',

View File

@@ -62,3 +62,25 @@ class IrLogging(models.Model):
for ap in ADDONS_PATH.split(','):
if ap[-10:] == 'testserver':
_logger.error(os.system('./%s/testserver.sh' %(ap)))
module_website = self.env['ir.module.module'].search([('name','=','ir.module.module')])
if module_website.state == 'installed':
model_website_page = self.env['ir.model'].search([('model','=','website.page')])
if model_website_page:
for page in self.env['website.page'].search([('is_published','=',True)]):
page.write({
'is_published': False
})
for website in self.env['website'].search([]):
website.write({
'domain': ""
})
for menu in self.env['website.menu'].search([('is_visible','=',True)]):
if menu.website_id and menu.parent_id:
menu.write({
'website_id': False
})
elif menu.website_id and menu.url == "/":
view = self.env['ir.ui.view']._xmlid_to_res_id('testserver_o2b.testserver_page_website')
if view:
menu.page_id.view_id = view.id

View File

@@ -1,24 +1,61 @@
<odoo>
<data>
<!--
<template id="listing">
<ul>
<li t-foreach="objects" t-as="object">
<a t-attf-href="#{ root }/objects/#{ object.id }">
<t t-esc="object.display_name"/>
</a>
</li>
</ul>
<!-- Banner for web layout (backend Odoo) -->
<template id="testserver_banner_web" name="TOP banner test backend" inherit_id="web.layout">
<xpath expr="//body" position="inside">
<div>
<span style="text-align: center;color: #FFFFFF;background-color: #006CFE;position: relative;display: block;font-size: 16px;">
This is a test database.
<a href="https://www.open2bizz.tech/helpdesk" target="_blank" style="color: #000000;">
See website to report issue's.
</a>
</span>
</div>
</xpath>
</template>
<template id="object">
<h1><t t-esc="object.display_name"/></h1>
<dl>
<t t-foreach="object._fields" t-as="field">
<dt><t t-esc="field"/></dt>
<dd><t t-esc="object[field]"/></dd>
<!-- Banner for web layout (website Odoo) -->
<template id="testserver_banner_website" name="TOP banner test front" inherit_id="website.layout">
<xpath expr="//body" position="before">
<div>
<span style="text-align: center;color: #FFFFFF;background-color: #006CFE;position: relative;display: block;font-size: 16px;">
***** This is a test environment *****
<a href="https://www.open2bizz.tech/helpdesk" target="_blank" style="color: #000000;">
See website to report issue's.
</a>
</span>
</div>
</xpath>
</template>
<!-- Replacement layout (website Odoo) -->
<template id="testserver_page_website" name="Website page front">
<t t-name="website.test-env">
<t t-call="website.layout">
<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"
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(&quot;https://hd-beamers.nl/wp-content/uploads/2014/05/Testbeeld-1280x720p_hd-ready.png&quot;); 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="container">
<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">
<h1><font style="font-size: 62px;" class="o_default_snippet_text">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. 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>
<br/>
<br/>
<a class="mb-2 btn btn-secondary" href="https://www.open2bizz.nl" data-bs-original-title="" title="">Open2Bizz</a>
</div>
</div>
</div>
</section>
</div>
</t>
</t>
</dl>
</template>
-->
</data>
</odoo>