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

Hi Friends,

I have wrote onchange function for the journals to viewed for different type of name fields.But the query retruns the values only after executing query in pgadmin

    def onchange_sequence(self, cr, uid, id, sequence_type, context=None):
        res = []
        if sequence_type:
#            value =  super(invoice_changes, self).onchange_sequence(cr, uid, id, sequence_type, context)
            cr.execute('select jl.journal_id\
                            from journal_type as jt\
                            left join journal_lines as jl on(jl.journ_id = jt.id)\
                            left join account_invoice as ai on (ai.sequence_type = jt.id)\
                            left join res_company as rc on (rc.id = jt.company_id)\
                            where ai.sequence_type = %s', (sequence_type,))
            for result in cr.fetchall():
                print "\n\n resultssssssssssssssssssssssssssssssssssssssssssssssss",result
                res.append(result[0])
            return {
                'domain': {
                      'journal_id': [('id', 'in', res)]
            } }
        return {}

 

please help me to resolve this problem

아바타
취소
베스트 답변

Does sequence_type  value is set with _defaults, so that the on_change can be triggered when value is available.  

If not try with adding a default value for sequence_type 

아바타
취소
베스트 답변

Well ... your super method call is above your query, so maybe you should switch that around? Chances are I'm not really getting what you are trying to achieve.

아바타
취소
관련 게시물 답글 화면 활동
2
2월 23
4109
1
1월 22
4160
2
3월 15
5500
1
7월 25
542
2
7월 25
690