[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
|
||||
|
@ -4,7 +4,6 @@ import math
|
||||
from datetime import datetime
|
||||
|
||||
from odoo import api, fields, models
|
||||
from odoo.tools.config import config
|
||||
from pytils import numeral
|
||||
|
||||
from ..utils.docxtpl import get_document_from_values_stream
|
||||
@ -503,11 +502,9 @@ class ContractWizard(models.TransientModel):
|
||||
return context
|
||||
|
||||
def get_docx_contract(self):
|
||||
path_to_template = "{}/filestore/{}/{}".format(
|
||||
config.get("data_dir"),
|
||||
config.get("db_name"),
|
||||
self.template.attachment_id.store_fname
|
||||
)
|
||||
template = self.template.attachment_id
|
||||
path_to_template = template._full_path(template.store_fname)
|
||||
|
||||
fields = self._generate_context()
|
||||
|
||||
binary_data = get_document_from_values_stream(
|
||||
|
Loading…
x
Reference in New Issue
Block a user