[FIX] internal error
This commit is contained in:
parent
322a4e9494
commit
59888f1407
@ -1,9 +1,11 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
import io
|
||||||
|
|
||||||
import math
|
import math
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
from docxtpl import DocxTemplate
|
from docxtpl import DocxTemplate
|
||||||
|
|
||||||
from odoo import api, fields, models
|
from odoo import api, fields, models
|
||||||
from odoo.tools.config import config
|
from odoo.tools.config import config
|
||||||
from pytils import numeral
|
from pytils import numeral
|
||||||
@ -512,8 +514,10 @@ class ContractWizard(models.TransientModel):
|
|||||||
context = self._generate_context()
|
context = self._generate_context()
|
||||||
doc = DocxTemplate(full_path)
|
doc = DocxTemplate(full_path)
|
||||||
doc.render(context)
|
doc.render(context)
|
||||||
doc.save('tmp.docx')
|
stream = io.BytesIO()
|
||||||
return open('tmp.docx', 'rb').read()
|
doc.save(stream)
|
||||||
|
stream.seek(0)
|
||||||
|
return stream
|
||||||
|
|
||||||
def get_docx_contract(self):
|
def get_docx_contract(self):
|
||||||
return {
|
return {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user