Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ

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.



Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 6 24
1268
0
thg 7 16
5156
1
thg 3 15
3627
1
thg 1 18
3625
2
thg 4 15
8132