AttributeError: 'list' object has no attribute 'partition'

1,430 views
Skip to first unread message

Maxime MARAIS

unread,
Dec 13, 2017, 5:15:18 AM12/13/17
to Bots Open Source EDI Translator
Hi,

I'm trying to convert X12 to JSON file. The aim is to prepare/convert/amend data in a JSON file, then to consume this JSON file in a communication channel to import into Odoo. At this phase, I only proceed to JSON conversion, and simply try to store the JSON file in a folder. XML RPC with Odoo is the next phase.

It seems I'm on the right way, but I face an error I do not understand : AttributeError: 'list' object has no attribute 'partition'

The run report displays the following:


Received
Done850.edi1NMGOne_InNonetext/plain
InfileDone4401x12x12X12_In553 octetsNonetext/plain
InfileDone4421x12x12X12_In553 octetsNonetext/plain
ParsedDone4421x12x12X12_InPARTNER_TME_TEST553 octetsNoneus-asciiapplication/X12T
Document-inError4421x12850005010X12_InPARTNER_TME_TEST512478785AttributeError: 'list' object has no attribute 'partition' us-asciiapplication/X12850005010_OdooT


Setting log_level to DEBUG does not give me more information.

20171213 10:55:04 INFO     engine : served at port: "8080".
20171213 10:55:04 INFO     engine : platform: "Linux-4.4.0-103-generic-x86_64-with-Ubuntu-16.04-xenial".
20171213 10:55:04 INFO     engine : machine: "x86_64".
20171213 10:55:04 INFO     engine : python version: "2.7.12".
20171213 10:55:04 INFO     engine : django version: "(1, 7, 11, 'final', 0)".
20171213 10:55:04 INFO     engine : bots version: "3.2.0".
20171213 10:55:04 INFO     engine : bots installation path: "/usr/local/lib/python2.7/dist-packages/bots".
20171213 10:55:04 INFO     engine : config path: "/usr/local/lib/python2.7/dist-packages/bots/config".
20171213 10:55:04 INFO     engine : botssys path: "/usr/local/lib/python2.7/dist-packages/bots/botssys".
20171213 10:55:04 INFO     engine : usersys path: "/usr/local/lib/python2.7/dist-packages/bots/usersys".
20171213 10:55:04 INFO     engine : DATABASE_ENGINE: "django.db.backends.postgresql_psycopg2".
20171213 10:55:04 INFO     engine : DATABASE_NAME: "botsdb".
20171213 10:55:04 INFO     engine : DATABASE_USER: "bots".
20171213 10:55:04 INFO     engine : DATABASE_HOST: "127.0.0.1".
20171213 10:55:04 INFO     engine : DATABASE_PORT: "5432".
20171213 10:55:04 INFO     engine : DATABASE_OPTIONS: "{}".
20171213 10:55:04 INFO     engine : Connected to database.
20171213 10:55:04 DEBUG    engine : No import of module "/usr/local/lib/python2.7/dist-packages/bots/usersys/routescripts/botsengine": No module named botsengine.
20171213 10:55:04 INFO     engine : Run "new".
20171213 10:55:04 INFO     engine : Run active routes from database that are in default run: "[u'Partner_850_Odoo']".
20171213 10:55:04 DEBUG    engine : No import of module "/usr/local/lib/python2.7/dist-packages/bots/usersys/routescripts/Partner_850_Odoo": No module named Partner_850_Odoo.
20171213 10:55:04 INFO     engine : Running route Partner_850_Odoo 1
20171213 10:55:04 DEBUG    engine : Start communication channel "Partner_In" type file in.
20171213 10:55:04 DEBUG    engine : No import of module "/usr/local/lib/python2.7/dist-packages/bots/usersys/communicationscripts/Partner_In": No module named Partner_In.
20171213 10:55:04 DEBUG    engine : Finished communication channel "Partner_In" type file in.
20171213 10:55:04 DEBUG    engine : Start preprocessing "mailbag" for file "440".
20171213 10:55:04 DEBUG    engine :         File written: "442".
20171213 10:55:04 DEBUG    engine : OK preprocessing "mailbag" for file "440".
20171213 10:55:04 DEBUG    engine : No import of module "/usr/local/lib/python2.7/dist-packages/bots/usersys/mappings/translation": No module named translation.
20171213 10:55:04 DEBUG    engine : Start translating file "442" editype "x12" messagetype "x12".
20171213 10:55:04 DEBUG    engine : Imported "/usr/local/lib/python2.7/dist-packages/bots/usersys/grammars/x12/x12".
20171213 10:55:04 DEBUG    engine : Read edi file "442".
20171213 10:55:04 DEBUG    engine : Imported "/usr/local/lib/python2.7/dist-packages/bots/usersys/grammars/x12/850005010".
20171213 10:55:04 DEBUG    engine : Imported "/usr/local/lib/python2.7/dist-packages/bots/usersys/grammars/x12/x12".
20171213 10:55:04 DEBUG    engine : Mappingscript "850005010_Odoo" translates messagetype "850005010" to messagetype "OdooSaleOrder".
20171213 10:55:04 DEBUG    engine : Imported "/usr/local/lib/python2.7/dist-packages/bots/usersys/mappings/x12/850005010_Odoo".
20171213 10:55:04 DEBUG    engine : Run userscript "main" in "/usr/local/lib/python2.7/dist-packages/bots/usersys/mappings/x12/850005010_Odoo".
20171213 10:55:04 DEBUG    engine : Mappingscript "850005010_Odoo" finished.
20171213 10:55:04 DEBUG    engine : Start writing output file editype "json" messagetype "OdooSaleOrder".
20171213 10:55:04 DEBUG    engine : Imported "/usr/local/lib/python2.7/dist-packages/bots/usersys/grammars/json/OdooSaleOrder".
20171213 10:55:04 DEBUG    engine : No import of module "/usr/local/lib/python2.7/dist-packages/bots/usersys/partners/json/ME_TEST": No module named ME_TEST.
20171213 10:55:04 DEBUG    engine : Translated input file "442".
20171213 10:55:04 DEBUG    engine : Finished route Partner_850_Odoo 1
20171213 10:55:04 INFO     engine : Bots Report; type: new, time: 2017-12-13 10:55:04
    1 files received/processed in run.
    1 files with errors,
    0 files send in run.

