Hi , all ! i can't create a module use wizard inherit (osv.osv_memory) or (wizard.interface) , i use openerp 6.1 it run but don't show form ! code python: import wizard import pooler from osv import osv
def _action_open_window(self,cr,uid,data,context): view_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'res.users', 'wizard_abc_password') return { 'type': 'ir.actions.act_window', 'name': 'user', 'view_mode': 'form', 'view_type': 'form', 'res_model': 'res.users', 'nodestroy': 'true', 'res_id': 1, # assuming the many2one is (mis)named 'student' 'views': [(False, 'form')], 'target':'new', 'view_id':view_id }
class abc_user(wizard.interface): name="abc.user" description="abc" abc_user_password_form = ''' <form string="Enter New Password"> <field name="pass"/> </form>''' abc_user_password_fields = { 'pass': {'string': 'New Password', 'type': 'char', 'required':True, 'size': 64, 'invisible' :True}, }
states = {
'init': {
'actions': [],
'result': {'type':'form', 'arch':abc_user_password_form, 'fields':abc_user_password_fields, 'state':[('end','Cancel','gtk-cancel'),('open','Open margins','gtk-ok')]} } 'open':{ 'actions':[], 'result':{'type':'action','action':_action_onpen_window,'state':'end'} } } abc_user_password('abc.user')
xml:
<openerp> <data>
<wizard string="Change Password" model="abc.user" name="abc_user" menu="False" id="wizard_abc_password"/>
<menuitem name="ABC/User/Change Password" id="menu_abc_password" type="wizard" action="wizard_abc_password"/>
</data> </openerp>
help me ! thanks all !