Update file init_test.py
This commit is contained in:
@@ -10,24 +10,24 @@ import odoo
|
|||||||
import requests
|
import requests
|
||||||
|
|
||||||
|
|
||||||
def get_external_content():
|
|
||||||
response = requests.get('http://localhost:8025')
|
|
||||||
return response.text
|
|
||||||
|
|
||||||
class CustomModel(models.Model):
|
class CustomModel(models.Model):
|
||||||
_name = 'testserver_o2b.testserver_o2b'
|
_name = 'testserver_o2b.testserver_o2b'
|
||||||
_description = 'Mailcatcher'
|
_description = 'Mailcatcher'
|
||||||
|
|
||||||
#html_field = fields.Html('HTML Field')
|
html_field = fields.Html('HTML Field')
|
||||||
external_content = fields.Text('Externe Inhoud')
|
external_content = fields.Text('Externe Inhoud')
|
||||||
external_content = get_external_content()
|
external_content = get_external_content()
|
||||||
self.write({'external_content': external_content})
|
self.write({'external_content': external_content})
|
||||||
|
|
||||||
@api.model
|
def get_external_content():
|
||||||
def action_refresh_mailhog(self):
|
response = requests.get('http://localhost:8025')
|
||||||
external_content = get_external_content()
|
return response.text
|
||||||
self.write({'external_content': external_content})
|
|
||||||
raise ValidationError("De Actie action_refresh_mailhog is uitgevoerd...")
|
# @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...")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user