source: publico/ILSAALMaterial/trunk/Inventario.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.7 KB
Linha 
1# File: Inventario.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.IInventario import IInventario
28
29
30from Products.Archetypes.SQLStorage import *
31# additional imports from tagged value 'import'
32from DateTime import DateTime
33from Products.ILSAAL.saalapi import *
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    DateTimeField('dat_referencia',
41        default=DateTime(),
42        widget=CalendarWidget(
43            label="Referencia",
44            description="Data a qual o inventario se refere.",
45            format="%d/%m/%Y",
46            date_only=1,
47            label_msgid='ILSAALMaterial_label_dat_referencia',
48            description_msgid='ILSAALMaterial_help_dat_referencia',
49            i18n_domain='ILSAALMaterial',
50        ),
51        required=1
52    ),
53
54    StringField('cod_classe',
55        widget=StringWidget(
56            label="Classe",
57            description="Codigo da classe do item do inventario.",
58            label_msgid='ILSAALMaterial_label_cod_classe',
59            description_msgid='ILSAALMaterial_help_cod_classe',
60            i18n_domain='ILSAALMaterial',
61        ),
62        required=1
63    ),
64
65    IntegerField('qtd_item_material',
66        default="1",
67        widget=IntegerWidget(
68            label="Item",
69            description="Quantidade do item do inventario.",
70            label_msgid='ILSAALMaterial_label_qtd_item_material',
71            description_msgid='ILSAALMaterial_help_qtd_item_material',
72            i18n_domain='ILSAALMaterial',
73        ),
74        required=1
75    ),
76
77    FloatField('vlr_unitario_item_material',
78        default="0.00",
79        widget=CurrencyWidget(
80            label="Valor Unitario",
81            description="Valor unitario do item do inventario.",
82            label_msgid='ILSAALMaterial_label_vlr_unitario_item_material',
83            description_msgid='ILSAALMaterial_help_vlr_unitario_item_material',
84            i18n_domain='ILSAALMaterial',
85        ),
86        required=1
87    ),
88
89    DateTimeField('dat_geracao_inventario',
90        widget=CalendarWidget(
91            label="Geracao",
92            description="Data da geracao do inventario.",
93            format="%d/%m/%Y",
94            date_only=1,
95            visible={'edit':'hidden','view':'visible'},
96            label_msgid='ILSAALMaterial_label_dat_geracao_inventario',
97            description_msgid='ILSAALMaterial_help_dat_geracao_inventario',
98            i18n_domain='ILSAALMaterial',
99        ),
100        required=1
101    ),
102
103
104    ReferenceField('cod_item_material',
105        vocabulary_display_path_bound=-1,
106        widget=ReferenceWidget(
107            label="Codigo Item Material",
108            description="Escolha o material.",
109            format="select",
110            checkbox_bound=1,
111            label_msgid='ILSAALMaterial_label_cod_item_material',
112            description_msgid='ILSAALMaterial_help_cod_item_material',
113            i18n_domain='ILSAALMaterial',
114        ),
115        allowed_types=('Material',),
116        multiValued=0,
117        relationship='Inventario_Material'
118    ),
119
120),
121)
122
123
124##code-section after-local-schema #fill in your manual code here
125##/code-section after-local-schema
126
127Inventario_schema = BaseSchema + \
128    schema
129
130##code-section after-schema #fill in your manual code here
131##/code-section after-schema
132
133class Inventario(BaseContent):
134    """
135    Representa um inventario mensal de materiais.
136    """
137    security = ClassSecurityInfo()
138    __implements__ = (getattr(BaseContent,'__implements__',()),) + (IInventario,)
139
140
141    # This name appears in the 'add' box
142    archetype_name             = 'Inventario'
143
144    meta_type                  = 'Inventario'
145    portal_type                = 'Inventario'
146    allowed_content_types      = []
147    filter_content_types       = 0
148    global_allow               = 0
149    allow_discussion           = 0
150    #content_icon               = 'Inventario.gif'
151    immediate_view             = 'base_view'
152    default_view               = 'base_view'
153    suppl_views                = ()
154    typeDescription            = "Inventario"
155    typeDescMsgId              = 'description_edit_inventario'
156
157    schema = Inventario_schema
158
159    ##code-section class-header #fill in your manual code here
160    ##/code-section class-header
161
162
163    #Methods
164    #methods from Interface IInventario
165
166    security.declarePrivate('_titulo')
167    def _titulo(self):
168        """
169        Configuracao do titulo que esse objeto deseja disponibilizar.
170        """
171       
172        return str(self.getDat_referencia()) + ': ' + self.getCod_classe()
173
174
175
176registerType(Inventario,PROJECTNAME)
177# end of class Inventario
178
179##code-section module-footer #fill in your manual code here
180##/code-section module-footer
181
182
183
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.