Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pyzohoapi/books.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def Account(self, *args, **kwargs): return objecttypes.Account(self, *args, **kw
def CompositeItem(self, *args, **kwargs): return objecttypes.CompositeItem(self, *args, **kwargs)
def Contact(self, *args, **kwargs): return objecttypes.Contact(self, *args, **kwargs)
def CustomerPayment(self, *args, **kwargs): return objecttypes.CustomerPayment(self, *args, **kwargs)
def CreditNote(self, *args, **kwargs): return objecttypes.CreditNote(self, *args, **kwargs)
def Document(self, *args, **kwargs): return objecttypes.Document(self, *args, **kwargs)
def Invoice(self, *args, **kwargs): return objecttypes.Invoice(self, *args, **kwargs)
def Item(self, *args, **kwargs): return objecttypes.Item(self, *args, **kwargs)
Expand Down
1 change: 1 addition & 0 deletions pyzohoapi/inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def Account(self, *args, **kwargs): return objecttypes.Account(self, *args, **kw
def Bill(self, *args, **kwargs): return objecttypes.Bill(self, *args, **kwargs)
def Brand(self, *args, **kwargs): return objecttypes.Brand(self, *args, **kwargs)
def Bundle(self, *args, **kwargs): return objecttypes.Bundle(self, *args, **kwargs)
def CreditNote(self, *args, **kwargs): return objecttypes.CreditNote(self, *args, **kwargs)
def CompositeItem(self, *args, **kwargs): return objecttypes.CompositeItem(self, *args, **kwargs)
def Contact(self, *args, **kwargs): return objecttypes.Contact(self, *args, **kwargs)
def CustomerPayment(self, *args, **kwargs): return objecttypes.CustomerPayment(self, *args, **kwargs)
Expand Down
6 changes: 3 additions & 3 deletions pyzohoapi/objecttypes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from pyzohoapi.objecttypes.mixins.CompositeItemOps import HasBundle
from ..core import ZohoObjectBase
from .mixins import HasActivate, HasAddresses, HasConfirm, HasCustomFields, HasDelivered, HasDraft, HasImage, HasVoid
from .mixins import HasActivate, HasAddresses, HasConfirm, HasCustomFields, HasDelivered, HasDraft, HasImage, HasVoid, HasSent


def ZohoObjectFactory(name,
Expand Down Expand Up @@ -49,13 +49,13 @@ def ZohoObjectFactory(name,
responseKey="composite_item", idKey="composite_item_id",
mixins=[HasActivate, HasBundle, HasCustomFields])
Contact = ZohoObjectFactory("Contact", mixins=[HasActivate, HasAddresses, HasCustomFields])
CreditNote = ZohoObjectFactory("CreditNode", mixins=[HasCustomFields])
CreditNote = ZohoObjectFactory("CreditNote", mixins=[HasCustomFields])
Currency = ZohoObjectFactory("Currency", urlPath="settings/currencies",
pluralResponseKey="currencies")
CustomerPayment = ZohoObjectFactory("CustomerPayment",
idKey="payment_id", numberKey="payment_number", mixins=[HasCustomFields])
Document = ZohoObjectFactory("Document", raw=True)
Invoice = ZohoObjectFactory("Invoice", mixins=[HasCustomFields])
Invoice = ZohoObjectFactory("Invoice", mixins=[HasCustomFields, HasDraft, HasVoid, HasSent])
Item = ZohoObjectFactory("Item", mixins=[HasActivate, HasCustomFields, HasImage])
ItemAdjustment = ZohoObjectFactory("ItemAdjustment",
urlPath="inventoryadjustments", responseKey="inventory_adjustment",
Expand Down
9 changes: 8 additions & 1 deletion pyzohoapi/objecttypes/mixins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
'HasActivate',
'HasAddresses',
'HasBundle',
'HasConfirm', 'HasDraft', 'HasVoid', 'HasDelivered',
'HasConfirm', 'HasDraft', 'HasVoid', 'HasSent', 'HasDelivered',
'HasCustomFields',
'HasImage',
]
Expand Down Expand Up @@ -95,6 +95,13 @@ def Void(self):
raise ZohoInvalidOpError("Void", self)
return self._mark('void')

class HasSent(_HasStatus):
"""Adds `Sent()`"""
def Sent(self):
if not self._id:
raise ZohoInvalidOpError("Sent", self)
return self._mark('sent')


class _HasAspect:
def _updateAspect(self, aspect, aspect_id, data):
Expand Down