Issue 10251

Title
Crash when using wrong values on modify price wizard
Priority
bug
Status
resolved
Nosy list
pokoli, roundup-bot
Assigned to
pokoli
Keywords
review

Created on 2021-04-06.15:32:59 by pokoli, last changed 12 hours ago by roundup-bot.

Messages

New changeset 723a2a8b45b8 by Sergi Almacellas Abellana in branch '5.8':
Fallback to template on recompute price error message
https://hg.tryton.org/modules/stock/rev/723a2a8b45b8

New changeset fb821d2549b8 by Sergi Almacellas Abellana in branch '5.6':
Fallback to template on recompute price error message
https://hg.tryton.org/modules/stock/rev/fb821d2549b8
New changeset 97a2163ddb41 by Sergi Almacellas Abellana in branch 'default':
Fallback to template on recompute price error message
https://hg.tryton.org/tryton-env/rev/97a2163ddb41
New changeset 31d952c5014c by Sergi Almacellas Abellana in branch 'default':
Fallback to template on recompute price error message
https://hg.tryton.org/modules/stock/rev/31d952c5014c
Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2021-04-06.15:38:31

Indeed it's the modify cost price wizard but not the recompute

Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2021-04-06.15:32:59

Steps to reproduce:

  1. Create a new product
  2. Use the recompute cost wizard to update it's cost (from product.template menu)
  3. Enter 0 as value

The following exception is raised:

Traceback (most recent call last):
  File "/trytond/modules/stock/product.py", line 1130, in check_cost_price
    raise ValueError
ValueError

During handling of the above exception, another exception occurred:

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 156, 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/wizard/wizard.py", line 314, in execute
    return wizard._execute(state_name)
  File "/trytond/wizard/wizard.py", line 345, in _execute
    result = self._execute(transition())
  File "/trytond/modules/stock/product.py", line 1041, in transition_modify
    Revision.save(revisions)
  File "/trytond/model/descriptors.py", line 33, in newfunc
    return self.func(owner, *args, **kwargs)
  File "/trytond/model/modelstorage.py", line 1782, in save
    news = cls.create([save_values[r] for r in to_create])
  File "/trytond/model/modelsql.py", line 159, in wrapper
    return func(cls, *args, **kwargs)
  File "/trytond/model/modelsql.py", line 679, in create
    cls._validate(sub_records)
  File "/trytond/model/modelstorage.py", line 79, in wrapper
    return func(*args, **kwargs)
  File "/trytond/model/modelstorage.py", line 87, in wrapper
    return func(*args, **kwargs)
  File "/trytond/model/modelstorage.py", line 1386, in _validate
    cls.validate(records)
  File "/trytond/modules/stock/product.py", line 1125, in validate
    revision.check_cost_price()
  File "/trytond/modules/stock/product.py", line 1135, in check_cost_price
    product=self.product.rec_name,
AttributeError: 'NoneType' object has no attribute 'rec_name'
History
Date User Action Args
2021-04-10 01:44:23roundup-botsetkeyword: - backport
messages: + msg66265
2021-04-08 15:47:55roundup-botsetmessages: + msg66179
2021-04-08 15:47:51roundup-botsetmessages: + msg66178
nosy: + roundup-bot
status: testing -> resolved
2021-04-07 00:42:35cedsetkeyword: + backport
2021-04-06 15:38:31pokolisetmessages: + msg66137
title: Crash when using wrong values on recompute price wizard -> Crash when using wrong values on modify price wizard
2021-04-06 15:34:20pokolisetkeyword: + review
reviews: 320811002
status: unread -> testing
2021-04-06 15:32:59pokolicreate

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