beta ready for trest
This commit is contained in:
parent
4575eb773c
commit
98556d2459
@ -2,16 +2,19 @@
|
|||||||
"name": "DOCX report",
|
"name": "DOCX report",
|
||||||
"summary": """Printing reports in docx format from docx templates.""",
|
"summary": """Printing reports in docx format from docx templates.""",
|
||||||
"description": """
|
"description": """
|
||||||
Adds docx reports printing from docx templates like standard Odoo reports
|
Adds generation reports from .docx templates like standard Odoo reports
|
||||||
with qweb templates. Standard Odoo reports also available.
|
with qweb templates. Standard Odoo reports also available.
|
||||||
For generating pdf from docx external service the "gotenberg" is used.
|
For generating .pdf from .docx external service the "Gotenberg" is used,
|
||||||
It should work at the same server as Odoo app. If "gotenberg" absent, there
|
and it required module for integration with this service: "gotenberg".
|
||||||
will be only reports in docx format.
|
If integration module "gotenberg" is absent, or service itself unreachable
|
||||||
|
there will be only reports in docx format.
|
||||||
|
|
||||||
|
This is the beta version, bugs may be present.
|
||||||
""",
|
""",
|
||||||
"author": "RYDLAB",
|
"author": "RYDLAB",
|
||||||
"website": "http://rydlab.ru",
|
"website": "http://rydlab.ru",
|
||||||
"category": "Technical",
|
"category": "Technical",
|
||||||
"version": "0.0.1",
|
"version": "0.8.1",
|
||||||
"depends": ["base", "web", "custom_report_field", "report_monetary_helpers"],
|
"depends": ["base", "web", "custom_report_field", "report_monetary_helpers"],
|
||||||
"external_dependencies": {"python": ["docxcompose", "docxtpl"]},
|
"external_dependencies": {"python": ["docxcompose", "docxtpl"]},
|
||||||
"data": [
|
"data": [
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
from json import dumps as json_dumps, loads as json_loads
|
from json import dumps as json_dumps, loads as json_loads
|
||||||
from logging import getLogger
|
|
||||||
|
|
||||||
from werkzeug.urls import url_decode
|
from werkzeug.urls import url_decode
|
||||||
|
|
||||||
from odoo.http import (
|
from odoo.http import (
|
||||||
@ -14,8 +12,6 @@ from odoo.tools.safe_eval import safe_eval, time
|
|||||||
|
|
||||||
from odoo.addons.web.controllers.main import ReportController
|
from odoo.addons.web.controllers.main import ReportController
|
||||||
|
|
||||||
_logger = getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
class DocxReportController(ReportController):
|
class DocxReportController(ReportController):
|
||||||
@route()
|
@route()
|
||||||
@ -44,7 +40,6 @@ class DocxReportController(ReportController):
|
|||||||
"Content-Type",
|
"Content-Type",
|
||||||
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
||||||
),
|
),
|
||||||
# ("Content-Length", len(docx)),
|
|
||||||
]
|
]
|
||||||
return request.make_response(docx, headers=docxhttpheaders)
|
return request.make_response(docx, headers=docxhttpheaders)
|
||||||
elif converter == "pdf" and "docx" in report.report_type:
|
elif converter == "pdf" and "docx" in report.report_type:
|
||||||
|
@ -39,6 +39,7 @@ odoo.define("docx_report.ReportActionManager", function (require) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Этот метод вызывается при нажатии на пункт меню для печати отчета.
|
* Этот метод вызывается при нажатии на пункт меню для печати отчета.
|
||||||
*
|
*
|
||||||
@ -71,6 +72,7 @@ odoo.define("docx_report.ReportActionManager", function (require) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Генерирует URL для запроса отчета
|
* Генерирует URL для запроса отчета
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user