Hi,
I have A custom wizard in Sales order
Code:
import wizard
import netsvc
import pooler
import os
customapp_form = """<?xml version="1.0"?>
<form string="Sales Order CustomApp">
<separator colspan="4" string="Do you really want to Run the Application ?" />
</form>
"""
customapp_fields = {}
def _runCustomApp(self, cr, uid, data, context):
solines_obj = pooler.get_pool(cr.dbname)
res = False
for so_line in solines_obj.get('sale.order.line').browse(cr,uid,data['ids']):
os.system("notepad.exe "+str(data['ids'])+"-"+str(so_line.name))
return {}
class run_customapp(wizard.interface):
states = {
'init' : {
'actions' : [],
'result' : {'type' : 'form',
'arch' : customapp_form,
'fields' : customapp_fields,
'state' : [('end', 'Cancel'),('run_app', 'CustomApp') ]}
},
'run_app' : {
'actions' : [],
'result' : {'type' : 'action',
'action' : _runCustomApp,
'state' : 'end'}
},
}
run_customapp("sale.order.customapp")
How can I get the "CURRENT" Sales order LINE id for my current sale order ? At the moment I do not get the record I want.
Appreciate any help. Thanks.