Skip to content
Snippets Groups Projects
Commit cb818a67b18a authored by Vincent Hatakeyama's avatar Vincent Hatakeyama
Browse files

:hammer: Move constant converter to converter module

parent 67ee5bf267c3
No related branches found
Tags 11.0.2.8.0
1 merge request!7🔨 Move constant converter to converter module
[converter]
pulluri = https://orus.io/xcg/odoo-modules/converter
layout = ../converter
track = 4b756e534cfb4f5a4dfe3398a6efda9f1e1ceccf
track = f63a04ec1f46403bcc52890435e7bdb97081c33e
expand =
\ No newline at end of file
......@@ -2,6 +2,11 @@
NEWS
====
13.0.3.0.0
==========
Move constant converter to converter module.
13.0.2.0.1
==========
......
......@@ -21,7 +21,7 @@
"name": "Redner",
"summary": """
Allows to generate transactional emails and documents in PDF or HTML format""",
"version": "13.0.2.0.1",
"version": "13.0.3.0.0",
"category": "Technical",
"author": "XCG Consulting",
"website": "http://odoo.consulting/",
......
......@@ -21,7 +21,7 @@
reportname=reportname,
docids=docids,
converter=converter,
**data
**data,
)
context = dict(request.env.context)
......
......@@ -41,13 +41,3 @@
mimetype = guess_mimetype(content)
return "data:%s;base64,%s" % (mimetype, value.decode("ascii"))
class Constant(Converter):
def __init__(self, value):
self.value = value
def odoo_to_message(
self, instance: models.Model, ctx: Optional[Dict] = None
) -> Any:
return self.value
......@@ -230,7 +230,7 @@
res = self.master.call(
"v1/template/%s/%s" % (self.master.account, template_id),
http_verb="put",
**params
**params,
)
return res["name"]
......
......@@ -3,7 +3,7 @@
from odoo.addons import converter
from ..converter import Constant, ImageDataURL, ImageFile
from ..converter import ImageDataURL, ImageFile
class Substitution(models.Model):
......@@ -64,7 +64,7 @@
elif sub.converter == "mail_template+deserialize":
conv = converter.MailTemplate(sub.value, True)
elif sub.converter == "constant":
conv = Constant(sub.value)
conv = converter.Constant(sub.value)
elif sub.converter == "field":
if "." in sub.value:
path, name = sub.value.rsplit(".", 1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment