[Erp5-dev] Variation size problem
    Brice LEROY 
    informatique at cwdsellier.com
       
    Fri Mar 23 11:32:42 CET 2007
    
    
  
Hello,
  If you have to much variation category on some product, it could append 
sometimes that the packing_list.container_state indicate missing although you 
correctly configured your variation on each product. To know if problem is 
related to the database variation_text field size I call this script on 
product module  :
for product in context.objectValues():
  var_dict={}
  try:
    for elt in product.getVariationRangeCategoryList():
      base = elt.split("/")[0]
      if var_dict.has_key(base):
        if var_dict[base] < len(elt):
          var_dict[base] = len(elt)
      else:
          var_dict[base] = len(elt)
    if len(var_dict) > 0 :
      print 'max variation_text size for product %s is %s '% 
(product.getTitle(), sum([x for x in var_dict.values() ]))
  except e:
    pass
return printed
if nothing append, your product variation configuration is not too large, 
else, it could be nessecary to modify the size of variation_text field in 
database with the biggest variation_text returned value like :
mysql> ALTER TABLE item MODIFY variation_text VARCHAR(500);
Query OK, ...
Records: ...
mysql> ALTER TABLE movement MODIFY variation_text VARCHAR(500);
Query OK, ...
Records: ...
mysql> ALTER TABLE stock MODIFY variation_text VARCHAR(500);
Query OK, ...
Records: ...
where 500 is your biggest variation_text value
bye ;)
-- 
Brice LEROY
CWD Sellier / Sellerie de Nontron
Service Informatique
    
    
More information about the Erp5-dev
mailing list