@treeio_login_required
@handle_response_format
def order_invoice_view(request, order_id, response_format='html'):
 order = get_object_or_404(SaleOrder, pk=order_id)
 if ((not request.user.profile.has_permission(order)) and (not request.user.profile.is_admin('treeio.sales'))):
  return user_denied(request, message="You don't have access to this Sale")
 ordered_products = order.orderedproduct_set.filter(trash=False)
 try:
  conf = ModuleSetting.get_for_module('treeio.finance', 'my_company')[0]
  my_company = Contact.objects.get(pk=long(conf.value))
 except:
  my_company = None
 return render_to_response('sales/order_invoice_view', {'order': order, 'ordered_products': ordered_products, 'my_company': my_company}, context_instance=RequestContext(request), response_format=response_format)

@ treeio_login_required @ handle_response_format def order_invoice_view ( request , order_id , response_format = 'html' ) : order = get_object_or_404 ( SaleOrder , pk = order_id ) if ( ( not request . user . profile . has_permission ( order ) ) and ( not request . user . profile . is_admin ( 'treeio.sales' ) ) ) : return user_denied ( request , message = "You don't have access to this Sale" ) ordered_products = order . orderedproduct_set . filter ( trash = False ) try : conf = ModuleSetting . get_for_module ( 'treeio.finance' , 'my_company' ) [ 0 ] my_company = Contact . objects . get ( pk = long ( conf . value ) ) except : my_company = None return render_to_response ( 'sales/order_invoice_view' , { 'order' : order , 'ordered_products' : ordered_products , 'my_company' : my_company } , context_instance = RequestContext ( request ) , response_format = response_format )
order view as invoice .