Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 20bfec2

Browse files
committedAug 25, 2024·
[IMP] sign_biometric_oca: Encrypt data
1 parent 31b348f commit 20bfec2

File tree

3 files changed

+7
-14
lines changed

3 files changed

+7
-14
lines changed
 

‎sign_biometric_oca/models/sign_oca_request.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ class SignOcaRequestSigner(models.Model):
1818
def _get_pdf_page_biometric(self, item, box):
1919
packet = BytesIO()
2020
can = canvas.Canvas(packet, pagesize=(box.getWidth(), box.getHeight()))
21-
if not item.get("value") or not item["value"].get("svg"):
21+
if not item.get("value"):
2222
return False
23-
drawing = svg2rlg(BytesIO(b64decode(item["value"]["svg"])))
23+
drawing = svg2rlg(BytesIO(b64decode(item["value"])))
2424
scaling_x = item["width"] / 100 * float(box.getWidth()) / drawing.width
2525
scaling_y = item["height"] / 100 * float(box.getHeight()) / drawing.height
2626

‎sign_biometric_oca/static/src/components/biometric.esm.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ import {registry} from "@web/core/registry";
66

77
const signatureSignOca = {
88
uploadSignature: function (parent, item, signatureItem, data) {
9-
item.value = data;
10-
console.log(item);
9+
item.value = data.svg;
10+
// TODO: Transform this in something more standard....
11+
parent.sensitiveData[item.id] = data.paths;
1112
parent.postIframeField(item);
1213
parent.checkFilledAll();
1314
var next_items = _.filter(

‎sign_biometric_oca/static/src/components/biometric_signature_dialog.xml

+2-10
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,10 @@
4040
</t>
4141

4242
<t t-name="sign_biometric_oca.sign_iframe_field_biometric_signature">
43-
<!--
44-
<svg class="o_sign_biometric_oca_display"
45-
style="width:100%;height:100%" >
46-
<t t-if="item.value.data">
47-
<path t-att-d="data" t-foreach="item.value.data" t-as="data" t-key="data_index" />
48-
</t>
49-
</svg>-->
50-
5143
<embed
5244
style="width:100%;height:100%"
53-
t-attf-src="data:image/svg+xml;base64,{{item.value.svg}}"
54-
t-if="item.value and item.value.svg"
45+
t-attf-src="data:image/svg+xml;base64,{{item.value}}"
46+
t-if="item.value"
5547
/>
5648
<div style="width:100%;height:100%" t-else="" t-out="placeholder" />
5749
</t>

0 commit comments

Comments
 (0)
Please sign in to comment.