145 Commits

Author SHA1 Message Date
79dc116c44 Update README.md 2024-06-10 13:16:25 +00:00
238da55f2d Update README.md 2024-03-26 08:46:42 +00:00
05bcfe1872 Update install_mailhog_as_service.sh 2024-02-19 11:40:51 +00:00
e1d434c33a Update README.md 2024-02-02 11:45:53 +00:00
d9872bd6b5 Update README.md 2024-02-02 11:45:09 +00:00
22b55fa5c7 Update README.md 2024-02-02 11:43:43 +00:00
dbd5a48bab mailcatcher losgemaakt van testserver 2024-02-02 12:12:15 +01:00
c3e510c873 Update testserver_o2b/__manifest__.py 2024-01-12 15:17:03 +00:00
74b570d94c Update testserver_o2b/views/views.xml 2024-01-12 15:16:16 +00:00
2015495a75 Delete testserver_o2b/security/ir.model.access.csv 2024-01-12 15:14:40 +00:00
51502abe2a Update testserver_o2b/models/init_test.py 2024-01-12 15:14:18 +00:00
4727d65c44 Update testserver_o2b/models/init_test.py 2023-12-18 13:11:40 +00:00
d06bc121fc Update testserver_o2b/models/init_test.py 2023-12-18 13:08:40 +00:00
c8b5df4719 Update testserver_o2b/models/init_test.py 2023-12-18 12:57:59 +00:00
c25489fd8c Update testserver_o2b/models/init_test.py
Added report.url to ir_config_parameter
2023-12-12 12:27:50 +00:00
77aaf76c67 Update file views.xml 2023-11-13 08:14:01 +00:00
8b34d391f4 Update file views.xml 2023-11-06 11:59:10 +00:00
4b9f44d9d9 Update file views.xml 2023-11-06 11:51:04 +00:00
493b2b7776 Update file views.xml 2023-11-06 11:41:34 +00:00
d8a1581a64 Update file views.xml 2023-11-06 11:38:39 +00:00
e36cab7b7a Update file views.xml 2023-11-06 11:37:00 +00:00
74ae964ee3 Update file views.xml 2023-11-06 11:35:02 +00:00
b7e35e150b Update file init_test.py 2023-11-06 10:00:44 +00:00
c71ffa1b2e Update file init_test.py 2023-11-06 09:59:05 +00:00
4e943dd168 Update file init_test.py 2023-11-06 09:58:23 +00:00
cbe118244d Update file views.xml 2023-11-06 09:55:16 +00:00
a437969661 Update file init_test.py 2023-11-06 09:51:57 +00:00
61315206c2 Update file init_test.py 2023-11-06 09:49:32 +00:00
39d7366811 Update file views.xml 2023-11-06 09:34:24 +00:00
f02e4f4dbc Update file init_test.py 2023-11-06 09:32:14 +00:00
87a90da4c5 Update file init_test.py 2023-11-06 09:28:52 +00:00
91431d54e2 Update file init_test.py 2023-11-06 09:27:26 +00:00
9ed33ccaff Update file init_test.py 2023-11-06 09:25:43 +00:00
8f04dcfd23 Update file init_test.py 2023-11-06 09:22:36 +00:00
d0c1327bf9 Update file init_test.py 2023-11-06 09:21:00 +00:00
3124f9470b Update file init_test.py 2023-11-06 09:09:50 +00:00
52a384f48c Update file init_test.py 2023-11-06 09:07:23 +00:00
2ab979c047 Update file init_test.py 2023-11-06 09:05:58 +00:00
76cb53ec67 Update file init_test.py 2023-11-06 09:01:40 +00:00
582b1a89c6 Update file init_test.py 2023-11-06 08:57:41 +00:00
c853b0b64f Update file init_test.py 2023-11-06 08:54:59 +00:00
1cf19d3671 Update file init_test.py 2023-11-06 08:52:47 +00:00
86e52ca4c5 Update file init_test.py 2023-11-06 08:52:08 +00:00
13d1a06291 Update file init_test.py 2023-11-06 08:51:13 +00:00
defe0b60ba Update file init_test.py 2023-11-06 08:49:48 +00:00
042d8f279d Update 2 files
- /testserver_o2b/models/init_test.py
- /testserver_o2b/views/views.xml
2023-11-06 08:47:03 +00:00
5683efd3a9 Update install_mailhog_as_service.sh 2023-11-03 16:21:13 +00:00
453c5036dc Update file views.xml 2023-11-01 22:25:31 +00:00
24349d4b5e Update file views.xml 2023-11-01 22:24:14 +00:00
bd44e351f7 Update file views.xml 2023-11-01 22:21:02 +00:00
8b1f118696 Update file views.xml 2023-11-01 22:19:57 +00:00
85d38286ac Update file views.xml 2023-11-01 22:15:21 +00:00
96509c8125 Update file views.xml 2023-11-01 22:11:13 +00:00
91424ea3c8 Update file views.xml 2023-11-01 22:07:45 +00:00
2fe6c58b9f Update file views.xml 2023-11-01 22:06:23 +00:00
7c17b1c4fb Update file views.xml 2023-11-01 22:05:13 +00:00
935d53db7c Update file views.xml 2023-11-01 22:04:02 +00:00
2afcef67b9 Update file views.xml 2023-11-01 22:03:30 +00:00
dc57ad9717 Update file views.xml 2023-11-01 21:58:42 +00:00
1427dd8422 Update file views.xml 2023-11-01 21:54:17 +00:00
10be7ec119 Update file views.xml 2023-11-01 21:53:22 +00:00
81a07d8d0d Update file views.xml 2023-11-01 21:46:11 +00:00
34021d7ed3 Update file views.xml 2023-11-01 21:38:29 +00:00
d47fe6039e Update file views.xml 2023-11-01 21:34:32 +00:00
9618a28464 Update file views.xml 2023-11-01 21:33:24 +00:00
507392261d Update file views.xml 2023-11-01 21:29:57 +00:00
2960ed7dfb Update file views.xml 2023-11-01 21:27:54 +00:00
7817d8b2ea Update file views.xml 2023-11-01 21:23:12 +00:00
bb7824ef1b Update file ir.model.access.csv 2023-11-01 21:21:16 +00:00
6d647d11bb Update file ir.model.access.csv 2023-11-01 21:20:32 +00:00
8b1905a23b Update file ir.model.access.csv 2023-11-01 21:19:28 +00:00
ab1c00f625 Update file ir.model.access.csv 2023-11-01 21:18:19 +00:00
c166b55227 Update file ir.model.access.csv 2023-11-01 21:17:27 +00:00
8f4ad7f5c6 Update 2 files
- /testserver_o2b/__manifest__.py
- /testserver_o2b/security/ir.model.access.csv
2023-11-01 21:15:59 +00:00
96e2076831 Update file ir.model.access.csv 2023-11-01 21:12:06 +00:00
f0e269926e Update file ir.model.access.csv 2023-11-01 21:08:07 +00:00
207a206a65 Update file ir.model.access.csv 2023-11-01 21:05:47 +00:00
99f11868a2 Update file ir.model.access.csv 2023-11-01 21:04:14 +00:00
ba39e52800 Update file ir.model.access.csv 2023-11-01 21:02:10 +00:00
f76a7c3852 Update file ir.model.access.csv 2023-11-01 20:58:44 +00:00
2568640bef Update file views.xml 2023-11-01 20:51:30 +00:00
a92ff85ca8 Update 2 files
- /testserver_o2b/security/ir.model.access.csv
- /testserver_o2b/views/views.xml
2023-11-01 20:47:44 +00:00
55812f17aa Update file views.xml 2023-11-01 20:43:16 +00:00
d10467f62c Update file init_test.py 2023-11-01 20:41:55 +00:00
16822d627b Update file views.xml 2023-11-01 11:46:19 +00:00
c6a84edacb Update file views.xml 2023-11-01 11:43:33 +00:00
4dd4418308 Update file views.xml 2023-11-01 11:40:19 +00:00
d1e5c46202 Update file views.xml 2023-11-01 11:37:02 +00:00
aa640a837a Update file views.xml 2023-11-01 11:35:28 +00:00
9a11148be3 Update file views.xml 2023-11-01 11:33:07 +00:00
8cbac541a8 Update file views.xml 2023-11-01 11:31:42 +00:00
a1b4887b77 Update file views.xml 2023-11-01 11:29:27 +00:00
c800175a35 Update file views.xml 2023-11-01 11:27:57 +00:00
900b66b54b Update file views.xml 2023-11-01 11:25:15 +00:00
bf4425a16d Update file views.xml 2023-11-01 11:14:14 +00:00
c9836b5eb0 Update file views.xml 2023-11-01 11:13:02 +00:00
79da5a2b68 Update file views.xml 2023-11-01 11:12:01 +00:00
7fc884523c Update file views.xml 2023-11-01 11:10:01 +00:00
485a2817d9 Update file views.xml 2023-11-01 11:06:44 +00:00
8993814d29 Update file views.xml 2023-11-01 11:02:34 +00:00
a480cd746a Update file views.xml 2023-11-01 11:00:55 +00:00
51b2311872 Update file views.xml 2023-11-01 10:57:37 +00:00
0f69ad235f Update file views.xml 2023-11-01 10:55:59 +00:00
49ab8024a5 Update file views.xml 2023-11-01 10:53:39 +00:00
489f106354 Update file views.xml 2023-11-01 10:50:24 +00:00
69acbfe981 Update file views.xml 2023-11-01 10:49:25 +00:00
62c5cc80e7 Update file views.xml 2023-11-01 10:45:34 +00:00
0f8621aa01 Update file views.xml 2023-11-01 10:43:16 +00:00
a26c56aafb Update file views.xml 2023-11-01 10:38:33 +00:00
a095160208 Update file init_test.py 2023-10-30 22:19:10 +00:00
4652f544f4 Update file init_test.py 2023-10-30 22:14:51 +00:00
d9746a0b7e Update file init_test.py 2023-10-30 22:12:04 +00:00
727b27a53f Update file init_test.py 2023-10-30 22:10:15 +00:00
ac690a4018 Update file init_test.py 2023-10-30 21:59:09 +00:00
cef6dab234 Update file install_mailhog_as_service.sh 2023-10-30 21:52:39 +00:00
4ec07aa8f0 Update 2 files
- /testserver.sh
- /install_mailhog_as_service.sh
2023-10-30 21:47:16 +00:00
30e35be0a8 Update file init_test.py 2023-10-30 21:19:03 +00:00
f68b586206 Update file init_test.py 2023-10-30 21:11:34 +00:00
61bc5bcd64 Update file init_test.py 2023-10-30 21:10:18 +00:00
72b3b6870e Update file init_test.py 2023-10-30 21:08:16 +00:00
c2e0ae6d56 Update file init_test.py 2023-10-30 21:07:14 +00:00
70bb9bb350 Update file init_test.py 2023-10-30 21:03:34 +00:00
e0df294c7e Update file init_test.py 2023-10-30 21:01:28 +00:00
d71181d492 Update file init_test.py 2023-10-30 20:59:48 +00:00
4d795a837c Update file init_test.py 2023-10-30 20:55:32 +00:00
90f135fffa Update file init_test.py 2023-10-30 20:53:43 +00:00
c76920ff06 Update file init_test.py 2023-10-30 20:51:47 +00:00
cc4a2a9c6c Update file init_test.py 2023-10-30 20:50:11 +00:00
5b2b6b257e Update file init_test.py 2023-10-30 20:48:00 +00:00
479233a643 Update file init_test.py 2023-10-30 20:45:30 +00:00
ef2cea6fb1 Update file init_test.py 2023-10-30 20:38:45 +00:00
97c5a356fa Update file init_test.py 2023-10-30 20:35:59 +00:00
ead437df70 Update file init_test.py 2023-10-30 20:28:22 +00:00
bf3b88515c Update 2 files
- /testserver_o2b/models/init_test.py
- /testserver.sh
2023-10-30 20:19:54 +00:00
9cc86be67c Update file init_test.py 2023-10-30 20:12:52 +00:00
51a37f30c0 Update file init_test.py 2023-10-30 20:07:36 +00:00
4320071cb4 Update file init_test.py 2023-10-30 20:06:37 +00:00
a14c779a1d Update file init_test.py 2023-10-30 19:57:49 +00:00
fdb33f9536 Update file init_test.py 2023-10-30 19:50:41 +00:00
3059fb99d5 Update file init_test.py 2023-10-30 19:48:06 +00:00
8765d5b4ad Update file init_test.py 2023-10-30 19:43:12 +00:00
da11d7281f Update file init_test.py 2023-10-30 19:38:24 +00:00
9321201877 Update file __manifest__.py 2023-10-30 19:29:17 +00:00
d9c742ba5d Update init_test.py 2023-10-30 19:26:06 +00:00
cce9695591 Update init_test.py 2023-10-30 19:12:04 +00:00
30 changed files with 46 additions and 496 deletions

