Odoo Help


Wizard doesn't show up in selection more list view

Ajeng Shilvie
on 1/31/15, 12:54 AM 1,110 views

I want to add wizard in selection more list view in stock.production.lot refer to my new object wtc.permohonan.faktur but my wizard doesn't show up .

i am using this code


    def action_button_permohonan(self,cr,uid,ids,context=None):
        print "============BUTTON==============",ids
        lot = self.pool.get('stock.production.lot')

        for val in ids :
            vals = lot.browse(cr,uid,val)

            form_id  = 'permohonan.faktur.form'
            view_pool = self.pool.get("ir.ui.view")
            vit = view_pool.search(cr,uid, [
                                         ("name", "=", form_id),
                                         ("model", "=", 'wtc.permohonan.faktur'),
            form_browse = view_pool.browse(cr,uid,vit)
        return {
            'name': 'Permohonan Faktur',
            'view_type': 'form',
            'view_mode': 'form',
            'res_model': 'wtc.permohonan.faktur',
            'type': 'ir.actions.act_window',
            'view_id' : form_browse.id,
            'nodestroy': True,
            'target': 'new',
#             'res_id': vals.customer_stnk.id


        <record id="action_permohonan_faktur" model="ir.actions.server">
            <field name="name">Mohonkan Faktur</field>
            <field name="type">ir.actions.server</field>
            <field name="model_id" ref="model_wtc_permohonan_faktur"/>
            <field name="state">code</field>
            <field name="code">self.action_button_permohonan(cr,uid,context.get('active_ids'),context=context)</field>
        <record id="id_of_the_action_value" model="ir.values">
            <field name="name">Permohonan Faktur STNK</field>
            <field name="action_id" ref="action_permohonan_faktur"/>
            <field name="value" eval="'ir.actions.server,' + str(ref('action_permohonan_faktur'))"/>
            <field name="key">action</field>
            <field name="model_id" ref="model_stock_production_lot"/>
            <field name="model">stock.production.lot</field>
            <field name="key2">client_action_multi</field>


anyone know how to fix it ?

thanks in advance ..

Is you 'return' statement under the 'for loop'...??

Emipro Technologies Pvt. Ltd.
on 1/31/15, 1:05 AM

no its outside ..

Ajeng Shilvie
on 1/31/15, 1:07 AM

eh i mean yes it is under for loop

Ajeng Shilvie
on 1/31/15, 1:07 AM

That means that for every loop it should pop-up window? Do you think this is logical? I think you are making mistake here.

Emipro Technologies Pvt. Ltd.
on 1/31/15, 1:33 AM

no , i am not using return inside of looping ..

Ajeng Shilvie
on 1/31/15, 1:37 AM

@emipro i try to use and it show up , but i can't get ids of my selected record because it an action not a method, is there anyway to call a method in act_window ?

Ajeng Shilvie
on 1/31/15, 1:42 AM

i try to use this code

Ajeng Shilvie
on 1/31/15, 1:42 AM
Ajeng Shilvie
on 1/31/15, 1:43 AM

i try to put act_window code , but it doesn't show up in here

Ajeng Shilvie
on 1/31/15, 1:43 AM
Ajeng Shilvie
On 1/31/15, 1:45 AM

i try different method , using act_window but i can't return ids of my selected record, is there anyway to put action in act_window ?

        <act_window name="New Sub menu"
            view_mode="form" target="new"
            id="action_window_permohonan_faktur" />

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 1/31/15, 12:54 AM
Seen: 1110 times
Last updated: 3/16/15, 8:10 AM