Tryton - Issues

 

Message58915

Author bernatnan
Recipients ced, reviewbot
Date 2020-06-30.19:13:58
Content
Sorry, that's not what I'm trying to explain on the comment that trigger this issue (from https://codereview.tryton.org/327491003/diff/315661002/modules/stock/move.py?context=10&column_width=80). I suppose that I haven't explained well.

The problem is that when you make a sale with all the remaining stock that you have, when "do" de move and the product stock become 0, the price not become 0€, it's remain like the cost_price of the move. So the problem is not in the "recompute_cost_price_fifo" function, it's in the move.py, and for me the solutions will be in the "_compute_product_cost_price" function, that it's in "stock" module, move.py file:

Replacing the 498 line for:

if product_qty + qty == 0:
    new_cost_price = Decimal(0)
elif product_qty + qty > 0 and product_qty >= 0:
History
Date User Action Args
2020-06-30 19:13:59bernatnansetmessageid: <1593537239.14.0.523637049097.issue9443@tryton.org>
2020-06-30 19:13:59bernatnansetrecipients: + ced, reviewbot
2020-06-30 19:13:59bernatnanlinkissue9443 messages
2020-06-30 19:13:58bernatnancreate

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