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.
I can't use fields from the current object (timesheet, inherited from hr_timesheet_sheet.sheet
).
If I use t-esc
:
<span t-esc="o.date_from"/>
QWebException: "'NoneType' object has no attribute 'date_from'" while evaluating 'o.date_from'
If I use t-field
<span t-field="o.date_from"/>
QWebException: 'NoneType' object has no attribute '_all_columns'
How can I resolve? Thanks.
Fixed: