-
Notifications
You must be signed in to change notification settings - Fork 0
[18.0][MIG] pos_ticket_send_by_mail: Migration to 18.0 #6
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
base: 18.0
Are you sure you want to change the base?
Conversation
pos_ticket_send_by_mail/static/src/js/receipt_screen_widget.esm.js
Outdated
Show resolved
Hide resolved
pos_ticket_send_by_mail/static/src/js/receipt_screen_widget.esm.js
Outdated
Show resolved
Hide resolved
762b8a1 to
2148acd
Compare
|
Resolved! |
0e14b17 to
2194078
Compare
nguyenminhchien
left a 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.
b43dabb to
81f327c
Compare
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.
Error when running the cron to send email (add a new unit test for that cron please):
RPC_ERROR
Odoo Server Error
Occured on localhost:10069 on model ir.cron on 2025-11-03 08:37:29 GMT
Traceback (most recent call last):
File "<1163>", line 508, in template_1163
File "<1163>", line 490, in template_1163_content
File "<1163>", line 224, in template_1163_t_call_0
AttributeError: 'pos.order' object has no attribute 'statement_ids'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/chien/code/odoo/odoo/18.0/odoo/tools/safe_eval.py", line 397, in safe_eval
return unsafe_eval(c, globals_dict, locals_dict)
File "ir.actions.server(437,)", line 1, in <module>
File "/home/chien/code/oca/pos/18.0/pos_ticket_send_by_mail/models/pos_order.py", line 36, in _send_order_cron
mail_template.send_mail(order.id, force_send=True)
File "/home/chien/code/odoo/odoo/18.0/addons/mail/models/mail_template.py", line 612, in send_mail
return self.send_mail_batch(
File "/home/chien/code/odoo/odoo/18.0/addons/mail/models/mail_template.py", line 642, in send_mail_batch
res_ids_values = self._generate_template(
File "/home/chien/code/odoo/odoo/18.0/addons/mail/models/mail_template.py", line 567, in _generate_template
template._generate_template_attachments(
File "/home/chien/code/odoo/odoo/18.0/addons/mail/models/mail_template.py", line 297, in _generate_template_attachments
report_content, report_format = self.env['ir.actions.report']._render_qweb_pdf(report, [res_id])
File "/home/chien/code/odoo/odoo/18.0/odoo/addons/base/models/ir_actions_report.py", line 1018, in _render_qweb_pdf
collected_streams, report_type = self._pre_render_qweb_pdf(report_ref, res_ids=res_ids, data=data)
File "/home/chien/code/odoo/odoo/18.0/addons/account/models/ir_actions_report.py", line 75, in _pre_render_qweb_pdf
return super()._pre_render_qweb_pdf(report_ref, res_ids=res_ids, data=data)
File "/home/chien/code/odoo/odoo/18.0/odoo/addons/base/models/ir_actions_report.py", line 1009, in _pre_render_qweb_pdf
return self._render_qweb_pdf_prepare_streams(report_ref, data, res_ids=res_ids), 'pdf'
File "/home/chien/code/odoo/odoo/18.0/addons/account_edi_ubl_cii/models/ir_actions_report.py", line 11, in _render_qweb_pdf_prepare_streams
collected_streams = super()._render_qweb_pdf_prepare_streams(report_ref, data, res_ids)
File "/home/chien/code/odoo/odoo/18.0/addons/account/models/ir_actions_report.py", line 22, in _render_qweb_pdf_prepare_streams
return super()._render_qweb_pdf_prepare_streams(report_ref, data, res_ids=res_ids)
File "/home/chien/code/odoo/odoo/18.0/odoo/addons/base/models/ir_actions_report.py", line 857, in _render_qweb_pdf_prepare_streams
html = self.with_context(**additional_context)._render_qweb_html(report_ref, all_res_ids_wo_stream, data=data)[0]
File "/home/chien/code/odoo/odoo/18.0/odoo/addons/base/models/ir_actions_report.py", line 1097, in _render_qweb_html
return self._render_template(report.report_name, data), 'html'
File "/home/chien/code/odoo/odoo/18.0/odoo/addons/base/models/ir_actions_report.py", line 773, in _render_template
return view_obj._render_template(template, values).encode()
File "/home/chien/code/odoo/odoo/18.0/odoo/addons/base/models/ir_ui_view.py", line 2218, in _render_template
return self.env['ir.qweb']._render(template, values)
File "/home/chien/code/odoo/odoo/18.0/odoo/tools/profiler.py", line 313, in _tracked_method_render
return method_render(self, template, values, **options)
File "/home/chien/code/odoo/odoo/18.0/odoo/addons/base/models/ir_qweb.py", line 607, in _render
result = ''.join(rendering)
File "<1163>", line 516, in template_1163
odoo.addons.base.models.ir_qweb.QWebException: Error while render the template
AttributeError: 'pos.order' object has no attribute 'statement_ids'
Template: pos_ticket_send_by_mail.report_receipt
Path: /t/t/t/div/table[1]/tbody/tr/td[2]/t/span
Node: <span t-field="line.qty"/>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/chien/code/odoo/odoo/18.0/odoo/http.py", line 2144, in _transactioning
return service_model.retrying(func, env=self.env)
File "/home/chien/code/odoo/odoo/18.0/odoo/service/model.py", line 156, in retrying
result = func()
File "/home/chien/code/odoo/odoo/18.0/odoo/http.py", line 2111, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "/home/chien/code/odoo/odoo/18.0/odoo/http.py", line 2359, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "/home/chien/code/odoo/odoo/18.0/odoo/addons/base/models/ir_http.py", line 333, in _dispatch
result = endpoint(**request.params)
File "/home/chien/code/odoo/odoo/18.0/odoo/http.py", line 754, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "/home/chien/code/odoo/odoo/18.0/addons/web/controllers/dataset.py", line 42, in call_button
action = call_kw(request.env[model], method, args, kwargs)
File "/home/chien/code/odoo/odoo/18.0/odoo/api.py", line 535, in call_kw
result = getattr(recs, name)(*args, **kwargs)
File "/home/chien/code/odoo/odoo/18.0/odoo/addons/base/models/ir_cron.py", line 120, in method_direct_trigger
self.ir_actions_server_id.run()
File "/home/chien/code/odoo/odoo/18.0/odoo/addons/base/models/ir_actions.py", line 995, in run
res = runner(run_self, eval_context=eval_context)
File "/home/chien/code/odoo/odoo/18.0/odoo/addons/base/models/ir_actions.py", line 827, in _run_action_code_multi
safe_eval(self.code.strip(), eval_context, mode="exec", nocopy=True, filename=str(self)) # nocopy allows to return 'action'
File "/home/chien/code/odoo/odoo/18.0/odoo/tools/safe_eval.py", line 411, in safe_eval
raise ValueError('%r while evaluating\n%r' % (e, expr))
ValueError: QWebException('Error while render the template') while evaluating
'model._send_order_cron()'
The above server error caused the following client error:
RPC_ERROR: Odoo Server Error
RPCError@http://localhost:10069/web/assets/d1852bb/web.assets_web.min.js:3159:338
makeErrorFromResponse@http://localhost:10069/web/assets/d1852bb/web.assets_web.min.js:3162:163
rpc._rpc/promise</<@http://localhost:10069/web/assets/d1852bb/web.assets_web.min.js:3167:34
| ) | ||
|
|
||
| @api.model | ||
| def get_values(self): |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
| if ( | ||
| receipt_options in [2, 3, 4] | ||
| and order.partner_id.email | ||
| and order.partner_id.pos_email_receipt == "email_pos_receipt" |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
| he only receives electronically", | ||
| ), | ||
| ("4", "Email receipt"), | ||
| ], |
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.
There is a warning:
2025-11-03 08:24:13,798 173159 WARNING v18c_pos_ticket_send_by_mail odoo.fields: res.config.settings.pos_receipt_options: selection attribute will be ignored as the field is related
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.
The warning's still there. you should remove the Selection value.
|
@P-H-Phuc just remind in the case you forgot this one |
81f327c to
6925b1b
Compare
nguyenminhchien
left a 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.
| he only receives electronically", | ||
| ), | ||
| ("4", "Email receipt"), | ||
| ], |
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.
The warning's still there. you should remove the Selection value.
228c918 to
1b187ee
Compare
|
Resolved! |
| <t t-if="o.state != 'cancel'"> | ||
| <span | ||
| t-out="line.price_subtotal_incl" | ||
| t-options='{"widget": "monetary", "display_currency": o.company_id.currency_id}' |
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.
| t-options='{"widget": "monetary", "display_currency": o.company_id.currency_id}' | |
| t-options='{"widget": "monetary", "display_currency": o.currency_id}' |
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.
apply the same for other places: get the currency from the pos order.
| <odoo> | ||
| <template id="report_receipt"> | ||
| <t t-call="web.html_container"> | ||
| <t t-foreach="docs" t-as="o"> |
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.
Print the report in the language of Partner. Take this for reference:
<template id="report_check_base_a4">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="o">
<t
t-call="account_check_printing_report_base.report_check_base_a4_document"
t-lang="o.partner_id.lang"
/>
</t>
</t>
</template>
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.
Resolved! Please help me to review
1b187ee to
aa69284
Compare
7d342c7 to
f9f7d49
Compare
Update fr.po [UPD] Update pos_ticket_send_by_mail.pot
[FIX] pos_ticket_send_by_mail: ir.config_paramenter access error [IMP] pos_ticket_send_by_mail [UPD] pos_ticket_send_by_mail: Translated using Weblate (French) Currently translated at 44.8% (13 of 29 strings) Translation: foodcoops-12.0/foodcoops-12.0-pos_ticket_send_by_mail Translate-URL: http://example.com/projects/foodcoops-12-0/foodcoops-12-0-pos_ticket_send_by_mail/fr/ [ADD] pos_ticket_send_by_mail: icon.png
Currently translated at 51.7% (15 of 29 strings) Translation: foodcoops-12.0/foodcoops-12.0-pos_ticket_send_by_mail Translate-URL: https://translate.druidoo.io/projects/foodcoops-12-0/foodcoops-12-0-pos_ticket_send_by_mail/fr/
…for specific members [UPD] pos_ticket_send_by_mail: Product Returns and Refunds on POS
f9f7d49 to
28b72e5
Compare


This module was initially part of the Foodcoop set of addons. We're now migrating it to 18.0 and taking this occasion to contribute it to OCA.