This question has been flagged
2 Replies
2699 Views

Hello... I'am trying to display a form view from an "on_change" method and a need your help to have your help for this......

def on_change_credito(self,cr,uid,ids,debito,credito,reflexao_centro,conta_origem_id,context=None):
    if context is None:
        context={}
          .
          .
          .

    return {
                'type': 'ir.actions.act_window',
                'name': 'Lancamentos',
                'view_mode': 'form',
                'view_type': 'form',
                'res_model': 'dotcom.lancamento.movimento.custo',
                'target': 'new',
                'context': context,
                'nodestroy': True,
                }
Avatar
Discard
Best Answer

Hello Edson,

You cannot return a view action from an on_change return. You can only return a dictionary having keys either of values, domain, warning or empty dictionary({}).for more information refer: on_change

Thanks,

Avatar
Discard
Author Best Answer

ok thanks for your help

Avatar
Discard