콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
3792 화면

class toplevel()

    _columns = { 'foo_class_field': fields.many2many('foo','ManyField') }

class foo()

   _columns = { 'bar': fields.selection(('a','one'),('b','two')) }

 

on a view I want something like 

<field name="foo_classs_field"
                               domain="[('bar', '=', 'a')]"/>

 

but this doesn't work. Any help?

아바타
취소

Given that information I can't see why it shouldn't work.

작성자

Hi Rene As i suspect, the bar field doesn't contain a single 'a' value, but probably some kind of value set or just a concatenated string or something different. The documentation on this is shallow.. and from the source I din't get the wisdom... ;)

What exactly happens? Do you get an error?

작성자

Right now: , i get the following error: File "/vagrant/odoo/openerp/sql_db.py", line 230, in execute res = self._obj.execute(query, params) DataError: invalid input syntax for integer: "c" LINE 1: ... ("account_fiscal_attribute"."attribute_use_id" = 'c')) ORDE... ^

베스트 답변

try :
<field name="foo_classs_field" domain="[('foo.bar', '=', 'a')]"/>

assuming you have m2m from toplevel to foo class

아바타
취소
관련 게시물 답글 화면 활동
0
2월 25
18
2
3월 15
6905
0
3월 15
3816
3
5월 24
5427
1
12월 20
3318