%tr#p_product{:id => p_product.id}
  - p_product_ref = p_product.p_product_refs.first
  
  -tr = {}
    
    
  -tr[:p_product_refs_ref] = capture do
  
    %td
    
      = p_product_ref.ref  if p_product_ref
  
  -tr[:name] = capture do
    %td= p_product.name
  
  -tr[:enabled] = capture do
    %td= "oui" if p_product.enabled
  
  -tr[:p_product_cat] = capture do
    %td
      = p_product.p_product_cat.name if p_product.p_product_cat
    
  
  -tr[:p_product_ref_uv] = capture do
    %td
      -if p_product_ref
        = p_product_ref.uv 

      
    

  -tr[:actions] = capture do
    %td.actions
      = link_to i(:"trash-o"), [:admin, p_product], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer ce produit ? ' } , :remote => true if !PriceLine.where(:p_product_ref_id => p_product.p_product_ref_ids).first
      =#debug PriceLine.where(:p_product_id => p_product.id).first
      = link_to i(:pencil), edit_admin_p_product_path(p_product), :remote => false


  =render :partial => "qi/qi_ordered_table_object", :locals => {:tr => tr, :object => p_product}
    
  