1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Python] Fill a field inside dialog after return of method call

Discussão em 'Python' iniciado por Stack, Outubro 1, 2024 às 11:22.

  1. Stack

    Stack Membro Participativo

    I want to fill the Conclusion field after I click on Copy Notes button. How to do this in Odoo? I tried using the value property in the returned data but nothing happened.

    @api.multi
    def copy_notes(self):
    notes = ""
    if self.uuid_v4 == 'e3d2e0c7-ba64-4522-abf3-9befcf2bdacc':
    if self.physical_examination_id.id:
    notes = "Physical Examination"
    notes = notes + ("\n" if notes and self.physical_examination_id.eyes_remark else "")
    #do many things here that is not relevant to the question
    self.note = notes
    else:
    raise ValidationError(_("This exam cannot copy notes"))
    return {
    'value': {'note': notes},
    'type': "ir.actions.do_nothing",
    }


    [​IMG]

    Continue reading...

Compartilhe esta Página