Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

9.0 Migrate report_custom_filename #52

Closed

Conversation

sla-subteno-it
Copy link

Hello,

I migrated report_custom_filename in v9 but I used the same format of attachement field instead of mako template.

'object': objects[:1],
'ext': report.report_type.replace('qweb-', ''),
})
generated_filename = eval(report.download_filename, {'object': objects, 'time': time})
Copy link

@Garamotte Garamotte May 10, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should use from openerp.tools.safe_eval import safe_eval instead of eval.

@sla-subteno-it sla-subteno-it force-pushed the 9.0-migrate-report_custom_filename branch from 58aa429 to 43ba075 Compare May 10, 2016 16:12
@coveralls
Copy link

coveralls commented May 10, 2016

Coverage Status

Coverage decreased (-1.7%) to 41.176% when pulling 43ba075 on syleam:9.0-migrate-report_custom_filename into da1e961 on OCA:9.0.

@pedrobaeza pedrobaeza mentioned this pull request May 10, 2016
7 tasks
@pedrobaeza
Copy link
Member

Your migration is ripping out the basic things of the module, so the fail in Travis is expected. Are you sure this is working?

@sla-subteno-it sla-subteno-it force-pushed the 9.0-migrate-report_custom_filename branch from 43ba075 to db108e4 Compare May 10, 2016 19:47
@coveralls
Copy link

coveralls commented May 10, 2016

Coverage Status

Coverage decreased (-1.7%) to 41.176% when pulling db108e4 on syleam:9.0-migrate-report_custom_filename into da1e961 on OCA:9.0.

@andreparames
Copy link

👍 I've tested this PR and seems to work fine, at least for the regular use case (document → print). Not sure if the removed controller is needed for some other use case, but Travis seems to be fine now.

'object': objects[:1],
'ext': report.report_type.replace('qweb-', ''),
})
generated_filename = safe_eval(report.download_filename,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

safe_eval uses Python syntax, not Jinja2 syntax, so it changes from the way Odoo parses this in the attachments.

@ovnicraft
Copy link
Member

any updates ?
just for the record if wkhtmltopdf is not installed, this module return a html file with pdf extension, but i think need a bug report.

Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a pending comment from my part

@pedrobaeza
Copy link
Member

Closing as there's no answer.

@pedrobaeza pedrobaeza closed this Dec 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants