Giter VIP home page Giter VIP logo

python-nuclos's People

Contributors

saierd avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

felixeberhardt

python-nuclos's Issues

Bug: change_to_state not working

First of all: thank you for the great work and this script. That really helps a lot.

Unfortunately, I do have the following issue with Nuclos 4.2022.12 (docker hosted): I do have a BO with different states and I want to change the state of the BO by number. When calling change_to_state (with a valid state number) the following exception is raised:

Traceback (most recent call last):
  File "/app/nuclos.py", line 361, in request
    result = urllib.request.urlopen(request)
  File "/usr/local/lib/python3.9/urllib/request.py", line 214, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/local/lib/python3.9/urllib/request.py", line 523, in open
    response = meth(req, response)
  File "/usr/local/lib/python3.9/urllib/request.py", line 632, in http_response
    response = self.parent.error(
  File "/usr/local/lib/python3.9/urllib/request.py", line 561, in error
    return self._call_chain(*args)
  File "/usr/local/lib/python3.9/urllib/request.py", line 494, in _call_chain
    result = func(*args)
  File "/usr/local/lib/python3.9/urllib/request.py", line 641, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 405: 

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/bottle.py", line 868, in _handle
    return route.call(**args)
  File "/usr/local/lib/python3.9/site-packages/bottle.py", line 1748, in wrapper
    rv = callback(*a, **ka)
  File "/app/actions.py", line 41, in action
    abrechnung.change_to_state_by_name(new_state)
  File "/app/nuclos.py", line 796, in change_to_state_by_name
    self._change_to_state(self._get_state_id_by_name(name))
  File "/app/nuclos.py", line 776, in _change_to_state
    self._nuclos.request(url, json_answer=False)
  File "/app/nuclos.py", line 388, in request
    raise NuclosHTTPException(e)
nuclos.NuclosHTTPException: HTTP Exception: 405 - 

I already had a look into the code and it seems that in

for next_state in self.data["nextStates"]:
the list of reachable states are iterated and compared to the "number" attribute. However, there is no number attribute (anymore?).

Please find an excerpt below:

    "nextStates":[
       {
          "nuclosStateId":"de_andreheuer_pkv_basis_AbrechnungSM_State_20",
          "name":"XXX1",
          "nonstop":false,
          "transitionname":"XXXXX1"
       },
       {
          "nuclosStateId":"de_andreheuer_pkv_basis_AbrechnungSM_State_21",
          "name":"XXX2",
          "nonstop":false,
          "transitionname":"XXXXX2"
       }
    ],

Nochmal ein Lob

Hallo,
ich habe gerade wieder festgestellt, wie gut und einfach die Python-Nuclos-Api ist, so einfach, dass ich von der Java-Regel-Api ausgehend viel zu kompliziert gedacht habe --> pythonic style

Es wäre wahrlich cool könnte man die Regeln so einfach schreiben, wobei die Java-Api ja schon Vereinfachungen erhalten hat.

Viele Grüße,
Dirk

Danke schön

Hallo,

wir setzen in unserer Firma auch Nuclos ein. Für eine Genehmigungsseite benötigte ich einen separaten Zugriff. Dies ließ sich hervorragend mit Ihrer API umsetzen (muss mich jetzt an Python 3 gewöhnen, aber das geht schon).

Gute Arbeit !

Problem beim Anlegen eines Unterformular-Eintrages

Hallo Herr Saier,
ich habe gerade versucht eine Auftragsposition zu einem Auftrag hinzuzufügen mit
neuerAuftrag.create_dependency_by_name('Auftragsposition')

Dies ging ebenso wenig wie der Aufruf per create_Auftragsposition()
Vielleicht haben Sie eine Idee dazu. Wenn ich die Auftragsposition eigenständig erzeuge und dann den Auftrag dieser zuweise funktioniert es.

Zur Info: Auftrag ist ein BO mit Statusmodell, Auftragsposition nicht. Ich verwende die Nuclos-Version 4.34.0 . Unten stehend ist einmal die Fehlermeldung des Scriptes und noch weiter unten die Fehlermeldung im DEBUG Mode.

Ansonsten finde ich immer noch, dass Sie eine schöne "pythonische" Schnittstelle entwickelt haben mitder es sich gut arbeiten läßt.

Viele Grüße
Dirk Jende-Holzmann

Fehlermeldung vom Script
Traceback (most recent call last):
File "", line 1, in
File "/home/nuclos/nuclos/nuclos.py", line 981, in create_dependency_by_name
dependency_id = self._get_dependency_id_by_name(name)
File "/home/nuclos/nuclos/nuclos.py", line 946, in _get_dependency_id_by_name
for dep in self._dependency_metas:
File "/home/nuclos/nuclos/nuclos.py", line 105, in call
self.cache[args] = self.f(*args)
File "/home/nuclos/nuclos/nuclos.py", line 930, in _dependency_metas
deps = self.data["subBos"]
File "/home/nuclos/nuclos/nuclos.py", line 727, in data
raise NuclosException("Attempting to access data of an uninitialized business object instance.")
nuclos.NuclosException: Attempting to access data of an uninitialized business object instance.

Meldung im Debug-Modus

ERROR 26.08.2019 13:07:22 HTTP Error 404:
Traceback (most recent call last):
File "/home/nuclos/nuclos/nuclos.py", line 357, in request
result = urllib.request.urlopen(request)
File "/usr/lib/python3.6/urllib/request.py", line 223, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.6/urllib/request.py", line 532, in open
response = meth(req, response)
File "/usr/lib/python3.6/urllib/request.py", line 642, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python3.6/urllib/request.py", line 570, in error
return self._call_chain(*args)
File "/usr/lib/python3.6/urllib/request.py", line 504, in _call_chain
result = func(*args)
File "/usr/lib/python3.6/urllib/request.py", line 650, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "./auftragimport.py", line 49, in
NeueAP=neuerAuftrag.create_dependency_by_name("Positionen")
File "/home/nuclos/nuclos/nuclos.py", line 981, in create_dependency_by_name
dependency_id = self._get_dependency_id_by_name(name)
File "/home/nuclos/nuclos/nuclos.py", line 946, in _get_dependency_id_by_name
for dep in self._dependency_metas:
File "/home/nuclos/nuclos/nuclos.py", line 105, in call
self.cache[args] = self.f(*args)
File "/home/nuclos/nuclos/nuclos.py", line 934, in _dependency_metas
metas[dep] = self._nuclos.request(deps[dep]["links"]["boMeta"]["href"])
File "/home/nuclos/nuclos/nuclos.py", line 384, in request
raise NuclosHTTPException(e)
nuclos.NuclosHTTPException: HTTP Exception: 404 -

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.