tree view in a popup

Asked by kurt

Hi,

In this action i'm doing some query's which leads to a partners_ids list who I wanna
send to a popup tree view so I can select and save it into a table. But when I use the
tree view_mode I get a list but can't select the partners i wanna save.

def action_search_partners(self, cr, uid, ids, context=None):
       .....
       .....
       .....

       view_id = False
        data_obj = self.pool.get('ir.model.data')
        data_id = data_obj._get_id(cr, uid, 'mailstone', 'mailstone_selection_result_tree_view')
        if data_id:
            view_id = data_obj.browse(cr, uid, data_id, context=context).res_id

        value = {
            'view_type':'tree',
            'name': 'Selections Result',
            'context':context,
            'res_ids':partners_ids,
            'res_model': 'mailstone.selection.result',
            'view_id': 'mailstone.mailstone_selection_result_tree_view',
            'views': [(view_id, 'tree')],
            'type': 'ir.actions.act_window',
            'target': 'new',
        }
        return value

Question information

Language:
English Edit question
Status:
Answered
For:
Odoo Web Client Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Niels Huylebroeck (red15) said :
#1

Did you forget to add your 'view_mode': 'form,tree', ?

2012/1/20 kurt <email address hidden>

> New question #185281 on OpenERP Web Client:
> https://answers.launchpad.net/openobject-client-web/+question/185281
>
> Hi,
>
> In this action i'm doing some query's which leads to a partners_ids list
> who I wanna
> send to a popup tree view so I can select and save it into a table. But
> when I use the
> tree view_mode I get a list but can't select the partners i wanna save.
>
>
> def action_search_partners(self, cr, uid, ids, context=None):
> .....
> .....
> .....
>
> view_id = False
> data_obj = self.pool.get('ir.model.data')
> data_id = data_obj._get_id(cr, uid, 'mailstone',
> 'mailstone_selection_result_tree_view')
> if data_id:
> view_id = data_obj.browse(cr, uid, data_id,
> context=context).res_id
>
> value = {
> 'view_type':'tree',
> 'name': 'Selections Result',
> 'context':context,
> 'res_ids':partners_ids,
> 'res_model': 'mailstone.selection.result',
> 'view_id': 'mailstone.mailstone_selection_result_tree_view',
> 'views': [(view_id, 'tree')],
> 'type': 'ir.actions.act_window',
> 'target': 'new',
> }
> return value
>
>
>
> --
> You received this question notification because you are a member of
> OpenERP Committers, which is an answer contact for OpenERP Web Client.
>

--
Niels Huylebroeck
Bubbles-IT
Tel. : +32 (0)9 328 33 88
Web : http://www.bubbles-it.be

Can you help with this problem?

Provide an answer of your own, or ask kurt for more information if necessary.

To post a message you must log in.