source: publico/ILSAALMaterial/trunk/Estoque.py @ 781

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

Implementados mtodos _titulo() das classes e fechado ticket #57.

File size: 4.6 KB
Linha 
1# File: Estoque.py
2#
3# Copyright (c) 2005 by Interlegis
4# Generator: ArchGenXML Version 1.4.0-beta2 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 <admin-stc@interlegis.gov.br>'''
22__docformat__ = 'plaintext'
23
24
25from AccessControl import ClassSecurityInfo
26from Products.Archetypes.atapi import *
27from Products.ILSAALMaterial.interfaces.IEstoque import IEstoque
28
29
30from Products.Archetypes.SQLStorage import *
31# additional imports from tagged value 'import'
32from Products.ILSAAL.saalapi import *
33
34from Products.ILSAALMaterial.config import *
35##code-section module-header #fill in your manual code here
36##/code-section module-header
37
38schema=Schema((
39    IntegerField('qtd_item_estoque',
40        widget=IntegerWidget(
41            label="Estoque",
42            description="Quantidade do item no estoque.",
43            label_msgid='ILSAALMaterial_label_qtd_item_estoque',
44            description_msgid='ILSAALMaterial_help_qtd_item_estoque',
45            i18n_domain='ILSAALMaterial',
46        ),
47        required=1
48    ),
49
50    IntegerField('vlr_unitario_item_material',
51        widget=IntegerWidget(
52            label="Valor Unitario",
53            description="Valor unitario do item material no estoque.",
54            label_msgid='ILSAALMaterial_label_vlr_unitario_item_material',
55            description_msgid='ILSAALMaterial_help_vlr_unitario_item_material',
56            i18n_domain='ILSAALMaterial',
57        ),
58        required=1
59    ),
60
61
62    ReferenceField('cod_local_armazenamento',
63        widget=ReferenceWidget(
64            label='Cod_local_armazenamento',
65            label_msgid='ILSAALMaterial_label_cod_local_armazenamento',
66            description_msgid='ILSAALMaterial_help_cod_local_armazenamento',
67            i18n_domain='ILSAALMaterial',
68        ),
69        allowed_types=('Almoxarifado',),
70        multiValued=0,
71        relationship='Estoque_Almoxarifado'
72    ),
73
74
75    ReferenceField('cod_item_material',
76        widget=ReferenceWidget(
77            label='Cod_item_material',
78            label_msgid='ILSAALMaterial_label_cod_item_material',
79            description_msgid='ILSAALMaterial_help_cod_item_material',
80            i18n_domain='ILSAALMaterial',
81        ),
82        allowed_types=('Material',),
83        multiValued=0,
84        relationship='Estoque_Material'
85    ),
86
87),
88)
89
90
91##code-section after-local-schema #fill in your manual code here
92##/code-section after-local-schema
93
94Estoque_schema = BaseFolderSchema + \
95    schema
96
97##code-section after-schema #fill in your manual code here
98##/code-section after-schema
99
100class Estoque(BaseFolder):
101    """
102    Representa o estoque do material.
103    """
104    security = ClassSecurityInfo()
105    __implements__ = (getattr(BaseFolder,'__implements__',()),) + (IEstoque,)
106
107
108    # This name appears in the 'add' box
109    archetype_name             = 'Estoque'
110
111    meta_type                  = 'Estoque'
112    portal_type                = 'Estoque'
113    allowed_content_types      = ['MovimentacaoEstoque']
114    filter_content_types       = 1
115    global_allow               = 0
116    allow_discussion           = 0
117    #content_icon               = 'Estoque.gif'
118    immediate_view             = 'base_view'
119    default_view               = 'base_view'
120    suppl_views                = ()
121    typeDescription            = "Estoque"
122    typeDescMsgId              = 'description_edit_estoque'
123
124    schema = Estoque_schema
125
126    ##code-section class-header #fill in your manual code here
127    ##/code-section class-header
128
129
130    #Methods
131    #methods from Interface IEstoque
132
133    security.declarePrivate('_titulo')
134    def _titulo(self):
135        """
136        Configuracao do titulo que esse objeto deseja disponibilizar.
137        """
138       
139        return str(self.getCod_item_material()) + ': ' + str(self.getCod_local_armazenamento())
140
141
142
143registerType(Estoque,PROJECTNAME)
144# end of class Estoque
145
146##code-section module-footer #fill in your manual code here
147##/code-section module-footer
148
149
150
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.