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

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

novo codigo gerado

File size: 4.8 KB
Linha 
1# File: ItemEntrada.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.IItemEntrada import IItemEntrada
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    IntegerField('qtd_item_entrada',
41        default="1",
42        widget=IntegerWidget(
43            label="Item",
44            description="Quantidade de itens na entrada.",
45            label_msgid='ILSAALMaterial_label_qtd_item_entrada',
46            description_msgid='ILSAALMaterial_help_qtd_item_entrada',
47            i18n_domain='ILSAALMaterial',
48        ),
49        required=1
50    ),
51
52    FloatField('vlr_unitario_item_entrada',
53        default="0.00",
54        widget=CurrencyWidget(
55            label="Valor Unitario",
56            description="Valor unitario do item na entrada.",
57            label_msgid='ILSAALMaterial_label_vlr_unitario_item_entrada',
58            description_msgid='ILSAALMaterial_help_vlr_unitario_item_entrada',
59            i18n_domain='ILSAALMaterial',
60        ),
61        required=1
62    ),
63
64    DateTimeField('dat_estorno_entrada',
65        default=DateTime(),
66        widget=CalendarWidget(
67            label="Estorno",
68            description="Informe a data de estorno na entrada.",
69            format="%d/%m/%Y",
70            date_only=1,
71            label_msgid='ILSAALMaterial_label_dat_estorno_entrada',
72            description_msgid='ILSAALMaterial_help_dat_estorno_entrada',
73            i18n_domain='ILSAALMaterial',
74        )
75    ),
76
77
78    ReferenceField('cod_item_material',
79        widget=ReferenceWidget(
80            label="Item Material",
81            format="select",
82            checkbox_bound=1,
83            label_msgid='ILSAALMaterial_label_cod_item_material',
84            description_msgid='ILSAALMaterial_help_cod_item_material',
85            i18n_domain='ILSAALMaterial',
86        ),
87        vocabulary_display_path_bound=-1,
88        multiValued=0,
89        relationship='ItemEntrada_Material',
90        allowed_types=('Material',)
91    ),
92
93),
94)
95
96
97##code-section after-local-schema #fill in your manual code here
98##/code-section after-local-schema
99
100ItemEntrada_schema = BaseSchema + \
101    schema
102
103##code-section after-schema #fill in your manual code here
104##/code-section after-schema
105
106class ItemEntrada(BaseContent):
107    """
108    Representa um item da entrada de materiais.
109    """
110    security = ClassSecurityInfo()
111    __implements__ = (getattr(BaseContent,'__implements__',()),) + (IItemEntrada,)
112
113
114    # This name appears in the 'add' box
115    archetype_name             = 'ItemEntrada'
116
117    meta_type                  = 'ItemEntrada'
118    portal_type                = 'ItemEntrada'
119    allowed_content_types      = []
120    filter_content_types       = 0
121    global_allow               = 0
122    allow_discussion           = 0
123    #content_icon               = 'ItemEntrada.gif'
124    immediate_view             = 'base_view'
125    default_view               = 'base_view'
126    suppl_views                = ()
127    typeDescription            = "ItemEntrada"
128    typeDescMsgId              = 'description_edit_itementrada'
129
130    schema = ItemEntrada_schema
131
132    ##code-section class-header #fill in your manual code here
133    ##/code-section class-header
134
135
136    #Methods
137    #methods from Interface IItemEntrada
138
139    security.declarePrivate('_titulo')
140    def _titulo(self):
141        """
142        Configuracao do titulo que esse objeto deseja disponibilizar.
143        """
144       
145        return str(self.getCod_item_material()) + ': ' + str(self.getQtd_item_entrada())
146
147
148
149registerType(ItemEntrada,PROJECTNAME)
150# end of class ItemEntrada
151
152##code-section module-footer #fill in your manual code here
153##/code-section module-footer
154
155
156
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.