Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
198 Widoki

File "<896>", line 611, in template_896

odoo.addons.base.models.ir_qweb.QWebException: Error while render the template

AttributeError: 'account.move.line' object has no attribute 'analytic_account_id'

Template: accounting_pdf_reports.report_journal_entries

Path: /t/t/t/t/div/div[3]/table/tbody/t[3]/tr/td[5]/span

Node: <span t-field="line.analytic_account_id.display_name"/>


The above server error caused the following client error:

RPC_ERROR: Odoo Server Error

    RPC_ERROR

        at makeErrorFromResponse (http://localhost:8069/web/assets/debug/web.assets_web.js:29849:19)

        at decoder.onload (http://localhost:8069/web/assets/debug/web.assets_web.js:29737:25)

Awatar
Odrzuć
Najlepsza odpowiedź

Hii,

Why This Happens:

The field analytic_account_id was removed, renamed, or not defined on account.move.line.

use a safe check in the report template 

edit template and use t-if to check if the filed exists before trying  to print it :

<t t-if="hasattr(line, 'analytic_account_id') and line.analytic_account_id">

    <span t-field="line.analytic_account_id.display_name"/>

</t>

and if the filed is missing or rename so please fix it if you are using  custom module so add that filed 
from odoo import fields, models


class AccountMoveLine(models.Model):

    _inherit = 'account.move.line'


    analytic_account_id = fields.Many2one('account.analytic.account', string='Analytic Account')

 i hope it is use full

Awatar
Odrzuć