source: publico/ILSAALMaterial/trunk/Fornecedores.py @ 1523

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

Atualizada a versão do ArchGenXml para a 1.4RC2

File size: 3.9 KB
Linha 
1# File: Fornecedores.py
2#
3# Copyright (c) 2005 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.CMFCore.utils import UniqueObject
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('id_sequencial',
40        widget=IntegerWidget(
41            visible={'edit':'hidden','view':'hidden'},
42            label="Id Sequencial",
43            description="Variavel oculta para geracao de id sequencial",
44            label_msgid='ILSAALMaterial_label_id_sequencial',
45            description_msgid='ILSAALMaterial_help_id_sequencial',
46            i18n_domain='ILSAALMaterial',
47        )
48    ),
49
50),
51)
52
53
54##code-section after-local-schema #fill in your manual code here
55##/code-section after-local-schema
56
57Fornecedores_schema = BaseBTreeFolderSchema + \
58    getattr(UniqueObject,'schema',Schema(())) + \
59    schema
60
61##code-section after-schema #fill in your manual code here
62##/code-section after-schema
63
64class Fornecedores(UniqueObject,BaseBTreeFolder):
65    """
66    Container de Fornecedores de materiais.
67    """
68    security = ClassSecurityInfo()
69    __implements__ = (getattr(UniqueObject,'__implements__',()),) + (getattr(BaseBTreeFolder,'__implements__',()),)
70
71
72    # This name appears in the 'add' box
73    archetype_name             = 'Fornecedores'
74
75    meta_type                  = 'Fornecedores'
76    portal_type                = 'Fornecedores'
77    allowed_content_types      = ['Fornecedor'] + list(getattr(UniqueObject, 'allowed_content_types', []))
78    filter_content_types       = 1
79    global_allow               = 0
80    allow_discussion           = 0
81    #content_icon               = 'Fornecedores.gif'
82    immediate_view             = 'base_view'
83    default_view               = 'base_view'
84    suppl_views                = ()
85    typeDescription            = "Fornecedores"
86    typeDescMsgId              = 'description_edit_fornecedores'
87
88    schema = Fornecedores_schema
89
90    ##code-section class-header #fill in your manual code here
91    ##/code-section class-header
92
93
94    #Methods
95
96    # Use class/module security defaults
97    def __init__(self,id=None):
98        """
99        Construtor da classe. Fixa o id para nao ser mais alterado.
100        """
101       
102        BaseBTreeFolder.__init__(self, 'fornecedores')
103
104
105
106    security.declarePrivate('geraIdFornecedores')
107    def geraIdFornecedores(self):
108        """
109        Gera o identificador sequencial dos Fornecedores, retornando-o       
110        """
111       
112        sequencial_id = self.getId_sequencial()
113        sequencial_id = sequencial_id + 1
114        self.setId_sequencial(sequencial_id)
115       
116        return '%07d' %(sequencial_id)
117
118
119
120registerType(Fornecedores,PROJECTNAME)
121# end of class Fornecedores
122
123##code-section module-footer #fill in your manual code here
124##/code-section module-footer
125
126
127
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.