1- from base import QuickbooksManagedObject , QuickbooksTransactionEntity
1+ from base import QuickbooksManagedObject , QuickbooksTransactionEntity , Ref
22
33
44class Department (QuickbooksManagedObject , QuickbooksTransactionEntity ):
55 """
6- QBO definition: The Department entity provides a way to track different segments of the business, divisions, or physical locations
7- such as stores, and allows another way of categorizing the entire transaction. This is in contrast to Class objects,
8- which are applied to individual transaction line details. Delete is achieved by setting the Active attribute to
9- false in an entity update request; thus, making it inactive. In this type of delete, the record is not permanently
10- deleted, but is hidden for display purposes. References to inactive objects are left intact.
6+ QBO definition: The Department entity provides a way to track different segments of the business, divisions, or
7+ physical locations such as stores, and allows another way of categorizing the entire transaction.
8+ This is in contrast to Class objects, which are applied to individual transaction line details.
9+ Delete is achieved by setting the Active attribute to false in an entity update request; thus,
10+ making it inactive. In this type of delete, the record is not permanently deleted, but is hidden
11+ for display purposes. References to inactive objects are left intact.
1112 """
1213
13- class_dict = {}
14+ class_dict = {
15+ "ParentRef" : Ref
16+ }
17+
1418 qbo_object_name = "Department"
1519
1620 def __init__ (self ):
@@ -21,4 +25,13 @@ def __init__(self):
2125 self .Active = True
2226
2327 def __unicode__ (self ):
24- return self .FullyQualifiedName
28+ return self .Name
29+
30+ def to_ref (self ):
31+ ref = Ref ()
32+
33+ ref .name = self .Name
34+ ref .type = self .qbo_object_name
35+ ref .value = self .Id
36+
37+ return ref
0 commit comments