تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
4321 أدوات العرض

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.

الصورة الرمزية
إهمال
أفضل إجابة

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

الصورة الرمزية
إهمال
الكاتب أفضل إجابة

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