mirror of
https://github.com/OCA/report-print-send.git
synced 2025-02-16 07:11:31 +02:00
[IMP] base_report_to_printer: Fix XMLRPC calls and tests
- When added the patch to be able to configure report copies by report object, the expected signature changed to expect a report object. That can't work through the XMLRPC interface, so we revert it to what it was before: expecting the report name. - Some tests that were producing warnings are muted now. - The tests that had been changed went back to normal too. - Current implementation didn't produce the expected results when actually forcing to print 1 copy. - Added a demo report to test, since searching the database for the 1st unkonwn report found is not very deterministic and can lead to problems, like those addressed in #122 and #123. - Finally, this update requires a database upgrade, so I pushed correctly the manifest version too.
This commit is contained in:
committed by
Jairo Llopis
parent
a946a2a570
commit
3eb0c70acb
@@ -20,7 +20,11 @@ class Report(models.Model):
|
||||
raise exceptions.Warning(
|
||||
_('No printer configured to print this report.')
|
||||
)
|
||||
return printer.print_document(report, document, report.report_type)
|
||||
return printer.print_document(
|
||||
report_name,
|
||||
document,
|
||||
report.report_type,
|
||||
)
|
||||
|
||||
@api.multi
|
||||
def _can_print_report(self, behaviour, printer, document):
|
||||
@@ -51,6 +55,6 @@ class Report(models.Model):
|
||||
can_print_report = self._can_print_report(behaviour, printer, document)
|
||||
|
||||
if can_print_report:
|
||||
printer.print_document(report, document, report.report_type)
|
||||
printer.print_document(report_name, document, report.report_type)
|
||||
|
||||
return document
|
||||
|
||||
Reference in New Issue
Block a user