Fail install product module convertion values from xml
I get on 3.6 version, with new database just it trying to install product module.
I added prints (uom.py line 149) for found problem occurs processing uom.xml, of course somehting is wrong on convertion xml to value, because for example for Gram factor is 0.001 on xml but tryton read 0.0:
----------------
print self.name -> Unit
print self.rate -> 1.0
print self.factor -> 1.0
----------------
Kilogram
1.0
1.0
----------------
Gram
1000.0
0.0
4716 140031923037952 [2015-06-10 22:02:08,998] INFO trytond.modules product:register product.product
4716 140031923037952 [2015-06-10 22:02:09,432] INFO trytond.modules product:loading product.xml
4716 140031923037952 [2015-06-10 22:02:10,331] INFO trytond.modules product:loading category.xml
4716 140031923037952 [2015-06-10 22:02:10,732] INFO trytond.modules product:loading uom.xml
4716 140031923037952 [2015-06-10 22:02:11,251] ERROR trytond.convert Error while parsing xml file:
In tag record: model product.uom with id uom_gram.
Traceback (most recent call last):
File "/home/psk/.virtualenvs/tryton36/local/lib/python2.7/site-packages/trytond/convert.py", line 445, in parse_xmlstream
self.sax_parser.parse(source)
File "/usr/lib/python2.7/xml/sax/expatreader.py", line 107, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/usr/lib/python2.7/xml/sax/xmlreader.py", line 123, in parse
self.feed(buffer)
File "/usr/lib/python2.7/xml/sax/expatreader.py", line 210, in feed
self._parser.Parse(data, isFinal)
File "/usr/lib/python2.7/xml/sax/expatreader.py", line 307, in end_element
self._cont_handler.endElement(name)
File "/home/psk/.virtualenvs/tryton36/local/lib/python2.7/site-packages/trytond/convert.py", line 507, in endElement
self.taghandler = self.taghandler.endElement(name)
File "/home/psk/.virtualenvs/tryton36/local/lib/python2.7/site-packages/trytond/convert.py", line 287, in endElement
self.model.__name__, self.values, self.xml_id)
File "/home/psk/.virtualenvs/tryton36/local/lib/python2.7/site-packages/trytond/convert.py", line 693, in import_record
self.create_records(model, [values], [fs_id])
File "/home/psk/.virtualenvs/tryton36/local/lib/python2.7/site-packages/trytond/convert.py", line 699, in create_records
records = Model.create(vlist)
File "/home/psk/.virtualenvs/tryton36/local/lib/python2.7/site-packages/trytond/model/modelsql.py", line 508, in create
cls._validate(sub_records)
File "/home/psk/.virtualenvs/tryton36/local/lib/python2.7/site-packages/trytond/model/modelstorage.py", line 1121, in _validate
cls.validate(records)
File "/home/psk/.virtualenvs/tryton36/local/lib/python2.7/site-packages/trytond/modules/product/uom.py", line 143, in validate
uom.check_factor_and_rate()
File "/home/psk/.virtualenvs/tryton36/local/lib/python2.7/site-packages/trytond/modules/product/uom.py", line 154, in check_factor_and_rate
1.0 / self.factor, self.__class__.rate.digits[1])
ZeroDivisionError: float division by zero
4716 140031923037952 [2015-06-10 22:02:11,257] ERROR trytond.protocols.dispatcher wizard.ir.module.module.install_upgrade.execute(*(3, {'start': {'module_info': 'product: to install', 'id': -2}}, 'upgrade', {'date_format': '%m/%d/%Y', 'language': 'en_US', 'locale': {'date': '%m/%d/%Y', 'thousands_sep': ',', 'decimal_point': '.', 'grouping': [3, 3, 0]}, 'language_direction': 'ltr', 'active_model': 'ir.module.module', 'groups': [1], 'active_ids': [33], 'action_id': 40, 'active_id': 33}), **{}) from 1@::ffff:192.168.1.62:51553/TESTX01
Traceback (most recent call last):
File "/home/psk/.virtualenvs/tryton36/local/lib/python2.7/site-packages/trytond/protocols/dispatcher.py", line 158, in dispatch
result = rpc.result(meth(*c_args, **c_kwargs))
File "/home/psk/.virtualenvs/tryton36/local/lib/python2.7/site-packages/trytond/wizard/wizard.py", line 252, in execute
return wizard._execute(state_name)
File "/home/psk/.virtualenvs/tryton36/local/lib/python2.7/site-packages/trytond/wizard/wizard.py", line 283, in _execute
result = self._execute(transition())
File "/home/psk/.virtualenvs/tryton36/local/lib/python2.7/site-packages/trytond/ir/module/module.py", line 534, in transition_upgrade
pool.init(update=update, lang=lang)
File "/home/psk/.virtualenvs/tryton36/local/lib/python2.7/site-packages/trytond/pool.py", line 155, in init
lang=lang)
File "/home/psk/.virtualenvs/tryton36/local/lib/python2.7/site-packages/trytond/modules/__init__.py", line 422, in load_modules
_load_modules()
File "/home/psk/.virtualenvs/tryton36/local/lib/python2.7/site-packages/trytond/modules/__init__.py", line 384, in _load_modules
load_module_graph(graph, pool, update, lang)
File "/home/psk/.virtualenvs/tryton36/local/lib/python2.7/site-packages/trytond/modules/__init__.py", line 247, in load_module_graph
tryton_parser.parse_xmlstream(fp)
File "/home/psk/.virtualenvs/tryton36/local/lib/python2.7/site-packages/trytond/convert.py", line 445, in parse_xmlstream
self.sax_parser.parse(source)
File "/usr/lib/python2.7/xml/sax/expatreader.py", line 107, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/usr/lib/python2.7/xml/sax/xmlreader.py", line 123, in parse
self.feed(buffer)
File "/usr/lib/python2.7/xml/sax/expatreader.py", line 210, in feed
self._parser.Parse(data, isFinal)
File "/usr/lib/python2.7/xml/sax/expatreader.py", line 307, in end_element
self._cont_handler.endElement(name)
File "/home/psk/.virtualenvs/tryton36/local/lib/python2.7/site-packages/trytond/convert.py", line 507, in endElement
self.taghandler = self.taghandler.endElement(name)
File "/home/psk/.virtualenvs/tryton36/local/lib/python2.7/site-packages/trytond/convert.py", line 287, in endElement
self.model.__name__, self.values, self.xml_id)
File "/home/psk/.virtualenvs/tryton36/local/lib/python2.7/site-packages/trytond/convert.py", line 693, in import_record
self.create_records(model, [values], [fs_id])
File "/home/psk/.virtualenvs/tryton36/local/lib/python2.7/site-packages/trytond/convert.py", line 699, in create_records
records = Model.create(vlist)
File "/home/psk/.virtualenvs/tryton36/local/lib/python2.7/site-packages/trytond/model/modelsql.py", line 508, in create
cls._validate(sub_records)
File "/home/psk/.virtualenvs/tryton36/local/lib/python2.7/site-packages/trytond/model/modelstorage.py", line 1121, in _validate
cls.validate(records)
File "/home/psk/.virtualenvs/tryton36/local/lib/python2.7/site-packages/trytond/modules/product/uom.py", line 143, in validate
uom.check_factor_and_rate()
File "/home/psk/.virtualenvs/tryton36/local/lib/python2.7/site-packages/trytond/modules/product/uom.py", line 150, in check_factor_and_rate
1.0 / self.factor, self.__class__.rate.digits[1])
ZeroDivisionError: float division by zero