Changeset 1092 in main


Ignore:
Timestamp:
05/10/12 13:43:06 (7 years ago)
Author:
pcosquer
Message:

oerp: fix export of bom

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/openPLM/oerp/erp.py

    r1086 r1092  
    7171    models.OERPRootBOM.objects.create(part=ctrl.object, bom=bom) 
    7272    boms = [bom] 
    73     last_level = 1 
     73    last_level = 0 
    7474    for level, link in children: 
    75         if level < last_level: 
     75        if level <= last_level: 
    7676            del boms[level:] 
    7777        try: 
     
    8787            bom = bom_srv.create(data) 
    8888            models.OERPBOM.objects.create(bom=bom, link=link) 
    89         if last_level < level: 
    90             boms.append(bom) 
     89        boms.append(bom) 
    9190        last_level = level 
    9291    # TODO: errors handling 
Note: See TracChangeset for help on using the changeset viewer.