Hi, i have problem with this JS
odoo.define('my_module.certification_template', function (require) {'use strict';
var Model = require('web.Model')
console.log('TESTTTTTTTTTTTTTTTTTTTTTTTTTT');
(new Model('certification.certification').call('get_field_certificate_template').then(function (get_field) {
var image_format = 'url("data:image/png;base64,'+ get_field + '")'
$(".certificate-img").css("background-image", image_format);
}));
});
Python
class Certification(models.Model):
_name = 'certification.certification'
_description = 'Certification'
cert_template = Binary Field
@api.model
def get_field_certificate_template(self):
for rec in self :
get_field = rec.cert_template
return get_field
QWEB
<div class="page certificate-img" style="border-collapse: collapse; page-break-after:always;">
<script type="text/javascript" src="/my_module/certification/certification_template.js"></script>
so i want trigger the javascript but when i print the template is nothing changed or console.log.
i don't know how to trigger this javascript