Код: Выделить всё
@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",
}

Подробнее здесь: https://stackoverflow.com/questions/790 ... ethod-call