Skip to Content
Menu
This question has been flagged
1 Reply
1349 Views

we want to list all related stock_moves directly in the partner-view as tree.

we added in res_partner:

all_pickings = fields.One2many('stock.move', 'partner_id', string="Pickings" , domain=[])


and in the view we added:

<page string="Pickings" attrs="{'invisible': [('customer','=', False)]}">
    <field name="all_pickings">
        <tree create="false" delete="false">
            <field name="product_id" />
            <field name="name" />
        </tree>
    </field>
</page>
           

But when i open the res.partner now i get the following runetime error:

Error: Unknown field state in domain

Any Ideas?



Avatar
Discard
Best Answer

Hi!

I think you have to create a new view which inherits from res.partner view:

somethig like this:

<record id="view_partner_form" model="ir.ui.view">
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="arch" type="xml">
        <field name="all_pickings " position="after"/>

</field>
</record>
 
 


Avatar
Discard
Author

yes i know. the upper XML is only the part of this customization. there is a record tag around it