El 13/04/18 a les 00:32, Richmond Fiko ha escrit:
> Hello,
>
> I try to make a localisation for West africa COA but I have this error on
> taxes.
>
>
> 1576 139907134330624 [2018-04-12 17:57:32,659] INFO trytond.modules
> syscohada_2018:loading account.xml
> 1576 139907134330624 [2018-04-12 17:57:56,624] INFO trytond.modules
> syscohada_2018:loading tax.xml
> 1576 139907134330624 [2018-04-12 17:57:57,349] ERROR trytond.convert Error
> while parsing xml file:
> In tag record: model account.tax.template with id vat_tax_4.
> Traceback (most recent call last):
> File
> "/home/gnuhealth/gnuhealth/tryton/server/trytond-4.2.10/trytond/convert.py",
> line 447, in parse_xmlstream
> self.sax_parser.parse(source)
> File "/usr/lib/python3.5/xml/sax/expatreader.py", line 110, in parse
> xmlreader.IncrementalParser.parse(self, source)
> File "/usr/lib/python3.5/xml/sax/xmlreader.py", line 125, in parse
> self.feed(buffer)
> File "/usr/lib/python3.5/xml/sax/expatreader.py", line 210, in feed
> self._parser.Parse(data, isFinal)
> File "../Modules/pyexpat.c", line 468, in EndElement
> File "/usr/lib/python3.5/xml/sax/expatreader.py", line 325, in end_element
> self._cont_handler.endElement(name)
> File
> "/home/gnuhealth/gnuhealth/tryton/server/trytond-4.2.10/trytond/convert.py",
> line 507, in endElement
> self.taghandler = self.taghandler.endElement(name)
> File
> "/home/gnuhealth/gnuhealth/tryton/server/trytond-4.2.10/trytond/convert.py",
> line 289, in endElement
> self.model.__name__, self.values, self.xml_id)
> File
> "/home/gnuhealth/gnuhealth/tryton/server/trytond-4.2.10/trytond/convert.py",
> line 693, in import_record
> self.create_records(model, [values], [fs_id])
> File
> "/home/gnuhealth/gnuhealth/tryton/server/trytond-4.2.10/trytond/convert.py",
> line 699, in create_records
> records = Model.create(vlist)
> File
> "/home/gnuhealth/gnuhealth/tryton/server/trytond-4.2.10/trytond/model/modelsql.py",
> line 533, in create
> insert_values.append(field.sql_format(value))
> File
> "/home/gnuhealth/gnuhealth/tryton/server/trytond-4.2.10/trytond/model/fields/numeric.py",
> line 32, in sql_format
> assert isinstance(value, Decimal)
> AssertionError
> Traceback (most recent call last):
> File
> "/home/gnuhealth/gnuhealth/tryton/server/trytond-4.2.10/bin/trytond-admin",
> line 21, in
> admin.run(options)
> File
> "/home/gnuhealth/gnuhealth/tryton/server/trytond-4.2.10/trytond/admin.py",
> line 53, in run
> pool.init(update=options.update, lang=list(lang))
> File
> "/home/gnuhealth/gnuhealth/tryton/server/trytond-4.2.10/trytond/pool.py",
> line 153, in init
> lang=lang)
> File
> "/home/gnuhealth/gnuhealth/tryton/server/trytond-4.2.10/trytond/modules/__init__.py",
> line 453, in load_modules
> _load_modules()
> File
> "/home/gnuhealth/gnuhealth/tryton/server/trytond-4.2.10/trytond/modules/__init__.py",
> line 422, in _load_modules
> load_module_graph(graph, pool, update, lang)
> File
> "/home/gnuhealth/gnuhealth/tryton/server/trytond-4.2.10/trytond/modules/__init__.py",
> line 259, in load_module_graph
> tryton_parser.parse_xmlstream(fp)
> File
> "/home/gnuhealth/gnuhealth/tryton/server/trytond-4.2.10/trytond/convert.py",
> line 447, in parse_xmlstream
> self.sax_parser.parse(source)
> File "/usr/lib/python3.5/xml/sax/expatreader.py", line 110, in parse
> xmlreader.IncrementalParser.parse(self, source)
> File "/usr/lib/python3.5/xml/sax/xmlreader.py", line 125, in parse
> self.feed(buffer)
> File "/usr/lib/python3.5/xml/sax/expatreader.py", line 210, in feed
> self._parser.Parse(data, isFinal)
> File "../Modules/pyexpat.c", line 468, in EndElement
> File "/usr/lib/python3.5/xml/sax/expatreader.py", line 325, in end_element
> self._cont_handler.endElement(name)
> File
> "/home/gnuhealth/gnuhealth/tryton/server/trytond-4.2.10/trytond/convert.py",
> line 507, in endElement
> self.taghandler = self.taghandler.endElement(name)
> File
> "/home/gnuhealth/gnuhealth/tryton/server/trytond-4.2.10/trytond/convert.py",
> line 289, in endElement
> self.model.__name__, self.values, self.xml_id)
> File
> "/home/gnuhealth/gnuhealth/tryton/server/trytond-4.2.10/trytond/convert.py",
> line 693, in import_record
> self.create_records(model, [values], [fs_id])
> File
> "/home/gnuhealth/gnuhealth/tryton/server/trytond-4.2.10/trytond/convert.py",
> line 699, in create_records
> records = Model.create(vlist)
> File
> "/home/gnuhealth/gnuhealth/tryton/server/trytond-4.2.10/trytond/model/modelsql.py",
> line 533, in create
> insert_values.append(field.sql_format(value))
> File
> "/home/gnuhealth/gnuhealth/tryton/server/trytond-4.2.10/trytond/model/fields/numeric.py",
> line 32, in sql_format
> assert isinstance(value, Decimal)
> AssertionError
>
The problem is that you are setting a non decimal value for a Numeric
field which exp