Issue 10791

Title
Crash when finishing production with a product with empty list price
Priority
bug
Status
resolved
Nosy list
pokoli, reviewbot, roundup-bot
Assigned to
pokoli
Keywords
review

Created on 2021-09-24.14:20:58 by pokoli, last changed 5 days ago by roundup-bot.

Messages

New changeset 461a3e91162c by Sergi Almacellas Abellana in branch 'default':
Show warning when output product's list price is empty
https://hg.tryton.org/tryton-env/rev/461a3e91162c
New changeset f1d5c4d5c93d by Sergi Almacellas Abellana in branch 'default':
Show warning when output product's list price is empty
https://hg.tryton.org/modules/production/rev/f1d5c4d5c93d
Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2021-09-24.14:20:58

Since issue10244 it is possible to have products wihtout list price.
But when using a product without list price on a production I get the following traceback:

Traceback (most recent call last):
  File "/trytond/wsgi.py", line 117, in dispatch_request
    return endpoint(request, **request.view_args)
  File "/trytond/protocols/dispatcher.py", line 47, in rpc
    return methods.get(request.rpc_method, _dispatch)(
  File "/trytond/wsgi.py", line 84, in auth_required
    return wrapped(*args, **kwargs)
  File "/trytond/protocols/wrappers.py", line 159, 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 774, 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/company/model.py", line 67, in wrapper
    result = func(cls, records, *args, **kwargs)
  File "/trytond/modules/production/production.py", line 736, in done
    cls.set_cost(productions)
  File "/trytond/modules/production/production.py", line 578, in set_cost
    product_price = (Decimal(str(output.quantity))
TypeError: unsupported operand type(s) for *: 'Decimal' and 'NoneType'
History
Date User Action Args
2021-10-13 11:08:46roundup-botsetmessages: + msg70987
2021-10-13 11:08:40roundup-botsetmessages: + msg70986
nosy: + roundup-bot
status: testing -> resolved
2021-10-08 10:07:22reviewbotsetmessages: + msg70758
2021-10-06 09:34:43reviewbotsetmessages: + msg70691
2021-10-05 09:04:51reviewbotsetmessages: + msg70653
2021-10-04 12:11:31reviewbotsetmessages: + msg70633
2021-09-24 14:27:52reviewbotsetmessages: + msg70383
nosy: + reviewbot
2021-09-24 14:22:41pokolisetkeyword: + review
reviews: 369771002
status: unread -> testing
2021-09-24 14:20:58pokolicreate

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