Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
5938 มุมมอง

hello, I have a problem with my wizard result
I have results displayed by wizard for specific records but the problem is i can only see the results in tree view not in form view, for example the wizard return a tree view for me and the records in tree views are not click-able to become a form

that is my code:


from openerp import fields, models, api

class customer_trade_trans_details(models.TransientModel):

_name = 'customer.trade.trans.details'

start_date=fields.Date("Date From")

end_date=fields.Date("Date To")

trans_type=fields.Many2one("vb.tran_type","Transaction Type")

@api.multi

def trans_trade_details(self):

result_obj = self.env['vb.trade_tran']

cr, uid, context = self.env.args

domain = []

for wiz in self:

if context.has_key('active_ids') and context.get('active_ids'):

domain.append(('acct_id','in',context.get('active_ids')))

if wiz.trans_type:

domain.append(("tran_type_id","=",wiz.trans_type.id))

if wiz.start_date and wiz.end_date:

domain.append(("tran_date",">=",wiz.start_date))

domain.append(("tran_date","<=",wiz.end_date))

#results = result_obj.search(domain)

res_view_id = self.env['ir.model.data'].get_object_reference('vb_helpdesk','trade_trans_tree_inquiry_results12')[1]

return{

'name': "Transactions Trade Details",

'view_type': 'form',

'view_mode':"tree",

'view_id': res_view_id,

'res_model': 'vb.trade_tran',

'type': 'ir.actions.act_window',

'create':'False',

'domain':domain,

}


i tried to do many things but nothing worked :(
any help please ?

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

that is not what i am asking for, i am asking that i have return the result in tree view, but if you click on any record it wont take you to form view, so is there any way to make the result view in both tree and form view ?
because the result from wizard is only return tree view !!

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

 Hello Ahmad,


You have return 'trade_trans_tree_inquiry_results12' tree view in that you can specify editable="bottom" create="false" delete="false" attribute. or you can create new tree view for 'vb.trade_tran' and try return that view.

Example:

<tree string="Partner Invoices" create="false" delete="false" editable="bottom">

</tree>


Hope this helps.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
Syntax of domains - operators แก้ไขแล้ว
2
ม.ค. 23
26292
4
มิ.ย. 21
39441
1
ธ.ค. 20
2661
1
เม.ย. 18
7740
Why Odoo is so successful แก้ไขแล้ว
3
ก.ย. 15
9587