Community: Framework mailing list archives

expert-framework@mail.odoo.com

RE: Domain filters - comparing model fields - is it really working?

by
hans.yonathan
- 09/04/2014 04:41:13

You must define src_user_exten field, in the view too.

 

Thank You.

 

Best Regards,

Hans Yonathan

OpenERP Support

FALINWA Limited

Expert in Finance & Business Intelligence

OpenERP Partner

Website: www.falinwa.com

 

From: Maxim Litnitskiy [mailto:litnimaxster@gmail.com]
Sent: Thursday, September 04, 2014 4:38 PM
To: Community: Framework
Subject: Domain filters - comparing model fields - is it really working?

 

I am reading "Understanding Odoo domain filters" - http://toolkt.com/site/understanding-odooopenerp-domain-filter/

>From there:

 

domain = ['|', ('field1','=',field3),('field1','=',field3)]

 

I have a model:

 

   _columns = {

        ...

        'src': fields.char(size=80, string='Src', select=1),

        'src_user_exten': fields.char(string='Src user exten'),

        ...

    }

 

 

Now I have the following filter:

 

<field name='domain'>[('src', '=', src_user_exten)]</field>

 

It does not work - Uncaught Error: NameError: name 'src_user_exten' is not defined

 

When I use quotes like that: <field name='domain'>[('src', '=', 'src_user_exten')]</field>

 

The following goes to PostgreSQL (from PG log collector):

 

SELECT "astpbx_cdr".id FROM "astpbx_cdr" WHERE (("astpbx_cdr"."src" = 'src_user_exten') 

 

The string goes into query not value.

 

How can we  use smth like that: domain = ['|', ('field1','=',field3),('field1','=',field3)] ????

 

Thanks.