Skip to content

[14.0] [FIX] Fix base comment template rendering.#574

Merged
OCA-git-bot merged 1 commit into
OCA:14.0from
NextERP-Romania:14.0-fix-base_comment_template
May 30, 2022
Merged

[14.0] [FIX] Fix base comment template rendering.#574
OCA-git-bot merged 1 commit into
OCA:14.0from
NextERP-Romania:14.0-fix-base_comment_template

Conversation

@feketemihai
Copy link
Copy Markdown
Member

The template comments are loaded in report with t t-raw, which is not allowing a double rendering if we have some dynamic content in the templates, so with this pr, we are allowing dynamic content in comment templates.

I will create PR for reports with the new method in t-raw.

@feketemihai
Copy link
Copy Markdown
Member Author

@petrus-v I just saw your PR (#495), can you review this one if you have time.
Also @victoralmau @pedrobaeza

@pedrobaeza pedrobaeza added this to the 14.0 milestone Jan 11, 2022
Copy link
Copy Markdown
Contributor

@petrus-v petrus-v left a comment

Choose a reason for hiding this comment

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

This is a great addition to be able to use rendering engine in templates, could you add a note in the module description to tell which rendering engine are supported and eventually how to use it !

thanks

Comment thread base_comment_template/models/comment_template.py Outdated
Comment thread base_comment_template/models/comment_template.py Outdated
Comment thread base_comment_template/tests/test_base_comment_template.py
@feketemihai feketemihai force-pushed the 14.0-fix-base_comment_template branch from 16f74c5 to 7fcf8d4 Compare April 11, 2022 11:51
@feketemihai
Copy link
Copy Markdown
Member Author

@petrus-v I updated the code, i also added a preview button in comments (that's why the tests percentage is smaller).

@elvise
Copy link
Copy Markdown

elvise commented Apr 30, 2022

@petrus-v any chance for this PR ?

Copy link
Copy Markdown

@GSLabIt GSLabIt left a comment

Choose a reason for hiding this comment

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

LGTM

@GSLabIt
Copy link
Copy Markdown

GSLabIt commented May 16, 2022

@feketemihai can you please rebase?

@feketemihai feketemihai force-pushed the 14.0-fix-base_comment_template branch from 7982290 to 9931623 Compare May 17, 2022 13:56
@feketemihai
Copy link
Copy Markdown
Member Author

@feketemihai can you please rebase?

@GSLabIt Done.

@feketemihai feketemihai requested a review from petrus-v May 18, 2022 07:06
Copy link
Copy Markdown

@elvise elvise left a comment

Choose a reason for hiding this comment

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

LGTM!

@francesco-ooops
Copy link
Copy Markdown
Contributor

francesco-ooops commented May 27, 2022

@petrus-v do you have some time to take a look?

or anyone at @OCA/reporting-engine-maintainers

thanks :)

Copy link
Copy Markdown
Contributor

@petrus-v petrus-v left a comment

Choose a reason for hiding this comment

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

Sorry to be slow on review.... Thanks to taken care my points.

@francesco-ooops
Copy link
Copy Markdown
Contributor

Sorry to be slow on review.... Thanks to taken care my points.

great! @OCA/reporting-engine-maintainers can we merge?

@HviorForgeFlow
Copy link
Copy Markdown
Member

/ocabot merge major

@OCA-git-bot
Copy link
Copy Markdown
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 14.0-ocabot-merge-pr-574-by-HviorForgeFlow-bump-major, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit a4adf37 into OCA:14.0 May 30, 2022
@OCA-git-bot
Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at 356816f. Thanks a lot for contributing to OCA. ❤️

@api.depends("model_id")
def _compute_no_record(self):
for preview in self:
domain = safe_eval(self.base_comment_template_id.domain)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Wrong use of self apparently. This probably works only because you (almost) never loop on more than one wizard

):
wizard.body = wizard.resource_ref.with_context(
lang=wizard.lang
).render_comment(self.base_comment_template_id, engine=wizard.engine)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same

@francesco-ooops
Copy link
Copy Markdown
Contributor

@feketemihai could you address @simahawk remarks?

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.

9 participants