Skip to Content
Menu
This question has been flagged
1925 Views

Good evening,

I am testing an e-commerce module, but I have some problems in migrating the module from version 11 to 12, check order  if it has a valid value.

but it is falling in:

 <t t-raw = "order.payment_acquirer_id.pending_msg" />

Although the message is clear, it indicates that the field does not exist in order of sale, I do not know how to locate it.

it seems that fields changed in version 12?

Thank you,

Regards.

*.py

res = request.env['payment.transaction'].sudo().form_feedback(post, 'xxxx')

return http.request.render('form_example',{'order': res.sale_order_ids,.........}

views

 <template id="form_example">

            <t t-call="website.layout">

                <t t-set="additional_title">Shop</t>

                <div id="wrap">

                    <div class="container oe_website_sale">

                        <t t-call="website_sale.wizard_checkout">

                            <t t-set="step" t-value="40" />

                        </t>

                        <h1 class="mb32">Order <em t-field="order.name" /></h1>

                        <div class="row">

                            <div class="col-lg-8 col-sm-9">

                                    <div id="c-card-form">

                                        <div id="form-c">

                                            <div class="form-group">

                                                <label for="email">..</label>

                                                <input class="form-control" type="text" data-c="card[email]" id="card[email]"/>

                                            </div>

                                            <div class="form-group" >

                                                <label for="number">..</label>

                                                <input class="form-control" type="text"  data-c="card[number]"  id="card[number]" />

                                            </div>

                                          

                                        </div>


                                        <div id="msg_pending" class="alert alert-info hidden" role="alert">

                                            <t t-raw="order.payment_acquirer_id.pending_msg" />

                                        </div>

                                        <div id="msg_done" class="alert alert-success hidden" role="alert">

                                            <t t-raw="order.payment_acquirer_id.done_msg" />

                                        </div>

                                        <div id="msg_cancel" class="alert alert-danger hidden" role="alert">

                                            <t t-raw="order.payment_acquirer_id.cancel_msg" />

                                        </div>

                                        <div id="msg_error" class="alert alert-danger hidden" role="alert">

                                            <t t-raw="order.payment_acquirer_id.error_msg" /><br/>

                                            <div id="result_response" />

                                        </div>

                            </div>

                            <div class="col-lg-3 col-lg-offset-1 col-sm-3 text-muted">

                                <t t-call='website_sale.bill_to'>

                                    <t t-set="order" t-value= "order"/>

                                </t>

                            </div>

                        </div>

                    </div>

                    <div class="oe_structure" />

                </div>

            </t>

        </template>     


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_http.py", line 203, in _dispatch

    result = request.dispatch()

  File "/usr/lib/python3/dist-packages/odoo/http.py", line 833, in dispatch

    r = self._call_function(**self.params)

  File "/usr/lib/python3/dist-packages/odoo/http.py", line 344, in _call_function

    return checked_call(self.db, *args, **kwargs)

  File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 97, in wrapper

    return f(dbname, *args, **kwargs)

  File "/usr/lib/python3/dist-packages/odoo/http.py", line 340, in checked_call

    result.flatten()

  File "/usr/lib/python3/dist-packages/odoo/http.py", line 1268, in flatten

    self.response.append(self.render())

  File "/usr/lib/python3/dist-packages/odoo/http.py", line 1261, in render

    return env["ir.ui.view"].render_template(self.template, self.qcontext)

  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 1282, in render_template

    return self.browse(self.get_view_id(template)).render(values, engine)

  File "/usr/lib/python3/dist-packages/odoo/addons/website/models/ir_ui_view.py", line 303, in render

    return super(View, self).render(values, engine=engine, minimal_qcontext=minimal_qcontext)

  File "/usr/lib/python3/dist-packages/odoo/addons/web_editor/models/ir_ui_view.py", line 27, in render

    return super(IrUiView, self).render(values=values, engine=engine, minimal_qcontext=minimal_qcontext)

  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 1291, in render

    return self.env[engine].render(self.id, qcontext)

  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_qweb.py", line 59, in render

    result = super(IrQWeb, self).render(id_or_xml_id, values=values, **context)

  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/qweb.py", line 272, in render

    self.compile(template, options)(self, body.append, values or {})

  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/qweb.py", line 351, in _compiled_fn

    raise QWebException("Error to render compiling AST", e, path, node and etree.tostring(node[0], encoding='unicode'), name)

odoo.addons.base.models.qweb.QWebException: 'sale.order' object has no attribute 'payment_acquirer_id'

Traceback (most recent call last):

  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/qweb.py", line 344, in _compiled_fn

    return compiled(self, append, new, options, log)

  File "<template>", line 1, in template_1327_25

  File "<template>", line 2, in body_call_content_24

AttributeError: 'sale.order' object has no attribute 'payment_acquirer_id'


Error to render compiling AST

AttributeError: 'sale.order' object has no attribute 'payment_acquirer_id'

Template: 1327

Path: /templates/t/t/div/div[1]/div/div[1]/div/div[2]/t

Node: <t t-raw="order.payment_acquirer_id.pending_msg"/>


Avatar
Discard

Any solution for this? I'm stuck upgrading from 11 to 14.

Any updates please.