Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MDF-e #3

Open
ImplantiSolucoes opened this issue Sep 28, 2019 · 0 comments
Open

MDF-e #3

ImplantiSolucoes opened this issue Sep 28, 2019 · 0 comments

Comments

@ImplantiSolucoes
Copy link

ImplantiSolucoes commented Sep 28, 2019

Opa seguindo o tutorial de uso desse generate acabei esbarrando em algumas situações.
Primeiramente nunca usei algo do tipo e nunca vi, então não sei bem como funciona, mas estou tentando rsrs.

** Primeiro instalei o generate usando o**

pip3 install generateDS

Logo ele ficou no seguinte diretório

/home/implanti/.local/bin/

Terceiro passo foi usar o seguinte comando

export GENERATEDS_HOME=/home/implanti/.local/bin/

E por quarto passo tentei executa o comando abaixo que esta no tutorial

curl https://raw.githubusercontent.com/akretion/edoc-gen/master/generate | bash -s mdfe python v3_00
'https://dfe-portal.sefazvirtual.rs.gov.br/MDFE/DownloadArquivoEstatico/?sistema=MDFE&tipoArquivo=2&nomeArquivo=PL_MDFe_300_NT022018_v1.02.zip'
'mdfe|mdfeModalAereo|mdfeModalAquaviario|mdfeModalFerroviario|mdfeModalRodoviario'

Estava dando erro o erro abaixo

implanti@ubuntu:/opt/odoo/test$ curl https://raw.githubusercontent.com/akretion/edoc-> gen/master/generate | bash -s mdfe python v3_00
'https://dfe-portal.sefazvirtual.rs.gov.br/MDFE/DownloadArquivoEstatico/?sistema=MDFE&tipoArquivo=2&nomeArquivo=PL_MDFe_300_NT022018_v1.02.zip'
'mdfe|mdfeModalAereo|mdfeModalAquaviario|mdfeModalFerroviario|mdfeModalRodoviario'
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 3660 100 3660 0 0 4889 0 --:--:-- --:--:-- --:--:-- 4893
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 315 100 315 0 0 334 0 --:--:-- --:--:-- --:--:-- 334
Archive: /tmp/schemas.zip
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /tmp/schemas.zip or>
/tmp/schemas.zip.zip, and cannot find /tmp/schemas.zip.ZIP, period

E analisando o erro, percebi que url dos esquemas estava errado, primeiro que esta apontando pra um schema desatualizado, segundo que url da sefaz estava incorreta, então fiz a correção e o comando ficou assim

curl https://raw.githubusercontent.com/akretion/edoc-gen/master/generate | bash -s mdfe python v3.00 'https://dfe-portal.svrs.rs.gov.br/MDFE/DownloadArquivoEstatico/?sistema=MDFE&tipoArquivo=2&nomeArquivo=PL_MDFe_300a.zip' 'mdfe|mdfeModalAereo|mdfeModalAquaviario|mdfeModalFerroviario|mdfeModalRodoviario'

Logo acabou dando outro erro:

running generic plugin command:
(you can override it with a local scripts/mdfe/python/prepare file)
/home/implanti/.edoc-gen/cache/scripts/python/prepare | bash -s mdfe v3.00 || echo ''
grep: docs/conf.py: Arquivo ou diretório não encontrado

running generic plugin command:
(you can override it with a local scripts/mdfe/python/after_prepare file)
/home/implanti/.edoc-gen/cache/scripts/python/after_prepare | bash -s mdfe v3.00 || echo ''

processing file mdfeModalAereo_v3.00.xsd ...

running generic plugin command:
(you can override it with a local scripts/mdfe/python/generate_file file)
/home/implanti/.edoc-gen/cache/scripts/python/generate_file | bash -s mdfe v3.00 mdfeModalAereo mdfeModalAereo_v3.00.xsd || echo ''
python /home/implanti/.local/bin//generateDS.py --no-namespace-defs --use-getter-setter=none -f -o /opt/odoo/test/mdfelib/v3.00/mdfeModalAereo.py mdfeModalAereo_v3.00.xsd
Traceback (most recent call last):
File "/home/implanti/.local/bin//generateDS.py", line 8613, in
main()
File "/home/implanti/.local/bin//generateDS.py", line 8595, in main
superModule=superModule)
File "/home/implanti/.local/bin//generateDS.py", line 8015, in parseAndGenerate
prefix, root, options, args, superModule)
File "/home/implanti/.local/bin//generateDS.py", line 7766, in generate
generateSimpleTypes(wrt, prefix, SimpleTypeDict, root)
File "/home/implanti/.local/bin//generateDS.py", line 7695, in generateSimpleTypes
writeEnumClass(simpleType)
File "/home/implanti/.local/bin//generateDS.py", line 7665, in writeEnumClass
output += docstring if docstring else ''
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 13: ordinal not in range(128)

processing file mdfeModalAquaviario_v3.00.xsd ...

running generic plugin command:
(you can override it with a local scripts/mdfe/python/generate_file file)
/home/implanti/.edoc-gen/cache/scripts/python/generate_file | bash -s mdfe v3.00 mdfeModalAquaviario mdfeModalAquaviario_v3.00.xsd || echo ''
python /home/implanti/.local/bin//generateDS.py --no-namespace-defs --use-getter-setter=none -f -o /opt/odoo/test/mdfelib/v3.00/mdfeModalAquaviario.py mdfeModalAquaviario_v3.00.xsd
Traceback (most recent call last):
File "/home/implanti/.local/bin//generateDS.py", line 8613, in
main()
File "/home/implanti/.local/bin//generateDS.py", line 8595, in main
superModule=superModule)
File "/home/implanti/.local/bin//generateDS.py", line 8015, in parseAndGenerate
prefix, root, options, args, superModule)
File "/home/implanti/.local/bin//generateDS.py", line 7766, in generate
generateSimpleTypes(wrt, prefix, SimpleTypeDict, root)
File "/home/implanti/.local/bin//generateDS.py", line 7695, in generateSimpleTypes
writeEnumClass(simpleType)
File "/home/implanti/.local/bin//generateDS.py", line 7665, in writeEnumClass
output += docstring if docstring else ''
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 13: ordinal not in range(128)

processing file mdfeModalFerroviario_v3.00.xsd ...

running generic plugin command:
(you can override it with a local scripts/mdfe/python/generate_file file)
/home/implanti/.edoc-gen/cache/scripts/python/generate_file | bash -s mdfe v3.00 mdfeModalFerroviario mdfeModalFerroviario_v3.00.xsd || echo ''
python /home/implanti/.local/bin//generateDS.py --no-namespace-defs --use-getter-setter=none -f -o /opt/odoo/test/mdfelib/v3.00/mdfeModalFerroviario.py mdfeModalFerroviario_v3.00.xsd
Traceback (most recent call last):
File "/home/implanti/.local/bin//generateDS.py", line 8613, in
main()
File "/home/implanti/.local/bin//generateDS.py", line 8595, in main
superModule=superModule)
File "/home/implanti/.local/bin//generateDS.py", line 8015, in parseAndGenerate
prefix, root, options, args, superModule)
File "/home/implanti/.local/bin//generateDS.py", line 7766, in generate
generateSimpleTypes(wrt, prefix, SimpleTypeDict, root)
File "/home/implanti/.local/bin//generateDS.py", line 7695, in generateSimpleTypes
writeEnumClass(simpleType)
File "/home/implanti/.local/bin//generateDS.py", line 7665, in writeEnumClass
output += docstring if docstring else ''
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 13: ordinal not in range(128)

processing file mdfeModalRodoviario_v3.00.xsd ...

running generic plugin command:
(you can override it with a local scripts/mdfe/python/generate_file file)
/home/implanti/.edoc-gen/cache/scripts/python/generate_file | bash -s mdfe v3.00 mdfeModalRodoviario mdfeModalRodoviario_v3.00.xsd || echo ''
python /home/implanti/.local/bin//generateDS.py --no-namespace-defs --use-getter-setter=none -f -o /opt/odoo/test/mdfelib/v3.00/mdfeModalRodoviario.py mdfeModalRodoviario_v3.00.xsd
Traceback (most recent call last):
File "/home/implanti/.local/bin//generateDS.py", line 8613, in
main()
File "/home/implanti/.local/bin//generateDS.py", line 8595, in main
superModule=superModule)
File "/home/implanti/.local/bin//generateDS.py", line 8015, in parseAndGenerate
prefix, root, options, args, superModule)
File "/home/implanti/.local/bin//generateDS.py", line 7766, in generate
generateSimpleTypes(wrt, prefix, SimpleTypeDict, root)
File "/home/implanti/.local/bin//generateDS.py", line 7695, in generateSimpleTypes
writeEnumClass(simpleType)
File "/home/implanti/.local/bin//generateDS.py", line 7665, in writeEnumClass
output += docstring if docstring else ''
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 13: ordinal not in range(128)

processing file mdfe_v3.00.xsd ...

running generic plugin command:
(you can override it with a local scripts/mdfe/python/generate_file file)
/home/implanti/.edoc-gen/cache/scripts/python/generate_file | bash -s mdfe v3.00 mdfe mdfe_v3.00.xsd || echo ''
python /home/implanti/.local/bin//generateDS.py --no-namespace-defs --use-getter-setter=none -f -o /opt/odoo/test/mdfelib/v3.00/mdfe.py mdfe_v3.00.xsd
Traceback (most recent call last):
File "/home/implanti/.local/bin//generateDS.py", line 8613, in
main()
File "/home/implanti/.local/bin//generateDS.py", line 8595, in main
superModule=superModule)
File "/home/implanti/.local/bin//generateDS.py", line 8015, in parseAndGenerate
prefix, root, options, args, superModule)
File "/home/implanti/.local/bin//generateDS.py", line 7766, in generate
generateSimpleTypes(wrt, prefix, SimpleTypeDict, root)
File "/home/implanti/.local/bin//generateDS.py", line 7695, in generateSimpleTypes
writeEnumClass(simpleType)
File "/home/implanti/.local/bin//generateDS.py", line 7665, in writeEnumClass
output += docstring if docstring else ''
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 13: ordinal not in range(128)

Apesar de ter gerado o codigo, acredito que esta incompleto por causa do erro acima, bom de cara, eu poderia dizer que poderia dar uma facilitada no modo de uso no readme para iniciantes, pois os links que foi colocado tem muito conteúdo e é meio que confuso.

E por ultima me ajuda nisso kkkk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant