Guest User

Untitled

a guest
Apr 10th, 2012
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.90 KB | None | 0 0
  1.      c = book.CustomerLookupByID(data['invoice']['invoicedata']['customerid'])
  2.      assert( isinstance(c, Customer) )
  3.      CUR = c.GetCurrency()
  4.      #print CUR.get_fullname(), data['customer']['currency']
  5.      assert( isinstance(CUR, GncCommodity) )
  6.  
  7.      invoice = Invoice(
  8.              book=book,
  9.              id=next_invoice_id(book=book, format=data['invoice']['invoicedata']['format_inv    oiceid']),
  10.              currency=CUR,
  11.              owner=c
  12.              )
  13.  
  14. """
  15. PROBLEM:
  16.  
  17. this piece of code produces:
  18.  
  19. * 19:41:21  CRIT <gnc.backend.sql> gnc_sql_save_commodity: assertion `pCommodity != NULL' failed
  20. * 19:41:21  WARN <gnc.backend.sql> [add_gvalue_owner_to_slist()] Invalid owner type: 0
  21.  
  22. both c and CUR are not None.
  23. CUR is identical to book.get_table().lookup('CURRENCY', 'EUR').
  24. c is a valid customer created with the normal gnucash GUI (.GetName etc. are correct).
  25.  
  26. Any ideas?
  27.  
  28. """
Advertisement
Add Comment
Please, Sign In to add comment