[IMP] sale : The button Create Invoice open the invoice form
bzr revid: vir@tinyerp.com-20101011114311-6bhy7mv4lpgwgson
This commit is contained in:
parent
54f0a7dbf5
commit
90758779b0
|
@ -461,6 +461,34 @@ class sale_order(osv.osv):
|
|||
inv_obj.button_compute(cr, uid, [inv_id])
|
||||
return inv_id
|
||||
|
||||
def manual_invoice(self, cr, uid, ids, context=None):
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
inv_ids = set()
|
||||
inv_ids1 = set()
|
||||
for id in ids:
|
||||
for record in self.pool.get('sale.order').browse(cr, uid, id).invoice_ids:
|
||||
inv_ids.add(record.id)
|
||||
# inv_ids would have old invoices if any
|
||||
for id in ids:
|
||||
wf_service.trg_validate(uid, 'sale.order', id, 'manual_invoice', cr)
|
||||
for record in self.pool.get('sale.order').browse(cr, uid, id).invoice_ids:
|
||||
inv_ids1.add(record.id)
|
||||
inv_ids = list(inv_ids1.difference(inv_ids))
|
||||
|
||||
result = {
|
||||
'name': 'Invoices',
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form,tree',
|
||||
'res_model': 'account.invoice',
|
||||
'view_id': False,
|
||||
'context': "{'type':'out_refund'}",
|
||||
'type': 'ir.actions.act_window',
|
||||
'res_id': inv_ids[0],
|
||||
'nodestroy' :True
|
||||
}
|
||||
|
||||
return result
|
||||
|
||||
def action_invoice_create(self, cr, uid, ids, grouped=False, states=['confirmed', 'done', 'exception'], date_inv = False, context=None):
|
||||
res = False
|
||||
invoices = {}
|
||||
|
|
|
@ -205,7 +205,7 @@
|
|||
<button name="ship_recreate" states="shipping_except" string="Recreate Procurement" icon="gtk-ok"/>
|
||||
<button name="ship_corrected" states="shipping_except" string="Procurement Corrected" icon="gtk-apply"/>
|
||||
<button name="action_cancel" states="manual,progress" string="Cancel Order" type="object" icon="gtk-cancel"/>
|
||||
<button name="manual_invoice" states="manual" string="Create Invoice" icon="gtk-go-forward"/>
|
||||
<button name="manual_invoice" states="manual" string="Create Invoice" icon="gtk-go-forward" type="object"/>
|
||||
<button name="ship_cancel" states="shipping_except" string="Cancel Order" icon="gtk-cancel"/>
|
||||
<button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object" icon="gtk-convert"/>
|
||||
<button name="cancel" states="draft" string="Cancel Order" icon="gtk-cancel"/>
|
||||
|
|
Loading…
Reference in New Issue