mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Bug 730255 - Python bindings: Assigns bill entries to non-existant invoice.
Add type checking to ensure entry type matches invoice (or bill) type.
This commit is contained in:
parent
d85725c080
commit
7c003f23e4
@ -217,7 +217,15 @@ class Entry(GnuCashCoreClass):
|
|||||||
if invoice != None:
|
if invoice != None:
|
||||||
invoice.AddEntry(self)
|
invoice.AddEntry(self)
|
||||||
else:
|
else:
|
||||||
GnuCashCoreClass.__init__(self, instance=instance)
|
|
||||||
|
GnuCashCoreClass.__init__(self, instance=instance)
|
||||||
|
|
||||||
|
def test_type(self, invoice):
|
||||||
|
if invoice.GetTypeString() == "Invoice" and self.GetInvoice() == None:
|
||||||
|
raise Exception("Entry type error. Check that Entry type matches Invoice.")
|
||||||
|
if invoice.GetTypeString() == "Bill" and self.GetBill() == None:
|
||||||
|
raise Exception("Entry type error. Check that Entry type matches Bill.")
|
||||||
|
|
||||||
|
|
||||||
# Owner
|
# Owner
|
||||||
GnuCashBusinessEntity.add_methods_with_prefix('gncOwner')
|
GnuCashBusinessEntity.add_methods_with_prefix('gncOwner')
|
||||||
|
Loading…
Reference in New Issue
Block a user