Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
4770 มุมมอง

Hi, I'm fairly new to odoo development and I was wondering how can I make proper use of an AbstracModel in Odoo.


For instance, I've been trying to create a new report and created a class:


From odoo import models, fields, api, _


class IndirectCashFlow(models.AbstractModel):

    _name="account.report.indirect.cash.flow"

    _inherit="account.report"


Then I create the menu view for it:

xml version="1.0" encoding="utf-8"?>
<
odoo>
<
data>



<record id="action_account_indirect_cash_flow" model="ir.actions.client">
<
field name="name">Indirect Cash Flowfield>
<
field name="tag">account_reportfield>
<
field name="context" eval="{'model': 'account.report.indirect.cash.flow'}"/>
record>



<menuitem id="menu_action_indirect_cash_flow_report" name="Indirect Cash Flow" action="action_account_indirect_cash_flow" parent="account.account_reports_legal_statements_menu" groups="account.group_account_readonly"/>
data>
odoo>

When I try to go to the menu item I get the following error:

File "/Users/user/PycharmProjects/Odoo14/odoo-14.0+e.20211104/odoo/modules/registry.py", line 176, in __getitem__
    return self.models[model_name]
Exception


Which means the model cannot be found in registry. (I've added the xml file in manifest).

So, I have pretty much no idea why does this happens and the logs do not give that much information.


Any help is appreciated.



อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
มิ.ย. 24
1287
0
ก.ค. 16
5203
1
มี.ค. 15
3641
Financial Excel Report แก้ไขแล้ว
1
ม.ค. 18
3647
2
เม.ย. 15
8132