[IMP] better way to get full_path to template
This commit is contained in:
parent
e88e4c757f
commit
191f652273
@ -1,2 +1 @@
|
|||||||
from . import controllers
|
|
||||||
from . import models
|
from . import models
|
||||||
|
@ -4,7 +4,6 @@ import math
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
from odoo import api, fields, models
|
from odoo import api, fields, models
|
||||||
from odoo.tools.config import config
|
|
||||||
from pytils import numeral
|
from pytils import numeral
|
||||||
|
|
||||||
from ..utils.docxtpl import get_document_from_values_stream
|
from ..utils.docxtpl import get_document_from_values_stream
|
||||||
@ -503,11 +502,9 @@ class ContractWizard(models.TransientModel):
|
|||||||
return context
|
return context
|
||||||
|
|
||||||
def get_docx_contract(self):
|
def get_docx_contract(self):
|
||||||
path_to_template = "{}/filestore/{}/{}".format(
|
template = self.template.attachment_id
|
||||||
config.get("data_dir"),
|
path_to_template = template._full_path(template.store_fname)
|
||||||
config.get("db_name"),
|
|
||||||
self.template.attachment_id.store_fname
|
|
||||||
)
|
|
||||||
fields = self._generate_context()
|
fields = self._generate_context()
|
||||||
|
|
||||||
binary_data = get_document_from_values_stream(
|
binary_data = get_document_from_values_stream(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user