= semantic_form_for [:admin,@p_product], :remote => true do |form| 

  .content
    %h3
      = @p_product.code
      = @p_product.name

    %table.table
      %tr
        %td Code
        %td Taille
        %td Couleur
        
        %td Stock théorique
        %td Stock réél

        
      =form.semantic_fields_for :p_product_stocks, @p_product.p_product_stocks.order("p_color_id ASC") do |p_product_stock| 
          
        = p_product_stock.inputs do
          %tr
            %td=p_product_stock.text_field :code
            %td
              = p_product_stock.object.p_size.name if p_product_stock.object.p_size
            %td
              = p_product_stock.object.p_color.name if p_product_stock.object.p_color
            
            
            %td=p_product_stock.text_field :stock_ok
            %td=p_product_stock.text_field :stock_th_ok
            
            
            
            
            -if false
              
              
              %p= link_to_add_fields "Ajouter une ligne", p_product_stock, :product_degressifs 

              .product_degressifs_form
                =p_product_stock.semantic_fields_for :product_degressifs do |form|
                  =render :partial => "admin/product_degressifs/form", :locals => {:form => form}
            
  .actions
    = form.submit "Sauvegarder", :class => "btn btn-primary"
  