Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Domain filter "invalid leaf"

By
Robert Blabl
on 6/12/15, 8:26 AM 972 views

I'm having a little problem while defining a domain filter on a sale.order.form


I'm on a sale.order and I wanna update a domain filter for the field 'partner_invoice_id'. Reason is hiding the invoice address if it is the same as the partner id. So if partner_id == partner_invoice_id hide the field.


The error message is:   ValueError: Invalid leaf [6, u'!=', 6].  What is wrong with that?


This is the code:

<xpath expr="//field[@name='partner_invoice_id']" position="attributes">
<attribute name="parent_id">id</attribute>
<attribute name="readonly">1</attribute>
<attribute name="context">{'show_address': 1,'default_type':'invoice','partner_id':partner_id}</attribute>
<attribute name="options">{"always_reload": True}</attribute>
<attribute name="domain">
['&amp;', ('type', 'in', ['default', 'invoice', 'contact', 'other']),
'&amp;', (bool(partner_id), '=', True),
'&amp;', (bool(partner_invoice_id), '=', True),
'&amp;', (partner_id, '!=', partner_invoice_id), <!-- this doesn't work. If I remove this, my form will work
'|', ('id', '=', partner_id), ('parent_id', '=', partner_id)]
</attribute>
<attribute name="widget">selection</attribute>
</xpath>
0
Anton Chepurov
On 6/17/15, 3:15 AM

You are trying to refer to a partner_id field of field partner_invoice_id, with the latter being a res_partner object.

Res_partner object doesn't have a partner_id field.

0
Robert Blabl
On 6/15/15, 2:58 AM

Ok, I tried, but it doesn't work also:

==> ValueError: Invalid field u'partner_id' in leaf "&lt;osv.ExtendedLeaf: (u'partner_id', u'!=', False) on res_partner (ctx: )>"

For Information: I'm working on the odoo 8 branch from 14.06.201


Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 6/12/15, 8:26 AM
Seen: 972 times
Last updated: 1/29/16, 5:32 AM