I have always the same error:File "/usr/lib/python3/dist-packages/odoo/fields.py", line 547, in _setup_related_full field = target._fields[name] KeyError: 'company_id'For me it's all ok
THIS IS MY VIEW:
===============
<odoo>
<data>
<record id="gcond.view_move_tree" model="ir.ui.view">
<field name="name">test.move.tree</field>
<field name="model">test.registra.mm</field>
<field name="arch" type="xml">
<tree decoration-info="state == 'draft'" string="Journal Entries">
<field name="date"/>
<field name="name"/>
<field name="partner_id"/>
<field name="ref"/>
<field name="journal_id"/>
<field name="amount" sum="Total Amount"/>
<field name="state"/>
<field name="currency_id" invisible="1"/>
</tree>
</field>
</record>
<record id="gcond.view_form_mm" model="ir.ui.view">
<field name="name">test.account.reg.form.mm</field>
<field name="model">test.registra.mm</field>
<field name="arch" type="xml">
<form string="Account Entry" duplicate="false">
<header>
<field name="state" widget="statusbar"/>
</header>
<sheet>
<field name="id" invisible="1"/>
<div class="oe_button_box">
</div>
<h1>
<field name="name" readonly="True" attrs="{'invisible':[('name','=','/')]}"/>
</h1>
<group>
<group>
<field name="date"/>
</group>
<group>
<field name="journal_id" options="{'no_open': True, 'no_create': True}"/>
<field name="company_id"/>
<field name="amount" invisible="1"/>
<field name="currency_id" invisible="1"/>
</group>
</group>
<notebook>
<page string="Journal Items">
<field name="line_ids" widget="one2many_list"
context="{'line_ids': line_ids, 'journal_id': journal_id }">
<tree editable="bottom" string="Journal Items">
<field name="account_id" domain="[('company_id', '=', parent.company_id), ('deprecated', '=', False)]"/>
<field name="partner_id"
domain="['|', ('parent_id', '=', False), ('is_company', '=', True)]"/>
<field name="name"/>
<field name="company_currency_id" invisible="1"/>
<field name="company_id" domain="[('company_id', '=', parent.company_id)]" invisible="1"/>
<field name="currency_id" options="{'no_create': True}" />
<field name="debit" sum="Total Debit"/>
<field name="credit" sum="Total Credit"/>
</tree>
<!-- Form view to cover mobile use -->
<form>
<group>
</group>
</form>
</field>
</page>
<page string="Other Info">
<group>
</group>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="gcond.view_account_move_filter" model="ir.ui.view">
<field name="name">test.move.select</field>
<field name="model">test.registra.mm</field>
<field name="arch" type="xml">
<search string="Search Move">
<field name="name" filter_domain="['|', ('name','ilike',self), ('ref','ilike',self)]" string="Move"/>
<field name="date"/>
<filter string="Unposted" name="unposted" domain="[('state','=','draft')]" help="Unposted Journal Entries"/>
<filter string="Posted" name="posted" domain="[('state','=','posted')]" help="Posted Journal Entries"/>
<separator/>
<filter string="Sales" name="sales" domain="[('journal_id.type','=','sale')]" context="{'default_journal_type': 'sale'}"/>
<filter string="Purchases" name="purchases" domain="[('journal_id.type','=','purchase')]" context="{'default_journal_type': 'purchase'}"/>
<filter string="Bank Operations" name="bankoperations" domain="[('journal_id.type','=','bank')]" context="{'default_journal_type': 'bank'}"/>
<filter string="Cash Operations" name="cashoperations" domain="[('journal_id.type','=','cash')]" context="{'default_journal_type': 'cash'}"/>
<filter string="Miscellaneous Operations" domain="[('journal_id.type','=','general')]" name="misc_filter" context="{'default_journal_type': 'general'}"/>
<separator/>
<field name="partner_id"/>
<field name="journal_id"/>
<group expand="0" string="Group By">
<filter string="Partner" name="partner" domain="[]" context="{'group_by':'partner_id'}"/>
<filter string="Journal" name="journal" domain="[]" context="{'group_by':'journal_id'}"/>
<filter string="Status" name="status" domain="[]" context="{'group_by':'state'}"/>
<filter string="Date" name="date" domain="[]" context="{'group_by':'date'}" help="Journal Entries by Date"/>
</group>
</search>
</field>
</record>
<!-- actions opening views on models -->
<record model="ir.actions.act_window" id="gcond.action_window">
<field name="name">gcond window</field>
<field name="res_model">test.registra.mm</field>
<field name="view_mode">tree,form</field>
</record>
<record id="gcond.action_move_journal_line" model="ir.actions.act_window">
<field name="name">Journal Entries</field>
<field name="res_model">test.registra.mm</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="gcond.view_move_tree"/>
<field name="search_view_id" ref="gcond.view_account_move_filter"/>
<field name="context">{'search_default_misc_filter':1, 'view_no_maturity': True}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a journal entry
</p><p>
A journal entry consists of several journal items, each of
which is either a debit or a credit transaction.
</p>
</field>
</record>
<menuitem name="Gcond"
id="gcond.menu_condominio"
web_icon="account,static/description/icon.png"
sequence="40"/>
<!-- Top menu item -->
<!-- menu categories -->
<menuitem name="Millesimi" id="gcond.menu_1" parent="gcond.menu_condominio"/>
<!--
<menuitem name="Menu 2" id="gcond.menu_2" parent="gcond.menu_root"/>
-->
<!-- actions -->
<menuitem name="Lista" id="gcond.menu_1_list" parent="gcond.menu_1" action="gcond.action_window"/>
<!--
<menuitem name="Server to list" id="gcond" parent="gcond.menu_2"
action="gcond.action_server"/>
-->
<menuitem
action="gcond.action_move_journal_line"
id="menu_action_move_journal_line_form"
parent="gcond.menu_condominio"
sequence="1"/>
</data>
</odoo>
THIS IS MY MODEL: ================<odoo>
<data>
<record id="gcond.view_move_tree" model="ir.ui.view">
<field name="name">test.move.tree</field>
<field name="model">test.registra.mm</field>
<field name="arch" type="xml">
<tree decoration-info="state == 'draft'" string="Journal Entries">
<field name="date"/>
<field name="name"/>
<field name="partner_id"/>
<field name="ref"/>
<field name="journal_id"/>
<field name="amount" sum="Total Amount"/>
<field name="state"/>
<field name="currency_id" invisible="1"/>
</tree>
</field>
</record>
<record id="gcond.view_form_mm" model="ir.ui.view">
<field name="name">test.account.reg.form.mm</field>
<field name="model">test.registra.mm</field>
<field name="arch" type="xml">
<form string="Account Entry" duplicate="false">
<header>
<field name="state" widget="statusbar"/>
</header>
<sheet>
<field name="id" invisible="1"/>
<div class="oe_button_box">
</div>
<h1>
<field name="name" readonly="True" attrs="{'invisible':[('name','=','/')]}"/>
</h1>
<group>
<group>
<field name="date"/>
</group>
<group>
<field name="journal_id" options="{'no_open': True, 'no_create': True}"/>
<field name="company_id"/>
<field name="amount" invisible="1"/>
<field name="currency_id" invisible="1"/>
</group>
</group>
<notebook>
<page string="Journal Items">
<field name="line_ids" widget="one2many_list"
context="{'line_ids': line_ids, 'journal_id': journal_id }">
<tree editable="bottom" string="Journal Items">
<field name="account_id" domain="[('company_id', '=', parent.company_id), ('deprecated', '=', False)]"/>
<field name="partner_id"
domain="['|', ('parent_id', '=', False), ('is_company', '=', True)]"/>
<field name="name"/>
<field name="company_currency_id" invisible="1"/>
<field name="company_id" domain="[('company_id', '=', parent.company_id)]" invisible="1"/>
<field name="currency_id" options="{'no_create': True}" />
<field name="debit" sum="Total Debit"/>
<field name="credit" sum="Total Credit"/>
</tree>
<!-- Form view to cover mobile use -->
<form>
<group>
</group>
</form>
</field>
</page>
<page string="Other Info">
<group>
</group>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="gcond.view_account_move_filter" model="ir.ui.view">
<field name="name">test.move.select</field>
<field name="model">test.registra.mm</field>
<field name="arch" type="xml">
<search string="Search Move">
<field name="name" filter_domain="['|', ('name','ilike',self), ('ref','ilike',self)]" string="Move"/>
<field name="date"/>
<filter string="Unposted" name="unposted" domain="[('state','=','draft')]" help="Unposted Journal Entries"/>
<filter string="Posted" name="posted" domain="[('state','=','posted')]" help="Posted Journal Entries"/>
<separator/>
<filter string="Sales" name="sales" domain="[('journal_id.type','=','sale')]" context="{'default_journal_type': 'sale'}"/>
<filter string="Purchases" name="purchases" domain="[('journal_id.type','=','purchase')]" context="{'default_journal_type': 'purchase'}"/>
<filter string="Bank Operations" name="bankoperations" domain="[('journal_id.type','=','bank')]" context="{'default_journal_type': 'bank'}"/>
<filter string="Cash Operations" name="cashoperations" domain="[('journal_id.type','=','cash')]" context="{'default_journal_type': 'cash'}"/>
<filter string="Miscellaneous Operations" domain="[('journal_id.type','=','general')]" name="misc_filter" context="{'default_journal_type': 'general'}"/>
<separator/>
<field name="partner_id"/>
<field name="journal_id"/>
<group expand="0" string="Group By">
<filter string="Partner" name="partner" domain="[]" context="{'group_by':'partner_id'}"/>
<filter string="Journal" name="journal" domain="[]" context="{'group_by':'journal_id'}"/>
<filter string="Status" name="status" domain="[]" context="{'group_by':'state'}"/>
<filter string="Date" name="date" domain="[]" context="{'group_by':'date'}" help="Journal Entries by Date"/>
</group>
</search>
</field>
</record>
<!-- actions opening views on models -->
<record model="ir.actions.act_window" id="gcond.action_window">
<field name="name">gcond window</field>
<field name="res_model">test.registra.mm</field>
<field name="view_mode">tree,form</field>
</record>
<record id="gcond.action_move_journal_line" model="ir.actions.act_window">
<field name="name">Journal Entries</field>
<field name="res_model">test.registra.mm</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="gcond.view_move_tree"/>
<field name="search_view_id" ref="gcond.view_account_move_filter"/>
<field name="context">{'search_default_misc_filter':1, 'view_no_maturity': True}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a journal entry
</p><p>
A journal entry consists of several journal items, each of
which is either a debit or a credit transaction.
</p>
</field>
</record>
<menuitem name="Gcond"
id="gcond.menu_condominio"
web_icon="account,static/description/icon.png"
sequence="40"/>
<!-- Top menu item -->
<!-- menu categories -->
<menuitem name="Millesimi" id="gcond.menu_1" parent="gcond.menu_condominio"/>
<!--
<menuitem name="Menu 2" id="gcond.menu_2" parent="gcond.menu_root"/>
-->
<!-- actions -->
<menuitem name="Lista" id="gcond.menu_1_list" parent="gcond.menu_1" action="gcond.action_window"/>
<!--
<menuitem name="Server to list" id="gcond" parent="gcond.menu_2"
action="gcond.action_server"/>
-->
<menuitem
action="gcond.action_move_journal_line"
id="menu_action_move_journal_line_form"
parent="gcond.menu_condominio"
sequence="1"/>
</data>
</odoo>
Thank's
Il giorno lun 1 giu 2020 alle ore 23:08 Noura EL ALLAM <nea@odoo.com> ha scritto: