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

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

Corrigido script para retirar o container Materiais.

File size: 3.2 KB
RevLinha 
[107]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
[111]14from zLOG import LOG, INFO
[107]15
[424]16LOG('ILSAALMaterial',INFO, 'Installing Product')
[107]17
18try:
19    import CustomizationPolicy
20except ImportError:
21    CustomizationPolicy=None
22
23from Globals import package_home
24from Products.CMFCore import utils, CMFCorePermissions, DirectoryView
[245]25from Products.CMFPlone.PloneUtilities import ToolInit
[107]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
[245]38##code-section custom-init-head #fill in your manual code here
39##/code-section custom-init-head
[107]40
41
42def initialize(context):
[245]43    ##code-section custom-init-top #fill in your manual code here
44    ##/code-section custom-init-top
45
[111]46    # imports packages and types for registration
[107]47    import interfaces
48
[245]49    import Material
50    import Fornecedor
51    import ItemRequisitado
52    import Requisicao
[448]53    import Almoxarifado
[245]54    import MovimentacaoEstoque
55    import ItemEntrada
56    import Entrada
57    import ContatoFornecedor
58    import LinhaAtendimento
[264]59    import Inventario
[245]60    import Estoque
61    import Requisicoes
[424]62    import Almoxarifados
[264]63    import Inventarios
[245]64    import Entradas
65    import Fornecedores
[264]66    import Fechamento
67    import Consolidacao
[566]68    import Fechamentos
[765]69    import GrupoMaterial
70    import GruposMaterial
[245]71
[111]72    # initialize portal content
[448]73    all_content_types, all_constructors, all_ftis = process_types(
[107]74        listTypes(PROJECTNAME),
75        PROJECTNAME)
76
77    utils.ContentInit(
78        PROJECTNAME + ' Content',
[448]79        content_types      = all_content_types,
[111]80        permission         = DEFAULT_ADD_CONTENT_PERMISSION,
[448]81        extra_constructors = all_constructors,
82        fti                = all_ftis,
[107]83        ).initialize(context)
84
[448]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
[111]95    # apply customization-policy, if theres any
[107]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.