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 is ignored!

By
José
on 1/7/15, 3:24 PM 504 views

Hello, I have Odoo8.

I have this field in model 'product.pricelist.version'

pagos_realizados = fields.Many2many('account.voucher', 'pagos_vouchers', 'id_pago', 'id_voucher', string='Pagos realizados', domain=[('es_acopio', '=', True), ('partner_id.customer', '=', True), ('fue_usado', '=', False)])

And this field in 'account.voucher' model

pricelist_version = fields.Many2many('product.pricelist.version', 'pagos_vouchers', 'id_voucher', 'id_pago')

The field 'fue_usado' is a field of model account.voucher, which is a computed field, is false if the voucher is related to any pricelist; in other cases is true.

I can check by a view that the 'fue_usado' field is FALSE in various vouchers, but the domain not filters it. The domains works correctly with the two first rules, but ignores the third. Why? Thanks!

 

 

1
José
On 1/7/15, 3:51 PM

I found the solution. I have to add store=True in the computed field definition, then the domain works.

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: 1/7/15, 3:24 PM
Seen: 504 times
Last updated: 3/16/15, 8:10 AM