-
-
Notifications
You must be signed in to change notification settings - Fork 587
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
[11][MIG] email_template_qweb: Migration to 11.0 #250
Conversation
@celm1990 next time, for avoiding opening more PRs, you just need to use |
email_template_qweb/README.rst
Outdated
|
||
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas | ||
:alt: Try me on Runbot | ||
:target: https://runbot.odoo-community.org/runbot/205/10.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/11.0
email_template_qweb/README.rst
Outdated
Demo data contains an example on how to separate corporate identity from a | ||
template's content. | ||
|
||
For further information, please visit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update whole README according to latest template https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst
email_template_qweb/__init__.py
Outdated
@@ -0,0 +1,4 @@ | |||
# -*- coding: utf-8 -*- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove coding headers
email_template_qweb/__init__.py
Outdated
@@ -0,0 +1,4 @@ | |||
# -*- coding: utf-8 -*- | |||
# © 2016 Therp BV <http://therp.nl> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace (c) symbol w/ "Copyright"
email_template_qweb/__manifest__.py
Outdated
"author": "Therp BV,Odoo Community Association (OCA)", | ||
"license": "AGPL-3", | ||
"category": "Marketing", | ||
"summary": "Use the QWeb templating mechanism for emails", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add 'website': 'https://github.com/OCA/social',
default='jinja2', required=True) | ||
body_view_id = fields.Many2one( | ||
'ir.ui.view', 'Body view', domain=[('type', '=', 'qweb')]) | ||
body_view_arch = fields.Text(related=['body_view_id', 'arch']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
related='body_view_id.arch'
?
result = super(MailTemplate, self).generate_email( | ||
res_ids, fields=fields | ||
) | ||
for record_id, this in self.get_email_template(res_ids).items(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are not in JS here: change this
w/ record
?
'object': record, | ||
'email_template': this, | ||
}) | ||
# Some wizards, like when sending a sales order, need this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still the case w/ Odoo 11 and py3?
self.assertTrue( | ||
# this comes from the called template if everything worked | ||
'<footer>' in mail_values[self.env.user.id]['body_html'], | ||
'Did not rcv rendered template in response. Got: \n%s\n' % ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/rcv/??? "receive"?
@@ -33,7 +33,7 @@ def generate_email(self, res_ids, fields=None): | |||
}) | |||
# Some wizards, like when sending a sales order, need this | |||
# fix to display accents correctly | |||
if not isinstance(body_html, unicode): | |||
if not isinstance(body_html, str): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we'll be better off with using https://github.com/OCA/OCB/blob/11.0/odoo/loglevels.py#L43 here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only some minor nitpicking.
@@ -0,0 +1,43 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can your remove the empty line here?
@@ -0,0 +1,4 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can your remove the empty line here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
email_template_qweb/__manifest__.py
Outdated
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
{ | ||
"name": "QWeb for email templates", | ||
"version": "10.0.1.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
11.0.1.0.0
also, whe you are done, squash your commits pls :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the things @simahawk mentioned it looks good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
@celm1990 please make the little remaining things to merge this. |
9dd3892
to
0aed142
Compare
@pedrobaeza is ok or something is missing??? |
@celm1990 this comment seems unattended #250 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM. Approving to not get back, but check README again ;)
bd21ca6
to
4c48870
Compare
@simahawk Done, update readme.rst. |
email_template_qweb/README.rst
Outdated
#. Select `QWeb` in the field `Body templating engine` | ||
#. Select a QWeb view to be used to render the body field | ||
#. Apart from QWeb's standard variables, you also have access to ``object`` and ``email_template``, which are browse records of the current object and the email template in use, respectively. | ||
#. Go to ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can delete this line
58f1a51
to
2de67e8
Compare
If the result is of type unicode, render method encodes it in utf-8. We need to decode it in that case so that the rendering results correct.
2de67e8
to
80436ac
Compare
PR replace #249
Sorry for create and close various PR. Is my first contribution