Changeset 12351 for main


Ignore:
Timestamp:
31 Dec 2014, 12:53:13 (10 years ago)
Author:
Henrik Bettermann
Message:

Customers must be able to proceed to contract submission without interaction by officers.

Show only the first 6 uid digits in breadcrumbs and in select boxes.

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

    r12349 r12351  
    6161grok.context(IIkobaObject)
    6262
    63 WARNING = _('You can not edit your document after final submission.'
     63WARNING_CUST = _('You can not edit some data after final submission.'
     64            ' You really want to submit?')
     65
     66WARNING_DOC = _('You can not edit your document after final submission.'
     67            ' You really want to submit?')
     68
     69WARNING_CON = _('You can not edit your contract after final submission.'
    6470            ' You really want to submit?')
    6571
     
    310316        return _('unset')
    311317
     318    @property
     319    def is_requestable(self):
     320        if self.context.state in (REQUESTED, APPROVED):
     321            return False
     322        return True
     323
    312324
    313325class ContactCustomerForm(ContactAdminForm):
     
    678690    grok.name('edit_base')
    679691    grok.require('waeup.handleCustomer')
    680     label = _('Edit base data')
    681     pnav = 4
     692    pnav = 4
     693
     694    @property
     695    def label(self):
     696        if self.is_requestable():
     697            return _('Edit base data and request registration')
     698        return _('Edit base data')
    682699
    683700    @property
     
    693710        return
    694711
    695     def is_editable(self, action):
     712    def is_requestable(self, action=None):
    696713        if self.context.state in (REQUESTED, APPROVED):
    697714            return False
    698715        return True
    699716
    700     @action(_('Request registration now'), warning=WARNING, condition=is_editable)
     717    @action(_('Request registration now'),
     718            warning=WARNING_CUST, condition=is_requestable)
    701719    def finalsubmit(self, **data):
    702720        msave(self, **data)
     
    773791    @property
    774792    def title(self):
    775         return self.context.document_id
     793        return "%s..." % self.context.document_id[:6]
    776794
    777795
     
    941959        return
    942960
    943     @action(_('Final Submit'), warning=WARNING)
     961    @action(_('Final Submit'), warning=WARNING_DOC)
    944962    def finalsubmit(self, **data):
    945963        msave(self, **data)
     
    11191137    @property
    11201138    def title(self):
    1121         return self.context.contract_id
     1139        return "%s..." % self.context.contract_id[:6]
    11221140
    11231141
     
    13251343        return
    13261344
    1327     @action(_('Final Submit'), warning=WARNING)
    1328     def finalsubmit(self, **data):
    1329         msave(self, **data)
    1330         IWorkflowInfo(self.context).fireTransition('submit')
    1331         self.flash(_('Form has been submitted.'))
    1332         self.redirect(self.url(self.context))
    1333         return
    1334 
    13351345
    13361346class ContractEditFormPage(ContractManageFormPage):
     
    13501360        return
    13511361
    1352     @action(_('Apply now (final submit)'), warning=WARNING)
     1362    @action(_('Apply now (final submit)'), warning=WARNING_CON)
    13531363    def finalsubmit(self, **data):
    13541364        msave(self, **data)
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py

    r12348 r12351  
    11781178
    11791179        # Contract can be edited
    1180         self.browser.getLink(conid).click()
     1180        self.browser.getLink(conid[:6]).click()
    11811181        self.browser.getLink("Manage").click()
    11821182        self.browser.getControl(name="form.product_object").value = ['SAM']
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_interfaces.py

    r12336 r12351  
    107107        source = CustomerDocumentSource()
    108108        result = source.factory.getTitle(object(), self.document)
    109         self.assertEqual(result, u'DOC1 - My Sample Document')
     109        self.assertEqual(result, u'DOC1... - My Sample Document')
    110110
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/utils.py

    r12339 r12351  
    290290    CUSTMANAGE_CUSTOMER_STATES = (STARTED,)
    291291
    292     DOCMANAGE_CUSTOMER_STATES = (APPROVED,)
     292    DOCMANAGE_CUSTOMER_STATES = (REQUESTED, APPROVED,)
    293293
    294294    DOCMANAGE_DOCUMENT_STATES = (CREATED,)
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/viewlets.py

    r12346 r12351  
    275275    grok.view(CustomerBaseDisplayFormPage)
    276276    grok.require('waeup.handleCustomer')
    277     text = _('Edit')
    278277    target = 'edit_base'
     278
     279    @property
     280    def text(self):
     281        if self.view.is_requestable:
     282            return _('Edit and request registration')
     283        return _('Edit')
    279284
    280285
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/vocabularies.py

    r12343 r12351  
    162162
    163163    def getTitle(self, context, value):
    164         return "%s - %s" % (value.document_id, value.title)
     164        return "%s... - %s" % (value.document_id[:6], value.title)
    165165
    166166
Note: See TracChangeset for help on using the changeset viewer.