mirror of
https://github.com/bringout/odoomates.git
synced 2026-04-19 09:12:08 +02:00
Fix PDF filename for data-driven wizard reports
Override report_download controller to evaluate print_report_name
for wizard reports where Odoo 16 JS passes active_ids in context
query params instead of URL path. Use report.name field for
translated base filename instead of _() which fails in safe_eval.
🤖 assisted by claude
This commit is contained in:
parent
bb0a9f3925
commit
93c22b7e58
4 changed files with 314 additions and 1 deletions
|
|
@ -18,7 +18,11 @@ class AccountPartnerLedger(models.TransientModel):
|
|||
help="Show previous balance before the start date.")
|
||||
|
||||
def _get_report_base_filename(self):
|
||||
base = _('Partner Ledger').replace(' ', '_')
|
||||
report = self.env.ref(
|
||||
'accounting_pdf_reports.action_report_partnerledger',
|
||||
raise_if_not_found=False,
|
||||
)
|
||||
base = (report.name if report else _('Partner Ledger')).replace(' ', '_')
|
||||
if self.partner_ids:
|
||||
names = '_'.join(
|
||||
name.replace(' ', '_').replace('/', '_').replace('\\', '_')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue