Кто-нибудь, пожалуйста, помогите мне с render_qweb_pdf () от Odoo. Я новичок в odoo, а также в XML,
Мой python код
@api.model
def print_invoice(self):
x = 'pawan'
y = 18
report = {
"report": {
"name": x,
"roll": y
}
}
# import pdb; pdb.set_trace()
xx = self.env.ref('fnf_stock.stock_pdf').sudo(
).render_qweb_pdf(self.id, report)
return xx
Мой XML код
<template id="stock_picking" name="stock_picking">
<t t-call="web.html_container">
<t t-as="o" t-foreach="docs">
<!-- article class is very important to display content -->
<div class="article">
<div class="row">
<t t-esc="report['name']"/>
<t t-esc="report['roll']"/>
</div>
</div>
</t>
</t>
</template>