This commit is contained in:
jopster 2025-04-04 09:25:01 +02:00
parent 4de4aeac4b
commit 5ddd4ca12a
3 changed files with 87 additions and 0 deletions

Binary file not shown.

30
models/dsslogger.py Normal file
View File

@ -0,0 +1,30 @@
import logging
from odoo import api, fields, models, _
from odoo import tools
from .dss_settings import dssSettings
class OdooCustomLogger(logging.Logger):
dolog = True
"""
Custom Logger class for Odoo that overrides the info and warn methods.
"""
def setloging(self,dolog):
self.dolog = dolog
def info(self, msg, *args, **kwargs):
# Custom behavior for the info method
msg = f"[INFO - Custom]: {msg}"
if self.dolog:
# Log the message at the INFO level
super().info(msg, *args, **kwargs)
def warn(self, msg, *args, **kwargs):
# Custom behavior for the warn method
msg = f"[WARN - Custom]: {msg}"
# super().warning(msg, *args, **kwargs) # Use `warning` instead of `warn` (deprecated in Python 3)
# settings = dssSettings.search(dssSettings,domain=[],limit=1)
# showdebug= settings.showdebug
if self.dolog:
# Log the message at the INFO level
super().info(msg, *args, **kwargs)

57
views/dss_m2mmail_views.xml Executable file
View File

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="action_dss_main_m2mmail" model="ir.actions.act_window">
<field name="name">DigitalSignage Alle M2M Nachrichten</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">dss.m2mmail</field>
<field name="view_mode">tree,form</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No Contracts/Clients found. Let's create one!
</p>
<p>
Keep track of the progress of your contracts from creation to completion.<br/>
Collaborate efficiently by chatting in real-time or via email.
</p>
</field>
</record>
<record id="dss_main_m2mmail_tree" model="ir.ui.view">
<field name="name">dss_m2mmail_tree</field>
<field name="model">dss.m2mmail</field>
<field name="priority" eval="17"/>
<field name="arch" type="xml">
<tree string="Vertragsuebersicht">
<field name="uuid"/>
<field name="analyzed" widget="boolean_toggle"/>
<field name="project_id"/>
<field name="project"/>
</tree>
</field>
</record>
<record id="dss_main_m2mmail_form" model="ir.ui.view">
<field name="name">dss_main_m2mmail_form</field>
<field name="model">dss.m2mmail</field>
<field eval="2" name="priority"/>
<field name="arch" type="xml">
<form>
<sheet>
<group name="interval" string="Intervaldaten">
<field name="uuid"/>
<field name="analyzed" widget="boolean_toggle"/>
<field name="project_id"/>
<field name="project" readonly="1"/>
</group>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" options="{'post_refresh':True}" help="Follow this project to automatically track the events associated to tasks and issues of this project." groups="base.group_user"/>
<field name="activity_ids"/>
<field name="message_ids"/>
</div>
</form>
</field>
</record>
</odoo>