Ignore:
Timestamp:
13 Dec 2014, 07:30:38 (10 years ago)
Author:
Henrik Bettermann
Message:

Make necessary changes in root and in customer browser test.

Add plugin to create documents folder.

Location:
main/waeup.ikoba/trunk/src/waeup/ikoba
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/app.py

    r12098 r12207  
    3434from waeup.ikoba.customers.container import CustomersContainer
    3535from waeup.ikoba.products.container import ProductsContainer
     36from waeup.ikoba.documents.container import DocumentsContainer
    3637
    3738
     
    107108        self['customers'] = CustomersContainer()
    108109        self['products'] = ProductsContainer()
     110        self['documents'] = DocumentsContainer()
    109111        self._createPlugins()
    110112
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py

    r12196 r12207  
    826826        self.assertEqual(self.browser.url, self.customer_path)
    827827        self.browser.open(self.customer_path)
    828         self.browser.getLink("Documents").click()
     828        self.browser.getLink("Documents", index=1).click()
    829829        self.browser.getLink("Add document").click()
    830830        self.browser.getControl(name="doctype").value = ['CustomerPDFDocument']
     
    865865
    866866        # Documents can be removed
    867         self.browser.getLink("Documents").click()
     867        self.browser.getLink("Documents", index=1).click()
    868868        ctrl = self.browser.getControl(name='val_id')
    869869        ctrl.getControl(value=document.document_id).selected = True
  • main/waeup.ikoba/trunk/src/waeup/ikoba/documents/container.py

    r12005 r12207  
    2121import grok
    2222from grok import index
     23from waeup.ikoba.interfaces import IIkobaPluggable
    2324from waeup.ikoba.documents.interfaces import IDocumentsContainer, IDocument
    2425from waeup.ikoba.utils.helpers import attrs_to_fields
     
    3940
    4041DocumentsContainer = attrs_to_fields(DocumentsContainer)
     42
     43class DocumentsPlugin(grok.GlobalUtility):
     44    """A plugin that creates container for documents inside a company.
     45    """
     46    grok.implements(IIkobaPluggable)
     47    grok.name('documents')
     48
     49    def setup(self, site, name, logger):
     50        if 'documents' in site.keys():
     51            logger.warn('Could not create container for documents.')
     52            return
     53        site['documents'] = DocumentsContainer()
     54        logger.info('Container for documents created')
     55        return
     56
     57    def update(self, site, name, logger):
     58        if not 'documents' in site.keys():
     59            self.setup(site, name, logger)
  • main/waeup.ikoba/trunk/src/waeup/ikoba/permissions.py

    r12097 r12207  
    132132                     'waeup.manageUsers',
    133133                     'waeup.viewProducts', 'waeup.manageProducts',
     134                     'waeup.viewDocuments', 'waeup.manageDocuments',
    134135                     'waeup.manageDataCenter',
    135136                     'waeup.importData',
     
    157158                     #'waeup.manageUsers',
    158159                     'waeup.viewProducts', 'waeup.manageProducts',
     160                     'waeup.viewDocuments', 'waeup.manageDocuments',
    159161                     #'waeup.manageACBatches',
    160162                     'waeup.manageDataCenter',
  • main/waeup.ikoba/trunk/src/waeup/ikoba/permissions.txt

    r12068 r12207  
    3939    >>> from waeup.ikoba.permissions import get_waeup_roles
    4040    >>> len(list(get_waeup_roles()))
    41     13
     41    15
    4242
    4343    >>> len(list(get_waeup_roles(also_local=True)))
    44     16
     44    19
    4545
    4646
     
    5858    u'waeup.CustomersOfficer',
    5959    u'waeup.DataCenterManager',
     60    u'waeup.DocumentsManager',
     61    u'waeup.DocumentsOfficer',
    6062    u'waeup.ExportManager',
    6163    u'waeup.ImportManager',
Note: See TracChangeset for help on using the changeset viewer.