Initiele commit
This commit is contained in:
@@ -13,11 +13,9 @@
|
|||||||
'website': "http://www.open2bizz.tech",
|
'website': "http://www.open2bizz.tech",
|
||||||
'category': 'Uncategorized',
|
'category': 'Uncategorized',
|
||||||
'version': '0.1',
|
'version': '0.1',
|
||||||
'depends': ['web_environment_ribbon', 'mail','base',],
|
'depends': ['mail','base',],
|
||||||
'data': [
|
'data': [
|
||||||
'views/views.xml',
|
'views/views.xml',
|
||||||
|
'data/data.xml'
|
||||||
],
|
],
|
||||||
#'demo': [
|
|
||||||
# 'demo/demo.xml',
|
|
||||||
#],
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
#from . import init_test
|
from . import mailcatcher_menu
|
||||||
|
|||||||
26
mailcatcher_menu/models/mailcatcher_menu.py
Normal file
26
mailcatcher_menu/models/mailcatcher_menu.py
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
# 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"
|
||||||
|
|
||||||
|
#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})
|
||||||
|
|
||||||
|
|
||||||
@@ -3,13 +3,12 @@
|
|||||||
|
|
||||||
<record model="ir.actions.act_url" id="action_mailcatcher_url">
|
<record model="ir.actions.act_url" id="action_mailcatcher_url">
|
||||||
<field name="name">Open Mailcatcher</field>
|
<field name="name">Open Mailcatcher</field>
|
||||||
<!--<field name="url">https://{{ir.config_parameter.web.base.url}}</field>-->
|
<field name="url">https://mailcatcher.staging.open2bizz.com</field>
|
||||||
<field name="url">https://440-mailcatcher.staging.open2bizz.com</field>
|
|
||||||
<field name="target">new</field>
|
<field name="target">new</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<!-- Top menu item -->
|
<!-- Top menu item -->
|
||||||
<menuitem name="MailCatcher" id="mailcatcher_menu.menu_root" web_icon="mailcatcher_menu,static/description/email-icon.png" action="action_mailcatcher_url"/>
|
<menuitem name="MailCatcher" id="mailcatcher_menu.menu_root" sequence="99" web_icon="mailcatcher_menu,static/description/email-icon.png" action="action_mailcatcher_url"/>
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
Reference in New Issue
Block a user