Issue 10325

Title
Cannot convert when mixing unit of measure in components
Priority
bug
Status
resolved
Nosy list
2cadz, ced, reviewbot, roundup-bot
Assigned to
ced
Keywords
review

Created on 2021-04-21.19:26:17 by 2cadz, last changed 2 weeks ago by roundup-bot.

Files

File name Uploaded Type Details
scenario_product_kit_sale.rst 2cadz, 2021-04-22.10:13:42 text/x-rst view
scenario_product_kit_sale.rst 2cadz, 2021-04-22.08:53:54 text/x-rst view

Messages

New changeset 40bedf5991bd by Cédric Krier in branch 'default':
Convert quantity into parent uom
https://hg.tryton.org/tryton-env/rev/40bedf5991bd
New changeset 64f771e3f4c0 by Cédric Krier in branch 'default':
Convert quantity into parent uom
https://hg.tryton.org/modules/product_kit/rev/64f771e3f4c0
Author: [hidden] (2cadz)
Date: 2021-04-22.10:13:42

Oups, wrong file :-(

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-04-22.10:09:59

file2884 is exactly the same scenario as in the module which does not fail.

Author: [hidden] (2cadz)
Date: 2021-04-22.08:53:54

I cannot upload to your issue.
Linked my rst file which reproduce the bug.

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-04-21.23:44:05

I tried to reproduce the problem with review334231002 but I could not.

Author: [hidden] (2cadz)
Date: 2021-04-21.19:26:17

If in a kit we have different units, here units and lengths we have this error message when confirming the sale.

Traceback (most recent call last):
  File "/trytond/wsgi.py", line 116, in dispatch_request
    return endpoint(request, **request.view_args)
  File "/trytond/protocols/dispatcher.py", line 48, in rpc
    request, database_name, *request.rpc_params)
  File "/trytond/wsgi.py", line 83, in auth_required
    return wrapped(*args, **kwargs)
  File "/trytond/protocols/wrappers.py", line 136, in wrapper
    return func(request, pool, *args, **kwargs)
  File "/trytond/protocols/dispatcher.py", line 181, in _dispatch
    result = rpc.result(meth(*c_args, **c_kwargs))
  File "/trytond/model/modelview.py", line 773, in wrapper
    return func(cls, records, *args, **kwargs)
  File "/trytond/model/workflow.py", line 37, in wrapper
    result = func(cls, filtered, *args, **kwargs)
  File "/trytond/modules/product_kit/common.py", line 103, in quote
    removed.extend(record.set_components())
  File "/trytond/modules/product_kit/common.py", line 125, in set_components
    components.append(line.get_component(component))
  File "/trytond/modules/product_kit/common.py", line 188, in get_component
    Component, self.quantity, self.unit, **kwargs)
  File "/trytond/modules/product_kit/product.py", line 148, in get_line
    unit, quantity, self.product.default_uom, round=False)
  File "/trytond/modules/product/uom.py", line 204, in compute_qty
    % (from_uom.category.name, to_uom.category.name))
ValueError: cannot convert between Unités and Longueur without a factor or rate

Fault: cannot convert between Unités and Longueur without a factor or rate
History
Date User Action Args
2021-04-25 17:52:58roundup-botsetmessages: + msg66946
2021-04-25 17:52:54roundup-botsetmessages: + msg66945
nosy: + roundup-bot
status: testing -> resolved
2021-04-22 11:13:01reviewbotsetmessages: + msg66825
2021-04-22 10:43:49cedsetassignedto: ced
status: need-eg -> testing
2021-04-22 10:13:422cadzsetfiles: + scenario_product_kit_sale.rst
messages: + msg66823
2021-04-22 10:09:59cedsetmessages: + msg66822
2021-04-22 08:53:542cadzsetfiles: + scenario_product_kit_sale.rst
messages: + msg66820
2021-04-21 23:51:22reviewbotsetmessages: + msg66799
nosy: + reviewbot
2021-04-21 23:44:05cedsetkeyword: + review
messages: + msg66791
nosy: + ced
reviews: 334231002
status: unread -> need-eg
2021-04-21 19:41:58cedsettitle: When mixing unit of measure in components ... -> Cannot convert when mixing unit of measure in components
type: crash

Showing 10 items. Show all history (warning: this could be VERY long)