Add record name in report filename

issue9509
review306161002
This commit is contained in:
Abraham Cabezas committed 2020-09-24 09:51:09 +02:00
1 parent bfd07fffef
commit fb7516ddb1
2 files changed
+7 -1

No files matched your search

+1
View File
@@ -1,3 +1,4 @@
* Add record name in report filename
* Add deletable and writable state from ir.rule to read
* Add language attribute to data tag
* Add e-mail template
+6 -1
View File
@@ -174,7 +174,12 @@ class Report(URLMixin, PoolBase):
oext, content = cls._execute(records, data, action_report)
if not isinstance(content, str):
content = bytearray(content) if bytes == str else bytes(content)
return (oext, content, action_report.direct_print, action_report.name)
suffix = '-'.join(r.rec_name for r in records[:5])
if len(records) > 5:
suffix += '__' + str(len(records[5:]))
report_name = '%s-%s' % (action_report.name, suffix)
return (oext, content, action_report.direct_print, report_name)
@classmethod
def _execute(cls, records, data, action):