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

[IMP][8.0] Extract method in l10n_nl_xaf_auditfile_export #78

Merged
merged 1 commit into from May 30, 2017

Conversation

astirpe
Copy link
Member

@astirpe astirpe commented May 15, 2017

This PR is meant to simplify the way we can extend the auditfile template of module l10n_nl_xaf_auditfile_export.

Let's say I want to create a separate module to extend the auditfile template and, based on a certain condition, apply that extended template. For example, think about fixing issue #71 by creating a customized module.

In such cases, it would be very useful to have a simple method that can be easily extended, in order to retrieve the custom template.
This PR is a proposal to extract method def _get_auditfile_template() from the existing def button_generate().

Copy link
Member

@hbrunn hbrunn left a comment

Choose a reason for hiding this comment

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

from your code I understand that you need to pick a different template depending on values? Otherwise, I'd have suggested to make this a model method.

@astirpe
Copy link
Member Author

astirpe commented May 15, 2017

@hbrunn Yes, in my case the template is based on a field of the record. I need to read some values from the singleton self. That's why you notice the @api.multi decorator.

@hbrunn hbrunn merged commit b9741bc into OCA:8.0 May 30, 2017
@astirpe astirpe deleted the 80_imp_l10n_nl_xaf_auditfile_export branch May 30, 2017 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants