跳至內容
選單
此問題已被標幟
3843 瀏覽次數

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 !

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
12月 22
3389
3
11月 23
32463
4
7月 25
4921
2
12月 23
17736
6
4月 18
21417