Odoo Help

Welcome!

This community 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.

0

Wizard doesn't show up in selection more list view

By
Ajeng Shilvie
on 1/31/15, 12:54 AM 668 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

.py

    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
            }

.xml

        <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>
        
        <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>
        </record>

 

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
0
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"
            res_model="wtc.permohonan.faktur"
            src_model="stock.production.lot"
            key2="client_action_multi"
            view_mode="form" target="new"
            id="action_window_permohonan_faktur" />

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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