Changeset 12166 for main/waeup.ikoba/trunk/src/waeup/ikoba/customers
- Timestamp:
- 7 Dec 2014, 22:24:03 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba/customers
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser.py
r12151 r12166 843 843 pnav = 4 844 844 845 #@property846 #def label(self):847 # return _('${a}: Document ${b}', mapping = {848 # 'a':self.context.customer.display_fullname,849 # 'b':self.context.document_id})850 851 845 @property 852 846 def label(self): … … 865 859 deletion_warning = _('Are you sure?') 866 860 867 #@property868 #def label(self):869 # return _('${a}: Document ${b}', mapping = {870 # 'a':self.context.customer.display_fullname,871 # 'b':self.context.document_id})861 def update(self): 862 if not self.context.is_editable_by_manager: 863 emit_lock_message(self) 864 return 865 return super(DocumentManageFormPage, self).update() 872 866 873 867 @property … … 888 882 889 883 def update(self): 890 if not self.context.is_editable :884 if not self.context.is_editable_by_customer: 891 885 emit_lock_message(self) 892 886 return -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/documents.py
r12165 r12166 90 90 91 91 @property 92 def is_editable (self):92 def is_editable_by_customer(self): 93 93 try: 94 94 # Customer must be approved … … 105 105 106 106 @property 107 def is_editable_by_manager(self): 108 try: 109 # Document must be in state created 110 cond = self.state in getUtility( 111 ICustomersUtils).DOCMANAGE_DOCUMENT_STATES 112 if not cond: 113 return False 114 except AttributeError: 115 pass 116 return True 117 118 @property 107 119 def translated_class_name(self): 108 120 try: -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/export.py
r12161 r12166 157 157 ICustomerDocument, 158 158 exclude_attribs=False, 159 omit=['is_editable', 159 omit=['is_editable_by_customer', 160 'is_editable_by_manager', 160 161 'translated_state', 161 162 'formatted_transition_date', -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/interfaces.py
r12144 r12166 240 240 """ 241 241 242 is_editable = Attribute('Document editable by customer') 242 is_editable_by_customer = Attribute('Document editable by customer') 243 is_editable_by_manager = Attribute('Document editable by manager') 243 244 translated_class_name = Attribute('Translatable class name') 244 245 -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py
r12162 r12166 853 853 self.assertEqual(document.state, 'verified') 854 854 855 # Manage button and form is no longer available 856 self.browser.open(self.documents_path + '/d102/index') 857 self.assertFalse( 858 'href="http://localhost/app/customers/K1000000/documents/d102/manage"' 859 in self.browser.contents) 860 self.browser.open(self.documents_path + '/d102/manage') 861 self.assertTrue( 862 'The requested form is locked (read-only)' 863 in self.browser.contents) 864 855 865 # Documents can be removed 856 866 self.browser.getLink("Documents").click() -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/viewlets.py
r12097 r12166 327 327 target = 'manage' 328 328 329 @property 330 def target_url(self): 331 if not self.context.is_editable_by_manager: 332 return '' 333 return self.view.url(self.view.context, self.target) 334 329 335 330 336 class DocumentEditActionButton(ManageActionButton): … … 338 344 @property 339 345 def target_url(self): 340 if not self.context.is_editable :346 if not self.context.is_editable_by_customer: 341 347 return '' 342 348 return self.view.url(self.view.context, self.target)
Note: See TracChangeset for help on using the changeset viewer.