source: publico/ILSAALMaterial/trunk/__init__.py @ 1322

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

novo codigo gerado, adicionado alguns scripts *_salvar

File size: 3.2 KB
Linha 
1#
2# Initialise the product's module. There are three ways to inject custom code
3# here:
4#
5#   - To set global configuration variables, create a file AppConfig.py. This
6#       will be imported in config.py, which in turn is imported in each
7#       generated class and in this file.
8#   - To perform custom initialisation after types have been registered, use
9#       the protected code section at the bottom of initialize().
10#   - To register a customisation policy, create a file CustomizationPolicy.py
11#       with a method register(context) to register the policy
12#
13
14from zLOG import LOG, INFO
15
16LOG('ILSAALMaterial',INFO, 'Installing Product')
17
18try:
19    import CustomizationPolicy
20except ImportError:
21    CustomizationPolicy=None
22
23from Globals import package_home
24from Products.CMFCore import utils, CMFCorePermissions, DirectoryView
25from Products.CMFPlone.PloneUtilities import ToolInit
26from Products.Archetypes.public import *
27from Products.Archetypes import listTypes
28from Products.Archetypes.utils import capitalize
29
30import os, os.path
31
32from Products.ILSAALMaterial.config import *
33
34DirectoryView.registerDirectory('skins', product_globals)
35DirectoryView.registerDirectory('skins/ILSAALMaterial',
36                                    product_globals)
37
38##code-section custom-init-head #fill in your manual code here
39##/code-section custom-init-head
40
41
42def initialize(context):
43    ##code-section custom-init-top #fill in your manual code here
44    ##/code-section custom-init-top
45
46    # imports packages and types for registration
47    import interfaces
48
49    import Material
50    import Fornecedor
51    import ItemRequisitado
52    import Requisicao
53    import Almoxarifado
54    import MovimentacaoEstoque
55    import ItemEntrada
56    import Entrada
57    import ContatoFornecedor
58    import LinhaAtendimento
59    import Inventario
60    import Estoque
61    import Requisicoes
62    import Almoxarifados
63    import Inventarios
64    import Entradas
65    import Fornecedores
66    import Fechamento
67    import Consolidacao
68    import Fechamentos
69    import GrupoMaterial
70    import GruposMaterial
71
72    # initialize portal content
73    all_content_types, all_constructors, all_ftis = process_types(
74        listTypes(PROJECTNAME),
75        PROJECTNAME)
76
77    utils.ContentInit(
78        PROJECTNAME + ' Content',
79        content_types      = all_content_types,
80        permission         = DEFAULT_ADD_CONTENT_PERMISSION,
81        extra_constructors = all_constructors,
82        fti                = all_ftis,
83        ).initialize(context)
84
85    # give it some extra permissions to control them on a per class limit
86    for i in range(0,len(all_content_types)):
87        klassname=all_content_types[i].__name__
88        if not klassname in ADD_CONTENT_PERMISSIONS:
89            continue
90
91        context.registerClass(meta_type   = all_ftis[i]['meta_type'],
92                              constructors= (all_constructors[i],),
93                              permission  = ADD_CONTENT_PERMISSIONS[klassname])
94
95    # apply customization-policy, if theres any
96    if CustomizationPolicy and hasattr(CustomizationPolicy, 'register'):
97        CustomizationPolicy.register(context)
98        print 'Customization policy for ILSAALMaterial installed'
99
100    ##code-section custom-init-bottom #fill in your manual code here
101    ##/code-section custom-init-bottom
102
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.