Changeset 12059 for main/waeup.ikoba/trunk
- Timestamp:
- 25 Nov 2014, 17:39:53 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba/customers
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser.py
r12056 r12059 935 935 """Deliver an overview slip. 936 936 """ 937 grok.context(ICustomer )937 grok.context(ICustomerDocumentsContainer) 938 938 grok.name('overview_slip.pdf') 939 939 grok.require('waeup.viewCustomer') … … 950 950 return translate(_('Documents of'), 951 951 'waeup.ikoba', target_language=portal_language) \ 952 + ' %s' % self.context. display_fullname952 + ' %s' % self.context.customer.display_fullname 953 953 954 954 @property … … 972 972 for i in range(1,3): 973 973 tabledata.append(sorted( 974 [value for value in self.context ['documents'].values()]))974 [value for value in self.context.values()])) 975 975 tableheader.append([(Id, 'document_id', 2), 976 976 (Title, 'title', 6), … … 979 979 (LT, 'formatted_transition_date', 3), 980 980 ]) 981 customerview = CustomerBasePDFFormPage(self.context ,981 customerview = CustomerBasePDFFormPage(self.context.customer, 982 982 self.request, self.omit_fields) 983 983 customers_utils = getUtility(ICustomersUtils) 984 984 return customers_utils.renderPDF( 985 985 self, 'overview_slip.pdf', 986 self.context , customerview,986 self.context.customer, customerview, 987 987 tableheader=tableheader, 988 988 tabledata=tabledata, -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py
r12058 r12059 1026 1026 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 1027 1027 # Officers can open the pdf transcript 1028 self.browser.open(self.customer_path + '/overview_slip.pdf') 1028 self.browser.open(self.customer_path + '/documents') 1029 self.browser.getLink("Download documents overview").click() 1029 1030 self.assertEqual(self.browser.headers['Status'], '200 Ok') 1030 1031 self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf') -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/viewlets.py
r12028 r12059 287 287 288 288 289 # Viewlets for customer cocuments 290 289 # Viewlets for customer documents 291 290 292 291 class AddDocumentActionButton(AddActionButton): … … 297 296 text = _('Add document') 298 297 target = 'adddoc' 298 299 300 class PDFSlipActionButton(ManageActionButton): 301 grok.order(2) 302 grok.context(ICustomerDocumentsContainer) 303 grok.view(DocumentsManageFormPage) 304 grok.require('waeup.viewCustomer') 305 icon = 'actionicon_pdf.png' 306 text = _('Download documents overview') 307 target = 'overview_slip.pdf' 299 308 300 309
Note: See TracChangeset for help on using the changeset viewer.