source: publico/ILSAALMaterial/trunk/Requisicao.py @ 1540

Última Alteração nesse arquivo desde 1540 foi 1540, incluída por joaoantonio, 14 anos atrás

novo codigo gerado

File size: 5.3 KB
Linha 
1# File: Requisicao.py
2#
3# Copyright (c) 2005 by Interlegis
4# Generator: ArchGenXML Version 1.4.0-RC1 devel
5#            http://plone.org/products/archgenxml
6#
7# GNU General Public Licence (GPL)
8#
9# This program is free software; you can redistribute it and/or modify it under
10# the terms of the GNU General Public License as published by the Free Software
11# Foundation; either version 2 of the License, or (at your option) any later
12# version.
13# This program is distributed in the hope that it will be useful, but WITHOUT
14# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
16# details.
17# You should have received a copy of the GNU General Public License along with
18# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19# Place, Suite 330, Boston, MA  02111-1307  USA
20#
21__author__  = '''STC Interlegis <stc@interlegis.gov.br>'''
22__docformat__ = 'plaintext'
23
24
25from AccessControl import ClassSecurityInfo
26from Products.Archetypes.atapi import *
27from Products.ILSAALMaterial.interfaces.IRequisicao import IRequisicao
28
29from Products.ATVocabularyManager.namedvocabulary import NamedVocabulary
30
31from Products.Archetypes.SQLStorage import *
32# additional imports from tagged value 'import'
33from DateTime import DateTime
34from Products.ILSAAL.saalapi import *
35
36from Products.ILSAALMaterial.config import *
37##code-section module-header #fill in your manual code here
38##/code-section module-header
39
40schema=Schema((
41    StringField('cod_requisicao',
42        widget=StringWidget(
43            label="Codigo",
44            description="Informe o codigo da requisicao.",
45            label_msgid='ILSAALMaterial_label_cod_requisicao',
46            description_msgid='ILSAALMaterial_help_cod_requisicao',
47            i18n_domain='ILSAALMaterial',
48        ),
49        required=1
50    ),
51
52    DateTimeField('dat_requisicao',
53        default=DateTime(),
54        widget=CalendarWidget(
55            label="Data",
56            description="Informe a data da requisicao.",
57            format="%d/%m/%Y",
58            date_only=1,
59            visible={'edit':'hidden','view':'visible'},
60            label_msgid='ILSAALMaterial_label_dat_requisicao',
61            description_msgid='ILSAALMaterial_help_dat_requisicao',
62            i18n_domain='ILSAALMaterial',
63        ),
64        required=1
65    ),
66
67    StringField('cod_local_entrega',
68        widget=SelectionWidget(
69            label="Local",
70            description="Informe o codigo do local de entrega.",
71            format="select",
72            label_msgid='ILSAALMaterial_label_cod_local_entrega',
73            description_msgid='ILSAALMaterial_help_cod_local_entrega',
74            i18n_domain='ILSAALMaterial',
75        ),
76        required=1,
77        vocabulary=NamedVocabulary("""local_requisicao"""),
78        enforceVocabulary=1
79    ),
80
81    FloatField('vlr_total_requisitado',
82        default="0.00",
83        widget=CurrencyWidget(
84            label="Total",
85            description="Informe o valor total da requisicao.",
86            label_msgid='ILSAALMaterial_label_vlr_total_requisitado',
87            description_msgid='ILSAALMaterial_help_vlr_total_requisitado',
88            i18n_domain='ILSAALMaterial',
89        ),
90        required=1
91    ),
92
93    StringField('cod_status_requisicao',
94        widget=StringWidget(
95            label="Status",
96            description="Status em que se encontra a requisicao.",
97            label_msgid='ILSAALMaterial_label_cod_status_requisicao',
98            description_msgid='ILSAALMaterial_help_cod_status_requisicao',
99            i18n_domain='ILSAALMaterial',
100        )
101    ),
102
103),
104)
105
106
107##code-section after-local-schema #fill in your manual code here
108##/code-section after-local-schema
109
110Requisicao_schema = BaseFolderSchema + \
111    schema
112
113##code-section after-schema #fill in your manual code here
114##/code-section after-schema
115
116class Requisicao(BaseFolder):
117    """
118    Define a requisicao de materiais.
119    """
120    security = ClassSecurityInfo()
121    __implements__ = (getattr(BaseFolder,'__implements__',()),) + (IRequisicao,)
122
123
124    # This name appears in the 'add' box
125    archetype_name             = 'Requisicao'
126
127    meta_type                  = 'Requisicao'
128    portal_type                = 'Requisicao'
129    allowed_content_types      = ['ItemRequisitado']
130    filter_content_types       = 1
131    global_allow               = 0
132    allow_discussion           = 0
133    #content_icon               = 'Requisicao.gif'
134    immediate_view             = 'base_view'
135    default_view               = 'base_view'
136    suppl_views                = ()
137    typeDescription            = "Requisicao"
138    typeDescMsgId              = 'description_edit_requisicao'
139
140    schema = Requisicao_schema
141
142    ##code-section class-header #fill in your manual code here
143    ##/code-section class-header
144
145
146    #Methods
147    #methods from Interface IRequisicao
148
149    security.declarePrivate('_titulo')
150    def _titulo(self):
151        """
152        Configuracao do titulo que esse objeto deseja disponibilizar.
153        """
154       
155        return self.geraIdRequisicao()
156       # return self.getCod_requisicao() + ': ' + str(self.getDat_requisicao().strftime("%d/%m/%Y"))
157
158
159registerType(Requisicao,PROJECTNAME)
160# end of class Requisicao
161
162##code-section module-footer #fill in your manual code here
163##/code-section module-footer
164
165
166
Note: Veja TracBrowser para ajuda no uso do navegador do trac.
 

The contents and data of this website are published under license:
Creative Commons 4.0 Brasil - Atribuir Fonte - Compartilhar Igual.