http://iffm.me/clientes-soap-en-python.html https://gitter.im/msolorzano/sunat2015/archives/2015/10/31 https://stackoverflow.com/questions/28239100/suds-error-trying-to-load-wsdl https://pythonexample.com/code/python%20sunat%20suds%20example/ https://medium.com/@djperalta/python-suds-sunat-example-afc6c37ad426 http://www.codegist.net/code/python%20sunat%20suds%20example/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for rec in records: | |
move_id = rec.move_id | |
# move_id.line_ids.remove_move_reconcile() | |
update_posted_state = rec.journal_id.update_posted | |
rec.journal_id.write({'update_posted': True}) | |
# move_id.button_cancel() | |
# This action will delete any move_id that we have | |
rec.action_cancel() | |
rec.write({'state': 'cancel'}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from zeep import Client, Settings | |
from zeep.plugins import HistoryPlugin | |
from zeep.wsse.username import UsernameToken | |
settings = Settings(strict=False, xml_huge_tree=True) | |
history = HistoryPlugin() | |
client = Client(wsdl='https://e-factura.sunat.gob.pe/ol-ti-itcpfegem/billService?wsdl', | |
wsse=UsernameToken('MODDATOS','MODDATOS'), settings=settings, plugins=[history]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
right_journal = env.ref('absa.account_journal_B2353') | |
bad_account = env.ref('absa.account_account_102_01_016') | |
for rec in records: | |
move_id = rec.mapped('move_id') | |
move_id.button_cancel() | |
for line in move_id.line_ids: | |
if line.journal_id == right_journal and line.account_id == bad_account: | |
line.write({'account_id': | |
right_journal.default_debit_account_id.id}) | |
move_id.action_post() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from suds import client | |
from suds.wsse import Security, UsernameToken | |
from suds.sax.text import Raw | |
from suds.sudsobject import asdict | |
from suds import WebFault | |
''' | |
Given a Workday Employee_ID, returns the last name of that employee. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""If installed it will return 0""" | |
os.system('which your app') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Don't try to be vi compatible | |
set nocompatible | |
" Helps force plugins to load correctly when it is turned back on below | |
filetype off | |
" TODO: Load plugins here (pathogen or vundle) | |
" Turn on syntax highlighting | |
syntax on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""We want to remove //content item, this is one way to do it.""" | |
from lxml.etree import tostring | |
from lxml.objectify import fromstring | |
xml = ' | |
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> | |
<S:Body> | |
<ns2:getStatusCdrResponse xmlns:ns2="http://service.sunat.gob.pe"> | |
<statusCdr> |