Odoo Help

0

want multiple sale order confirmation in tree view

By
kaynis
on 8/7/13, 5:29 AM 1,810 views

V6 on window Is there a module or a setting that can allow multiple sales order confirmation out there please? Really need this for my project. Thank you.

0
kaynis
On 8/13/13, 12:12 PM

Found this on the forum but as the author stated it online confirm one order at a time can someone please help on how to confirm more than one order at a time. Thank you

class sale_order_inherit(osv.osv):
   _inherit = "sale.order"

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

    assert len(ids) == 1, 'This option should only be used for a single id at a time.'
    wf_service = netsvc.LocalService('workflow')
    wf_service.trg_validate(uid, 'sale.order', ids[0], 'order_confirm', cr)


           # redisplay the record as a sales order
    view_ref = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'sale', 'view_order_form')
    view_id = view_ref and view_ref[1] or False,

    return {
        'type': 'ir.actions.act_window',
        'name': _('Sales Order'),
        'res_model': 'sale.order',
        'res_id': ids[0],
        'view_type': 'tree',
        'view_mode': 'form',
        'view_id': view_id,
        'target': 'current',
        'nodestroy': True,
    }

    sale_order_inherit()

xml i used for this

    <openerp>
<data>
    <record id="action_sale_order_confirm_sales" model="ir.actions.server">
        <field name="name">Confirm Orders</field>
        <field name="type">ir.actions.server</field>
        <field name="model_id" ref="model_sale_order"/>
        <field name="state">code</field>

        <field name="code">obj.action_button_confirm(context=context)</field>

    </record>
    <record id="id_action_sale_order_confirm_sales" model="ir.values">
        <field name="name">Confirm Orders</field>
        <field name="action_id" ref="action_sale_order_confirm_sales"/>
        <field name="value" eval="'ir.actions.server,' + str(ref('action_sale_order_confirm_sales'))"/>
        <field name="key">action</field>
        <field name="model_id" ref="model_sale_order"/>
        <field name="model">sale.order</field>
        <field name="key2">client_action_multi</field>
                    <!--
    -->
    </record>
</data>
</openerp>

Not sure this is right but it works to confirm one at a time sale order on tree view

kaynis
on 8/13/13, 12:29 PM
0
joseph d'souza
On 8/9/13, 1:27 AM

Yes . This will possible to confirm multiple sale order with one click but need some customization which prompt wizard and in wizard you can chose your draft sale order line and confirm it. so this way it's possible to confirm multiple sale order

I have developed this thing for my customer requirement. To get this functionality you can mail me

Thanks, joseph d'souza, dsouzajoseph199@gmail.com

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.

Register

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

0 follower(s)

Stats

Asked: 8/7/13, 5:29 AM
Seen: 1810 times
Last updated: 3/16/15, 8:10 AM