Changeset 1239 in main


Ignore:
Timestamp:
06/20/12 09:43:20 (7 years ago)
Author:
zali
Message:

Oerp view : fix update action

File:
1 edited

Legend:

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

    r1115 r1239  
    3838                product = models.OERPProduct.objects.get(part=obj.object).product 
    3939                cost = erp.get_product_data([product])[0]["standard_price"] 
    40                 pc, created = models.PartCost.objects.get_or_create(part=obj.object) 
     40                try: 
     41                    pc, created = models.PartCost.objects.get_or_create(part=obj.object) 
     42                except: 
     43                    pc = models.PartCost(part=obj.object) 
    4144                pc.cost = cost 
    4245                erp.update_cost(obj, pc) 
Note: See TracChangeset for help on using the changeset viewer.