View File

@@ -30,7 +30,6 @@ fi
go version go version
- Installeer nu Mailhog met het installatie script - Installeer nu Mailhog met het installatie script
``` ```
## Na de installatie ## Na de installatie
@@ -85,11 +84,9 @@ server {
In de nginx config file een wachtwoord opnemen: In de nginx config file een wachtwoord opnemen:
``` ```
======================================================== ========================================================
Voorbeeld: Voorbeeld:
In de nginx config file voor omgeving 499 een wachtwoord instellen: In de nginx config file voor omgeving 499 een wachtwoord instellen:

View File

@@ -1,86 +1,57 @@
#!/bin/bash #!/bin/bash
echo "";
set -e # stop bij fouten echo "===================================";
echo "Install golang-go...";
echo "" echo "===================================";
echo "===================================" apt-get -y install golang-go;
echo "Update apt..." if [ $? == 0 ] ; then
echo "===================================" echo 'golang-go installed'
apt update else
echo 'ERROR: Installing golang-go NOT succesfull!'
echo "" exit
echo "==================================="
echo "Install dependencies..."
echo "==================================="
apt-get -y install wget tar
echo ""
echo "==================================="
echo "Install Go 1.24.3..."
echo "==================================="
GO_VERSION=1.25.0
wget https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz
# Go environment correct instellen
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$GOROOT/bin:$GOPATH/bin:$PATH
echo "Go version:"
go version
echo ""
echo "==================================="
echo "Installing MailHog..."
echo "==================================="
/usr/local/go/bin/go install github.com/mailhog/MailHog@latest
if [ -f "$HOME/go/bin/MailHog" ]; then
echo "MailHog installed successfully"
else
echo "ERROR: MailHog binary not found!"
exit 1
fi fi
echo "";
echo "" echo "===================================";
echo "===================================" echo "Installing mailhog...";
echo "Copy MailHog to /usr/local/bin..." echo "===================================";
echo "===================================" go install github.com/mailhog/MailHog@latest;
sudo cp "$HOME/go/bin/MailHog" /usr/local/bin/MailHog if [ $? == 0 ] ; then
echo "";
echo "" echo "===================================";
echo "===================================" echo "Mailcatcher installed succesfully!";
echo "Create MailHog service..." echo "===================================";
echo "===================================" echo "";
sudo tee /etc/systemd/system/mailhog.service > /dev/null <<EOL else
echo 'ERROR: Installing Mailcatcher NOT succesfull!'
exit
fi
echo "===================================";
echo "Copy Mailhog to bin...";
echo "===================================";
sudo cp ~/go/bin/MailHog /usr/local/bin/MailHog
if [ $? == 0 ] ; then
echo 'Mailhog copied'
else
echo 'ERROR: Copy Mailhog NOT succesfull!'
exit
fi
echo "";
echo "===================================";
echo "Create MailHog service...";
echo "===================================";
sudo tee /etc/systemd/system/mailhog.service <<EOL
[Unit] [Unit]
Description=MailHog Description=MailHog
After=network.target After=network.target
[Service] [Service]
User=root User=root
ExecStart=/usr/local/bin/MailHog ExecStart=/usr/bin/env /usr/local/bin/MailHog > /dev/null 2>&1 &
Restart=always
Environment="PATH=/usr/local/go/bin:/usr/bin:/bin"
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
EOL EOL
echo ""
echo "==================================="
echo "Enable + start MailHog service..."
echo "==================================="
systemctl daemon-reload
systemctl enable mailhog systemctl enable mailhog
systemctl start mailhog systemctl start mailhog
echo "";
echo "" echo "===================================";
echo "===================================" echo "Mailhog service created and started.";
echo "MailHog is running!" echo "===================================";
echo "Web UI: http://localhost:8025"
echo "SMTP: localhost:1025"
echo "==================================="

View File

@@ -1,4 +0,0 @@
# -*- coding: utf-8 -*-
from . import controllers
from . import models

View File

@@ -1,22 +0,0 @@
# -*- coding: utf-8 -*-
{
'name': "mailcatcher_menu",
'summary': """
Add menu-item to local mailcatcher""",
'description': """
Add menu-item to local mailcatcher
""",
'author': "Open2bizz",
'website': "http://www.open2bizz.tech",
'category': 'Uncategorized',
'version': '18.0.1.0.0',
'module_type': 'official',
'depends': ['mail','base',],
'data': [
'views/views.xml',
'data/data.xml'
],
}

View File

@@ -1,3 +0,0 @@
# -*- coding: utf-8 -*-
from . import controllers

View File

@@ -1,21 +0,0 @@
# -*- coding: utf-8 -*-
# from odoo import http
# class TestserverO2b(http.Controller):
# @http.route('/testserver_o2b/testserver_o2b/', auth='public')
# def index(self, **kw):
# return "Hello, world"
# @http.route('/testserver_o2b/testserver_o2b/objects/', auth='public')
# def list(self, **kw):
# return http.request.render('testserver_o2b.listing', {
# 'root': '/testserver_o2b/testserver_o2b',
# 'objects': http.request.env['testserver_o2b.testserver_o2b'].search([]),
# })
# @http.route('/testserver_o2b/testserver_o2b/objects/<model("testserver_o2b.testserver_o2b"):obj>/', auth='public')
# def object(self, obj, **kw):
# return http.request.render('testserver_o2b.object', {
# 'object': obj
# })

View File

@@ -1,5 +0,0 @@
<odoo>
<data>
<function model="ir.config_parameter" name="_mailcatcher_url"/>
</data>
</odoo>

View File

@@ -1,30 +0,0 @@
<odoo>
<data>
<!--
<record id="object0" model="testserver_o2b.testserver_o2b">
<field name="name">Object 0</field>
<field name="value">0</field>
</record>
<record id="object1" model="testserver_o2b.testserver_o2b">
<field name="name">Object 1</field>
<field name="value">10</field>
</record>
<record id="object2" model="testserver_o2b.testserver_o2b">
<field name="name">Object 2</field>
<field name="value">20</field>
</record>
<record id="object3" model="testserver_o2b.testserver_o2b">
<field name="name">Object 3</field>
<field name="value">30</field>
</record>
<record id="object4" model="testserver_o2b.testserver_o2b">
<field name="name">Object 4</field>
<field name="value">40</field>
</record>
-->
</data>
</odoo>

View File

@@ -1,3 +0,0 @@
# -*- coding: utf-8 -*-
from . import mailcatcher_menu

View File

@@ -1,27 +0,0 @@
# Copyright 2024 Open2Bizz <info@open2bizz.nl>
# License LGPL-3
from odoo import api, fields, models, _
import logging
_logger = logging.getLogger(__name__)
class IrActionUrl(models.Model):
_inherit = "ir.config_parameter"
@api.model
#def init(self):
def _mailcatcher_url(self):
parameters = self.env['ir.config_parameter'].search([('key','=', 'web.base.url')])
if parameters:
parameter = parameters[0]
cont_nr = parameter.value.split("//",1)[1] #Haal https:// van string
cont_nr = cont_nr[0:3] #De eerste 3 karakters is het containernummer
act_url = "https://" + cont_nr + "-mailcatcher.staging.open2bizz.com"
_logger.info('---------- ACT_URL ---------- %s', act_url)
action_id = self.env['ir.model.data']._xmlid_to_res_id('mailcatcher_menu.action_mailcatcher_url')
action = self.env['ir.actions.act_url'].browse(action_id)
if action:
action.write({'url':act_url})

View File

@@ -1,2 +0,0 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_mailcatcher_menu_mailcatcher_menu","mailcatcher_menu.mailcatcher_menu","model_mailcatcher_menu_mailcatcher_menu","base.group_user",1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_mailcatcher_menu_mailcatcher_menu mailcatcher_menu.mailcatcher_menu model_mailcatcher_menu_mailcatcher_menu base.group_user 1 1 1 1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 382 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 KiB

View File

@@ -1,18 +0,0 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<body>
<div class="document" id="module-name">
<h1 class="title">mailcatcher_menu</h1>
<p>
This module is ONLY for test environments In DC Open2Bizz
</p>
<p>
Module is developed by Open2Bizz. Bug reports: support@open2bizz.eu
</p>
<p>
<img src="https://www.open2bizz.tech/logo.png" style="max-height: 100px;">
</p>
</div>
</body>
</html>

View File

@@ -1,14 +0,0 @@
<odoo>
<data>
<record model="ir.actions.act_url" id="action_mailcatcher_url">
<field name="name">Open Mailcatcher</field>
<field name="url">https://mailcatcher.staging.open2bizz.com</field>
<field name="target">new</field>
</record>
<!-- Top menu item -->
<menuitem name="MailCatcher" id="mailcatcher_menu.menu_root" sequence="999" web_icon="mailcatcher_menu,static/description/email-icon.png" action="action_mailcatcher_url"/>
</data>
</odoo>

View File

@@ -1 +0,0 @@
touch /tmp/x.txt

View File

@@ -1,3 +0,0 @@
# -*- coding: utf-8 -*-
from . import models

View File

@@ -1,17 +0,0 @@
# -*- coding: utf-8 -*-
{
'name': "Set as testserver Open2Bizz",
'summary': """
Only to be used when installed as TEST env. Open2Bizz""",
'author': "Open2bizz",
'website': "http://www.open2bizz.tech",
'category': 'Uncategorized',
'version': '18.0.1.0.0',
'depends': ['mail','base','mailcatcher_menu',],
'data': [
'views/templates.xml',
],
}

View File

@@ -1,3 +0,0 @@
# -*- coding: utf-8 -*-
from . import init_test

View File

@@ -1,80 +0,0 @@
# -*- coding: utf-8 -*-
from odoo import tools
from odoo import api, fields, models
from collections.abc import Mapping
import logging
_logger = logging.getLogger(__name__)
import os
import uuid
import odoo
class IrLogging(models.Model):
_inherit = 'ir.logging'
def init(self):
db_id = uuid.uuid1()
_logger.error(db_id)
self.env.cr.execute("""
UPDATE ir_mail_server set active = 'f';
UPDATE fetchmail_server set active = 'f';
UPDATE ir_cron set active = 'f';
DELETE FROM mail_mail;
UPDATE ir_config_parameter set value = 'M160129258730' where key = 'database.enterprise_code';
UPDATE ir_config_parameter set value = (NOW() + INTERVAL '30 DAY') where key = 'database.expiration_date';
UPDATE ir_config_parameter set value = '%s' where key = 'database.uuid';
INSERT INTO ir_mail_server(smtp_host,smtp_port,name,smtp_authentication,smtp_encryption,active) VALUES ('127.0.0.1','1025','Lokale mailcatcher','login','name','t');
INSERT INTO ir_mail_server(smtp_host,smtp_port,name,smtp_authentication,smtp_encryption,active) VALUES ('192.168.78.199','1025','Algemene mailcatcher','login','name','t');
INSERT INTO ir_mail_server(smtp_host,smtp_port,name,smtp_authentication,smtp_encryption,active) VALUES ('hnode6.openworx.nl','1025','Algemene mailcatcher vanaf hnode4','login','name','t');
""" %(db_id))
if self.env['ir.config_parameter'].search([('key','=','web.base.url.freeze')]):
self.env.cr.execute("""DELETE FROM ir_config_parameter WHERE key = 'web.base.url.freeze';""")
if not self.env['ir.config_parameter'].search([('key','=','report.url')]):
self.env.cr.execute("""INSERT INTO ir_config_parameter(key,value) VALUES ('report.url','http://127.0.0.1:8069');""")
if self.env['ir.model'].search([('model','=','mail.partner.device')]):
self.env.cr.execute("""DELETE FROM mail_partner_device;""")
model = self.env['ir.model'].search([('model','=','delivery.carrier')])
if model:
field = self.env['ir.model.fields'].search([('name','=','prod_environment'),('model_id','=',model.id)])
if field:
self.env.cr.execute("""UPDATE delivery_carrier SET prod_environment = False WHERE id>0;""")
model = self.env['ir.model'].search([('model','=','payment.provider')])
if model:
field = self.env['ir.model.fields'].search([('name','=','state'),('model_id','=',model.id)])
if field:
self.env.cr.execute("""UPDATE payment_provider SET state = 'disabled' WHERE id>0;""")
model = self.env['ir.model'].search([('model','=','account.online.link')])
if model:
field = self.env['ir.model.fields'].search([('id','>',0),('model_id','=',model.id)])
if field:
self.env.cr.execute("""DELETE FROM account_online_link WHERE id > 0;""")
if self.env['ir.model'].search([('model','=','account.journal')]):
self.env.cr.execute("""UPDATE account_journal set bank_statements_source = 'undefined';""")
ip_ok = False
with os.popen("ip a") as f:
for x in f.readlines():
if float(x.find('192.168.78.')) > -1:
ip_ok = True
if not ip_ok:
self.env.cr.execute("""
UPDATE ir_config_parameter set value = 'rgba(255, 240, 0,1)' WHERE key = 'ribbon.background.color';
UPDATE ir_config_parameter set value = '#000000' WHERE key = 'ribbon.color';
UPDATE ir_config_parameter set value = '!!! IP WRONG !!!' WHERE key = 'ribbon.name';
""")
ADDONS_PATH = odoo.tools.config['addons_path']
_logger.error(ADDONS_PATH)
for ap in ADDONS_PATH.split(','):
if ap[-10:] == 'testserver':
_logger.error(os.system('./%s/testserver.sh' %(ap)))
self._disable_web_push_notifications()
_logger.debug(f"_______ disable_web_push_notifications ____")
def _disable_web_push_notifications(self):
parameter = self.env['ir.config_parameter'].sudo()
parameter.set_param('web_push.notification.enabled', '0')
parameters = self.env['ir.config_parameter'].sudo().search([
('key', 'in', ('mail.web_push_vapid_private_key', 'mail.web_push_vapid_public_key', 'mail.sfu_server_key'))])
for parameter in parameters:
parameter.sudo().unlink()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 KiB

View File

@@ -1,18 +0,0 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<body>
<div class="document" id="module-name">
<h1 class="title">Testservers</h1>
<p>
This module is ONLY for test environments In DC Open2Bizz
</p>
<p>
Module is developed by Open2Bizz. Bug reports: support@open2bizz.eu
</p>
<p>
<img src="https://www.open2bizz.tech/logo.png" style="max-height: 100px;">
</p>
</div>
</body>
</html>

View File

@@ -1,18 +0,0 @@
<odoo>
<data>
<!-- 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>
</data>
</odoo>

View File

@@ -1,3 +0,0 @@
# -*- coding: utf-8 -*-
from .hooks import post_init_hook

View File

@@ -1,18 +0,0 @@
# -*- coding: utf-8 -*-
{
'name': "Set as testserver Open2Bizz, when website is enabled",
'summary': """
Only to be used when installed as TEST env. Open2Bizz""",
'author': "Open2bizz",
'website': "http://www.open2bizz.tech",
'category': 'Uncategorized',
'version': '18.0.1.0.0',
'depends': ['testserver_o2b','website'],
'data': [
'views/templates.xml',
],
'post_init_hook': 'post_init_hook',
}

View File

@@ -1,41 +0,0 @@
# -*- coding: utf-8 -*-
from odoo import api, fields, models
import logging
_logger = logging.getLogger(__name__)
def post_init_hook(env):
model_website_page = env['ir.model'].search([('model','=','website.page')])
test_view = env['ir.model.data']._xmlid_to_res_id('testserver_website_o2b.testserver_page_website')
if model_website_page:
for page in env['website.page'].search([]):
_logger.error(f"________Disable page {page.id}")
page.write({
'is_published': False
})
# Create test page as startpage
new_page = env['website.page'].create(
{'name':"Testbeeld", 'url': "/testmodus", 'view_id': test_view, 'is_published': True}
)
for website in env['website'].search([]):
website.write({
'domain': f"None_{website.domain}",
'homepage_url': new_page.url
})
module_ecommerce = env['ir.module.module'].search([('name','=','website_sale')])
if module_ecommerce and module_ecommerce.state == 'installed':
# disable payment options:
for payment_method in env['payment.method'].search([]):
payment_method.write({
'active': False
})
_logger.error(f"________Disable payment method {payment_method.id}")
# Disable products
for product in env['product.template'].search([]):
product.write({
'website_published': False
})
_logger.error(f"________Disable product {product.id}")

View File

@@ -1 +0,0 @@
# -*- coding: utf-8 -*-

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 KiB

View File

@@ -1,18 +0,0 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<body>
<div class="document" id="module-name">
<h1 class="title">Testservers when website</h1>
<p>
This module is ONLY for test environments In DC Open2Bizz
</p>
<p>
Module is developed by Open2Bizz. Bug reports: support@open2bizz.eu
</p>
<p>
<img src="https://www.open2bizz.tech/logo.png" style="max-height: 100px;">
</p>
</div>
</body>
</html>

View File

@@ -1,48 +0,0 @@
<odoo>
<data>
<!-- 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>
</template>
</data>
</odoo>