Bots engine indicates it started writing the output file, but I can't find any trace of this file, including botssys/data. In this folder only edi files (incoming)

Any clue, please?

Eppye Bots

unread,
Dec 13, 2017, 6:18:07 AM12/13/17
to 'Chuck Turco' via Bots Open Source EDI Translator
please turn on debug (in config/bots.ini) see what the error is.
there is a page in the wiki about debugging etc, please use it.

kind regards,
henk-jan ebbers

--
You received this message because you are subscribed to the Google Groups "Bots Open Source EDI Translator" group.
To unsubscribe from this group and stop receiving emails from it, send an email to botsmail+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/botsmail.
For more options, visit https://groups.google.com/d/optout.



--
kind regards,
henk-jan ebbers

Maxime MARAIS

unread,
Dec 13, 2017, 8:07:53 AM12/13/17
to Bots Open Source EDI Translator
Henk-Jan,

Thanks, once more, these speedy answers.

For info, here is the stack trace:

Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/bots/transform.py", line 123, in _translate_one_file handle_out_message(out_translated,ta_translated) File "/usr/local/lib/python2.7/dist-packages/bots/transform.py", line 207, in handle_out_message out_translated.writeall() #write result of translation. File "/usr/local/lib/python2.7/dist-packages/bots/outmessage.py", line 92, in writeall self.checkmessage(self.root,self.defmessage) File "/usr/local/lib/python2.7/dist-packages/bots/message.py", line 98, in checkmessage self._checkonemessage(node_instance,defmessage,subtranslation) File "/usr/local/lib/python2.7/dist-packages/bots/message.py", line 109, in _checkonemessage self._canonicaltree(node_instance,structure[0]) File "/usr/local/lib/python2.7/dist-packages/bots/message.py", line 177, in _canonicaltree self._canonicalfields(node_instance,structure) #handle fields of this record File "/usr/local/lib/python2.7/dist-packages/bots/message.py", line 212, in _canonicalfields noderecord[field_definition[ID]] = self._formatfield(value,field_definition,record_definition,node_instance) File "/usr/local/lib/python2.7/dist-packages/bots/outmessage.py", line 327, in _formatfield digits,decimalsign,decimals = absvalue.partition('.') AttributeError: 'list' object has no attribute 'partition'

I will now try to figure out what's wrong.

Thanks again.
To unsubscribe from this group and stop receiving emails from it, send an email to botsmail+u...@googlegroups.com.

Eppye Bots

unread,
Dec 13, 2017, 8:34:02 AM12/13/17
to 'Chuck Turco' via Bots Open Source EDI Translator
instead of a value (numerical) you seem to be putting a list....


To unsubscribe from this group and stop receiving emails from it, send an email to botsmail+unsubscribe@googlegroups.com.

Maxime MARAIS

unread,
Dec 15, 2017, 2:33:23 AM12/15/17
to bots...@googlegroups.com
Henk-Jan,

That's right. :) It's now fixed. Thanks for helping me.

--
You received this message because you are subscribed to a topic in the Google Groups "Bots Open Source EDI Translator" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/botsmail/ZVi512rkv6Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to botsmail+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages