source: publico/ILSAALMaterial/trunk/ItemRequisitado.py

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

novo codigo gerado

File size: 5.7 KB
Linha 
1# File: ItemRequisitado.py
2#
3# Copyright (c) 2006 by Interlegis
4# Generator: ArchGenXML Version 1.4.0-RC2 svn/development
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.IItemRequisitado import IItemRequisitado
28
29
30from Products.Archetypes.SQLStorage import *
31# additional imports from tagged value 'import'
32from Products.ILSAAL.saalapi import *
33from DateTime import DateTime
34
35from Products.ILSAALMaterial.config import *
36##code-section module-header #fill in your manual code here
37##/code-section module-header
38
39schema=Schema((
40    IntegerField('qtd_item_requisitada',
41        default="1",
42        widget=IntegerWidget(
43            description="Quantidade de itens requisitados.",
44            label="Itens Requisitados",
45            label_msgid='ILSAALMaterial_label_qtd_item_requisitada',
46            description_msgid='ILSAALMaterial_help_qtd_item_requisitada',
47            i18n_domain='ILSAALMaterial',
48        ),
49        required=1
50    ),
51
52    IntegerField('qtd_atendida',
53        default="1",
54        widget=IntegerWidget(
55            label="Itens Atendidos",
56            description="Informe a quantidade ja atendida do item requisitado.",
57            label_msgid='ILSAALMaterial_label_qtd_atendida',
58            description_msgid='ILSAALMaterial_help_qtd_atendida',
59            i18n_domain='ILSAALMaterial',
60        ),
61        required=1
62    ),
63
64    FloatField('vlr_unitario',
65        default="0.00",
66        widget=CurrencyWidget(
67            label="Valor Unitario",
68            description="Valor unitario do item atendido.",
69            label_msgid='ILSAALMaterial_label_vlr_unitario',
70            description_msgid='ILSAALMaterial_help_vlr_unitario',
71            i18n_domain='ILSAALMaterial',
72        ),
73        required=1
74    ),
75
76    DateTimeField('dat_atendimento',
77        default=DateTime(),
78        widget=CalendarWidget(
79            label="Atendimento",
80            description="Data de atendimento da requisicao.",
81            format="%d/%m/%Y",
82            date_only=1,
83            label_msgid='ILSAALMaterial_label_dat_atendimento',
84            description_msgid='ILSAALMaterial_help_dat_atendimento',
85            i18n_domain='ILSAALMaterial',
86        ),
87        required=1
88    ),
89
90    StringField('cod_id_atendente',
91        widget=StringWidget(
92            label="Identificacao",
93            description="Informe o codigo de identificacao do atendente da requisicao.",
94            label_msgid='ILSAALMaterial_label_cod_id_atendente',
95            description_msgid='ILSAALMaterial_help_cod_id_atendente',
96            i18n_domain='ILSAALMaterial',
97        ),
98        required=1
99    ),
100
101
102    ReferenceField('cod_item_material',
103        vocabulary_display_path_bound=-1,
104        widget=ReferenceWidget(
105            label="Codigo Item Material",
106            description="Escolha o Material",
107            format="select",
108            checkbox_bound=1,
109            label_msgid='ILSAALMaterial_label_cod_item_material',
110            description_msgid='ILSAALMaterial_help_cod_item_material',
111            i18n_domain='ILSAALMaterial',
112        ),
113        allowed_types=('Material',),
114        multiValued=0,
115        relationship='ItemRequisitado_Material'
116    ),
117
118),
119)
120
121
122##code-section after-local-schema #fill in your manual code here
123##/code-section after-local-schema
124
125ItemRequisitado_schema = BaseSchema + \
126    schema
127
128##code-section after-schema #fill in your manual code here
129##/code-section after-schema
130
131class ItemRequisitado(BaseContent):
132    """
133    Representa o item requisitado.
134    """
135    security = ClassSecurityInfo()
136    __implements__ = (getattr(BaseContent,'__implements__',()),) + (IItemRequisitado,)
137
138
139    # This name appears in the 'add' box
140    archetype_name             = 'Item Requisitado'
141
142    meta_type                  = 'ItemRequisitado'
143    portal_type                = 'ItemRequisitado'
144    allowed_content_types      = []
145    filter_content_types       = 0
146    global_allow               = 0
147    allow_discussion           = 0
148    #content_icon               = 'ItemRequisitado.gif'
149    immediate_view             = 'base_view'
150    default_view               = 'base_view'
151    suppl_views                = ()
152    typeDescription            = "Item Requisitado"
153    typeDescMsgId              = 'description_edit_itemrequisitado'
154
155    schema = ItemRequisitado_schema
156
157    ##code-section class-header #fill in your manual code here
158    ##/code-section class-header
159
160
161    #Methods
162    #methods from Interface IItemRequisitado
163
164    security.declarePrivate('_titulo')
165    def _titulo(self):
166        """
167        Configuracao do titulo que esse objeto deseja disponibilizar.
168        """
169       
170        return str(self.getCod_item_material()) + ': '  + str(self.getQtd_item_requisitada())
171
172
173
174registerType(ItemRequisitado,PROJECTNAME)
175# end of class ItemRequisitado
176
177##code-section module-footer #fill in your manual code here
178##/code-section module-footer
179
180
181
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.