Transport 1

This commit is contained in:
jopster
2025-04-04 09:20:26 +02:00
parent 894d428c04
commit 4de4aeac4b
287 changed files with 145 additions and 137 deletions
+1 -1
View File
@@ -45,7 +45,7 @@
'views/dss_zahlungen.xml', 'views/dss_zahlungen.xml',
'views/dss_web_contracts.xml', 'views/dss_web_contracts.xml',
'views/dss_invoices.xml', 'views/dss_invoices.xml',
'views/dss_m2mmail.xml', 'views/dss_m2mmail_views.xml',
'views/mainsystem_view.xml', 'views/mainsystem_view.xml',
'views/dss_importinvoicelist.xml', 'views/dss_importinvoicelist.xml',
'views/menu.xml', 'views/menu.xml',
View File
Regular → Executable
View File
Regular → Executable
View File
BIN
View File
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
+1 -1
View File
@@ -27,4 +27,4 @@ from . import dss_invoices
from . import dss_importinvoicelist from . import dss_importinvoicelist
from . import dss_web_contracts from . import dss_web_contracts
from . import dss_m2mmail from . import dss_m2mmail
from . import dsslogger
Binary file not shown.
View File
BIN
View File
Binary file not shown.
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
View File
View File
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
View File
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
View File
View File
View File
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Regular → Executable
View File
Regular → Executable
View File
+3
View File
@@ -8,6 +8,7 @@ import datetime
import json import json
import re import re
import uuid import uuid
from .dsslogger import OdooCustomLogger
import logging import logging
import base64 import base64
import subprocess import subprocess
@@ -31,6 +32,8 @@ from tuya_connector import TuyaOpenAPI, TUYA_LOGGER
import sys import sys
TUYA_LOGGER.setLevel(logging.DEBUG) TUYA_LOGGER.setLevel(logging.DEBUG)
# logging.setLoggerClass(OdooCustomLogger)
_logger = logging.getLogger(__name__) _logger = logging.getLogger(__name__)
class dsscontracts(models.Model): class dsscontracts(models.Model):
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
+40
View File
@@ -1,15 +1,55 @@
import uuid import uuid
import logging
from odoo import api, fields, models, _ from odoo import api, fields, models, _
from odoo import tools from odoo import tools
_logger = logging.getLogger(__name__)
class dssm2mvalues(models.Model): class dssm2mvalues(models.Model):
@api.model
def analyze_emails(self):
# Prüfe, ob der Datensatz ein Email-Objekt ist
email_text = self.website_message_ids.body
# Prüfe, ob der Text "ProjektID:" enthält
if "ProjektID:" in email_text:
# Finde die Position von "ProjektID:"
pos = email_text.find("ProjektID:")
_logger.info("Import M2M Emails - Get ID. File - Message : pos "+str(pos))
# Extrahiere die nächsten 3 Ziffern
project_id = email_text[pos + 11:pos + 14].strip()
self.project_id = project_id
self.analyzed = True
@api.model
def create(self, vals):
result = super(dssm2mvalues, self).create(vals)
settings = self.env['dss.settings'].search([],limit=1)
cron_job = settings.m2mcron
if cron_job:
_logger.info("Import M2M Emails - Create - Cron activating : "+str(cron_job))
cron_job._trigger()
return result
_name = "dss.m2mmail" _name = "dss.m2mmail"
_description = "DigitalSignage M2M Rückmeldungen" _description = "DigitalSignage M2M Rückmeldungen"
# _rec_name = "statusname" # _rec_name = "statusname"
_inherit = ['mail.thread', 'mail.activity.mixin'] _inherit = ['mail.thread', 'mail.activity.mixin']
uuid = fields.Char(default=lambda self: self._default_uuid(), required=True, readonly=True, copy=False, string='UUID') uuid = fields.Char(default=lambda self: self._default_uuid(), required=True, readonly=True, copy=False, string='UUID')
analyzed = fields.Boolean('Analysiert', default=False, tracking=True)
project_id = fields.Char(string='Projekt-ID',tracking=True)
project = fields.Many2one('dss.projects', string='Projekt', compute='_compute_project')
@api.depends('project_id')
def _compute_project(self):
self.project = False
for record in self:
if record.project_id:
project = self.env['dss.projects'].search([('projectid', '=', int(record.project_id))])
if project:
record.project = project
# ... andere Methoden ...
@api.model @api.model
def _default_uuid(self): def _default_uuid(self):
return str(uuid.uuid4()) return str(uuid.uuid4())
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
+6 -1
View File
@@ -2,8 +2,9 @@ import ast
import datetime import datetime
import json import json
import re import re
import uuid from .dsslogger import OdooCustomLogger
import logging import logging
import uuid
import base64 import base64
import subprocess import subprocess
import tempfile import tempfile
@@ -31,10 +32,14 @@ from tuya_connector import TuyaOpenAPI, TUYA_LOGGER
import sys import sys
TUYA_LOGGER.setLevel(logging.DEBUG) TUYA_LOGGER.setLevel(logging.DEBUG)
logging.setLoggerClass(OdooCustomLogger)
_logger = logging.getLogger(__name__) _logger = logging.getLogger(__name__)
class dssprojects(models.Model): class dssprojects(models.Model):
_name = "dss.projects" _name = "dss.projects"
_description = "DigitalSignage Projekte" _description = "DigitalSignage Projekte"
_rec_name = "projektname" _rec_name = "projektname"
Regular → Executable
View File
Regular → Executable
View File
+2 -1
View File
@@ -61,7 +61,8 @@ class dssSettings(models.Model):
rporturl = fields.Char('RPort URL',tracking=True) rporturl = fields.Char('RPort URL',tracking=True)
rportusername = fields.Char('RPort Username',tracking=True) rportusername = fields.Char('RPort Username',tracking=True)
rporttoken = fields.Char('RPort API Token',tracking=True) rporttoken = fields.Char('RPort API Token',tracking=True)
showdebug = fields.Boolean('Debug',help='Debug Informationen aktivieren ',tracking=True)
m2mcron = fields.Many2one('ir.cron',string='M2M Cron',tracking=True)
def _get_settingvalue(self,valuename): def _get_settingvalue(self,valuename):
settings = (self.env['dss.settings'].search([],limit=1)) settings = (self.env['dss.settings'].search([],limit=1))
Regular → Executable
+77 -76
View File
@@ -138,91 +138,92 @@ class dsstriggergroups(models.Model):
def run_triggers(self, changes, Dataset, triggers): def run_triggers(self, changes, Dataset, triggers):
_logger.info("Trigger in run_triggers ! - start count :"+str(len(triggers)) ) _logger.info("Trigger in run_triggers ! - start count :"+str(len(triggers)) )
for trig in triggers: for trig in triggers:
_logger.info("Trigger in run_triggers - Working on : "+str(trig.triggername)+'('+str(trig.id)+')') if trig.trigger_active:
dochecktrigger = False _logger.info("Trigger in run_triggers - Working on : "+str(trig.triggername)+'('+str(trig.id)+')')
dochecktrigger = False
if (changes == False): if (changes == False):
dochecktrigger = True dochecktrigger = True
elif (trig.triggertyp == "COND"): elif (trig.triggertyp == "COND"):
dochecktrigger = True
else:
if (trig.trigger_field.name in changes):
dochecktrigger = True dochecktrigger = True
if (dochecktrigger):
isinintitable = self.env['dss.triggermodel.execute'].search(['&',('trigger','=',trig.id),('data_uuid','=',Dataset.uuid)])
dotrigger = False
if (not isinintitable) and trig.trigger_init_trigger:
_logger.info("Trigger in run_triggers - first run and allowed : "+str(isinintitable)+' -> '+str(trig.trigger_init_trigger)+' -> '+str(trig))
dotrigger = True
elif (not isinintitable) and ((not trig.trigger_init_trigger) and (not trig.trigger_onlyinit_trigger)):
_logger.info("Trigger in run_triggers - first run but not allowed : "+str(isinintitable)+' -> '+str(trig.trigger_init_trigger)+' -> '+str(trig))
dotrigger = False
elif (isinintitable) and trig.trigger_onlyinit_trigger:
_logger.info("Trigger in run_triggers - not first run but only first: "+str(isinintitable)+' -> '+str(trig.trigger_onlyinit_trigger)+' -> '+str(trig))
dotrigger = False
else: else:
_logger.info("Trigger in run_triggers - not first run but only first: "+str(isinintitable)+' -> '+str(trig)) if (trig.trigger_field.name in changes):
dotrigger = True dochecktrigger = True
if dotrigger: if (dochecktrigger):
fieldname = trig.trigger_value_field.name isinintitable = self.env['dss.triggermodel.execute'].search(['&',('trigger','=',trig.id),('data_uuid','=',Dataset.uuid)])
_logger.info("Trigger in run_triggers - checking conditions : "+str(trig.triggertyp)+" field : "+str(fieldname)+' -> '+str(trig.trigger_value_field)) dotrigger = False
if (trig.triggertyp == "FIELD_B"): if (not isinintitable) and trig.trigger_init_trigger:
Wert = Dataset[fieldname] _logger.info("Trigger in run_triggers - first run and allowed : "+str(isinintitable)+' -> '+str(trig.trigger_init_trigger)+' -> '+str(trig))
_logger.info("Trigger in run_triggers - Boolean check : "+str(Dataset[fieldname])+" vs "+str(Wert)+' -> '+str(trig.trigger_value_Bool)) dotrigger = True
if trig.trigger_value_Bool: elif (not isinintitable) and ((not trig.trigger_init_trigger) and (not trig.trigger_onlyinit_trigger)):
if Wert: _logger.info("Trigger in run_triggers - first run but not allowed : "+str(isinintitable)+' -> '+str(trig.trigger_init_trigger)+' -> '+str(trig))
_logger.info("Trigger in run_triggers - value true - specific value found : "+str(changes)+" ("+str(Wert)+') -> '+str(trig.trigger_value_Bool))
dotrigger = True
else:
_logger.info("Trigger in run_triggers - value true - specific value not found : "+str(changes)+" ("+str(Wert)+') -> '+str(trig.trigger_value_Bool))
dotrigger = False
else:
if Wert:
_logger.info("Trigger in run_triggers - value False - specific value found : "+str(changes)+" ("+str(Wert)+') -> '+str(trig.trigger_value_Bool))
dotrigger = False
else:
_logger.info("Trigger in run_triggers - value False - specific value not found : "+str(changes)+" ("+str(Wert)+') -> '+str(trig.trigger_value_Bool))
dotrigger = True
elif (trig.triggertyp == "FIELD_S"):
#Wert= self.env[trig.trigger_table.model].get(fieldname)
WertDB = self.env[trig.trigger_table.model].search([('id', '=', Dataset.id)])
field = WertDB._fields[fieldname]
field_type = field.type
Wert = ""
if field_type=="many2one":
Wert = str(Dataset[fieldname].id)
# Dataset[fieldname].model
# SubWertDB = self.env[].search([('id', '=', field.id)])
# Wert = SubWertDB.id
if field_type=="char":
Wert = str(Dataset[fieldname])
_logger.info("Trigger in run_triggers - specific value : "+str(changes)+" ("+str(Wert)+') -> '+str(trig.trigger_value)+' - '+str(field)+' / '+str(field_type))
if (str(Wert) == str(trig.trigger_value)):
_logger.info("Trigger in run_triggers - specific value found : "+str(changes)+" ("+str(Wert)+') -> '+str(trig.trigger_value))
dotrigger = True
else:
_logger.info("Trigger in run_triggers - specific value not found : "+str(changes)+" ("+str(Wert)+') -> '+str(trig.trigger_value))
dotrigger = False
elif (trig.triggertyp == "FIELD_K"):
dotrigger = False dotrigger = False
elif (trig.triggertyp == "MANUAL"): elif (isinintitable) and trig.trigger_onlyinit_trigger:
_logger.info("Trigger in run_triggers - not first run but only first: "+str(isinintitable)+' -> '+str(trig.trigger_onlyinit_trigger)+' -> '+str(trig))
dotrigger = False dotrigger = False
elif (trig.triggertyp == "COND"): else:
_logger.info("Trigger in run_triggers - not first run but only first: "+str(isinintitable)+' -> '+str(trig))
dotrigger = True dotrigger = True
if trig.trigger_plus_conditions and dotrigger: if dotrigger:
runtrigger = True fieldname = trig.trigger_value_field.name
for SingleC in trig.trigger_conditions: _logger.info("Trigger in run_triggers - checking conditions : "+str(trig.triggertyp)+" field : "+str(fieldname)+' -> '+str(trig.trigger_value_field))
_logger.info("Trigger in run_triggers - Multible Conditions found "+str(trig.trigger_conditions)+' -> '+str(SingleC)+' -> '+str(runtrigger)) if (trig.triggertyp == "FIELD_B"):
runtrigger = SingleC.trigger_CheckCond(Dataset,SingleC) and runtrigger Wert = Dataset[fieldname]
else: _logger.info("Trigger in run_triggers - Boolean check : "+str(Dataset[fieldname])+" vs "+str(Wert)+' -> '+str(trig.trigger_value_Bool))
runtrigger = dotrigger if trig.trigger_value_Bool:
if Wert:
_logger.info("Trigger in run_triggers - value true - specific value found : "+str(changes)+" ("+str(Wert)+') -> '+str(trig.trigger_value_Bool))
dotrigger = True
else:
_logger.info("Trigger in run_triggers - value true - specific value not found : "+str(changes)+" ("+str(Wert)+') -> '+str(trig.trigger_value_Bool))
dotrigger = False
else:
if Wert:
_logger.info("Trigger in run_triggers - value False - specific value found : "+str(changes)+" ("+str(Wert)+') -> '+str(trig.trigger_value_Bool))
dotrigger = False
else:
_logger.info("Trigger in run_triggers - value False - specific value not found : "+str(changes)+" ("+str(Wert)+') -> '+str(trig.trigger_value_Bool))
dotrigger = True
elif (trig.triggertyp == "FIELD_S"):
#Wert= self.env[trig.trigger_table.model].get(fieldname)
WertDB = self.env[trig.trigger_table.model].search([('id', '=', Dataset.id)])
field = WertDB._fields[fieldname]
field_type = field.type
Wert = ""
if field_type=="many2one":
Wert = str(Dataset[fieldname].id)
# Dataset[fieldname].model
# SubWertDB = self.env[].search([('id', '=', field.id)])
# Wert = SubWertDB.id
if field_type=="char":
Wert = str(Dataset[fieldname])
_logger.info("Trigger in run_triggers - specific value : "+str(changes)+" ("+str(Wert)+') -> '+str(trig.trigger_value)+' - '+str(field)+' / '+str(field_type))
if (str(Wert) == str(trig.trigger_value)):
_logger.info("Trigger in run_triggers - specific value found : "+str(changes)+" ("+str(Wert)+') -> '+str(trig.trigger_value))
dotrigger = True
else:
_logger.info("Trigger in run_triggers - specific value not found : "+str(changes)+" ("+str(Wert)+') -> '+str(trig.trigger_value))
dotrigger = False
elif (trig.triggertyp == "FIELD_K"):
dotrigger = False
elif (trig.triggertyp == "MANUAL"):
dotrigger = False
elif (trig.triggertyp == "COND"):
dotrigger = True
if runtrigger: if trig.trigger_plus_conditions and dotrigger:
execds = '' runtrigger = True
self.trigger_run(trig,Dataset,isinintitable,execds) for SingleC in trig.trigger_conditions:
_logger.info("Trigger in run_triggers - Multible Conditions found "+str(trig.trigger_conditions)+' -> '+str(SingleC)+' -> '+str(runtrigger))
runtrigger = SingleC.trigger_CheckCond(Dataset,SingleC) and runtrigger
else:
runtrigger = dotrigger
if runtrigger:
execds = ''
self.trigger_run(trig,Dataset,isinintitable,execds)
def trigger_run(self,trig,Dataset,isinintitable,execds): def trigger_run(self,trig,Dataset,isinintitable,execds):
for akt in trig.trigger_aktionen: for akt in trig.trigger_aktionen:
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

View File
View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File
View File
View File
View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Regular → Executable
View File
View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Regular → Executable
View File
View File
Regular → Executable
View File

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Regular → Executable
View File

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Regular → Executable
View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Regular → Executable
View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Regular → Executable
View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Regular → Executable
View File

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

Some files were not shown because too many files have changed in this diff Show More