- Timestamp:
- 21 Nov 2014, 08:07:15 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/documents.py
r12015 r12018 20 20 """ 21 21 import grok 22 from zope.component import queryUtility, getUtility 22 23 from zope.component.interfaces import IFactory 23 24 from zope.interface import implementedBy 24 25 from waeup.ikoba.interfaces import MessageFactory as _ 25 26 from waeup.ikoba.customers.interfaces import ( 26 ICustomerDocumentsContainer, ICustomerNavigation, ICustomerDocument) 27 ICustomerDocumentsContainer, ICustomerNavigation, ICustomerDocument, 28 ICustomersUtils) 27 29 from waeup.ikoba.documents import DocumentsContainer, Document 30 from waeup.ikoba.documents.interfaces import IDocumentsUtils 28 31 from waeup.ikoba.utils.helpers import attrs_to_fields 29 32 … … 67 70 return self.__parent__.__parent__.writeLogMessage(view, message) 68 71 72 @property 73 def is_editable(self): 74 try: 75 # Customer must be approved 76 cond1 = self.customer.state in getUtility( 77 ICustomersUtils).DOCMANAGE_STATES 78 # Document must be in state created 79 cond2 = self.state in getUtility( 80 IDocumentsUtils).DOCMANAGE_STATES 81 if not (cond1 and cond2): 82 return False 83 except AttributeError: 84 pass 85 return True 86 69 87 CustomerDocument = attrs_to_fields(CustomerDocument) 70 88
Note: See TracChangeset for help on using the changeset viewer.