Update 2 files

- /testserver_o2b/models/init_test.py
- /testserver_o2b/views/views.xml
This commit is contained in:
2023-11-06 08:47:03 +00:00
parent 5683efd3a9
commit 042d8f279d
2 changed files with 21 additions and 2 deletions

View File

@@ -7,12 +7,28 @@ _logger = logging.getLogger(__name__)
import os
import uuid
import odoo
import requests
def get_external_content():
response = requests.get('http://localhost:8025')
return response.text
class CustomModel(models.Model):
_name = 'testserver_o2b.testserver_o2b'
_description = 'Mailcatcher'
html_field = fields.Html('HTML Field')
#html_field = fields.Html('HTML Field')
external_content = fields.Text('Externe Inhoud')
external_content = get_external_content()
self.write({'external_content': external_content})
@api.model
def action_refresh_mailhog(self):
external_content = get_external_content()
self.write({'external_content': external_content})
raise ValidationError("De Actie action_refresh_mailhog is uitgevoerd...")
class IrLogging(models.Model):