Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
2138 Lượt xem

I'm writing a module on Odoo (OpenERP) v.8 to allow timesheet's print. I'm using QWeb report type, but I can't use the fields that I need to use.

If I call a field from res_partner module, it works correctly.


<template id="traceur_contrat">

    <t t-call="report.html_container">

     <t t-foreach="docs" t-as="o">

        <t t-call="report.internal_layout">

            <div class="page">

 <table class="table table-condensed">

                            <tr>

                                <td class="text-center"><strong>Name</strong></td></tr>

 <tr >

                                <td class="text-center"><span t-esc="res_partner.mobile"/></td></tr>

.

.

.


I'm writing a module on Odoo (OpenERP) v.8 to allow timesheet's print. I'm using QWeb report type, but I can't use the fields that I need to use.

If I call a field from res_company module, it works correctly.

<template id="report_timesheet_document">
    <t t-call="report.external_layout">
        <div class="page">
            <div class="row">
                <div>
                    <span t-esc="res_company.name"/>
                </div>
            </div>

If I call a field from other modules, like res_partner, it doesn't work.

QWebException: "'NoneType' object has no attribute

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

you need to pass the model to the report. You pass data in the docs list of objects of a model, that you iterate as o. you can only access models that are in relation with that model.

Ảnh đại diện
Huỷ bỏ