Hi All,
I migrated some sales order from another system (more than 100) and I want to confirm all the sales order on OpenERP. I have to do this often because they are validated in batches
OpenERP 6.1 on windows
class sale_order_inherit(osv.osv):
_inherit = "sale.order"
def action_button_confirm(self, cr, uid, ids, context=None):
wf_service = netsvc.LocalService('workflow')
return self.write(cr, uid, ids, {'state': 'done'})
sale_order_inherit()
the xml is
<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>
The code above sets the sales order to Done but I need the order to be picked as well because it is left at zero and I can't raise invoices for the orders, need to set the picking to 100% under "PICKED" so that I can invoice the sales order. thank you