source: main/ikobacustom.aaue/trunk/src/ikobacustom/aaue/customers/browser.py @ 17930

Last change on this file since 17930 was 14313, checked in by Henrik Bettermann, 8 years ago

Add customer fields.

  • Property svn:keywords set to Id
File size: 1.8 KB
Line 
1## $Id: browser.py 14313 2016-12-06 07:46:48Z henrik $
2##
3## Copyright (C) 2015 Uli Fouquet & Henrik Bettermann
4## This program is free software; you can redistribute it and/or modify
5## it under the terms of the GNU General Public License as published by
6## the Free Software Foundation; either version 2 of the License, or
7## (at your option) any later version.
8##
9## This program is distributed in the hope that it will be useful,
10## but WITHOUT ANY WARRANTY; without even the implied warranty of
11## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12## GNU General Public License for more details.
13##
14## You should have received a copy of the GNU General Public License
15## along with this program; if not, write to the Free Software
16## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17##
18
19import grok
20from zope.component import getUtility
21from waeup.ikoba.interfaces import IIkobaUtils, IExtFileStore
22from waeup.ikoba.customers.browser import (
23    PDFContractSlip, CustomerBaseEditFormPage)
24from ikobacustom.aaue.interfaces import MessageFactory as _
25
26class PDFContractSlip(PDFContractSlip):
27    """Deliver pdf file including metadata.
28    """
29
30    @property
31    def label(self):
32        portal_language = getUtility(IIkobaUtils).PORTAL_LANGUAGE
33        return self.context.title
34
35
36class CustomerBaseEditFormPage(CustomerBaseEditFormPage):
37    """ View to edit customer base data
38    """
39
40    def dataNotComplete(self):
41        return
42
43    @property
44    def form_fields(self):
45        if not self.is_requestable():
46            return grok.AutoFields(
47                self.context.form_fields_interface).select(
48                    'email', 'phone', 'inst', 'postal_address')
49        return grok.AutoFields(self.context.form_fields_interface).omit(
50            'suspended', 'suspended_comment', 'reg_number', 'customer_id')
Note: See TracBrowser for help on using the repository browser.