تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
4697 أدوات العرض

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.



الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
يونيو 24
1252
0
يوليو 16
5135
1
مارس 15
3606
1
يناير 18
3614
2
أبريل 15
8132