I created a python script that uses proteus to generate patient records then
returns the id of that patient (map_Mdata() below).
I want to create a tryton wizard which would executes this script then change
to the form view of the newly created patient, however tryton wizard
documention is quite lacking (providing only an example with no comments,
explanation , etc).
This wizard was based on the "openappointmentreport" from gnuhealth but i been
unsuccessful at executing the external script map_Mdata() in do_open
class aa(Wizard):
'Import Patient Record'
__name__='aa'
start = StateView('aas',
'aa.aaForm', [
Button('Cancel', 'end', 'tryton-cancel'),
Button('Open', 'open_', 'tryton-ok', default=True),
])
open_ = StateAction('health.action_gnuhealth_patient_view')
def do_open_(self, action):
action['pyson_context'] = PYSONEncoder().encode({
'patient': map_Mdata(self.start.uid),
})
return action, {}
def transition_open_(self):
return 'end'
Script should be executed after start button is pressed, advice is greatly
appreciated