Issue 10972

Title
Not computing price based on uoms when product is not fixed
Priority
bug
Status
testing
Nosy list
acaubet, ced, reviewbot
Assigned to
acaubet
Keywords
backport, review

Created on 2021-11-22.12:47:37 by acaubet, last changed 2 days ago by reviewbot.

Messages

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-11-22.16:21:25

For me it is because it replaced the unit_price which is in move uom by the unit_price_company which is in product default uom.

Author: [hidden] (acaubet)
Date: 2021-11-22.16:02:27

Indeed this was introduced by rev c7da1bc65008

Don't think that this rev is the problem, the mentioned rev only adapts to company currency, the problem was that compute_price it's done only on else, and that happens before the rev.

Author: [hidden] (acaubet)
Date: 2021-11-22.14:22:15

Not since you asked for two reasons:
* I expect a unit_price to be in the unit of default_uom.
* Other use cases in my understanding should be covered with tests.

I'm not an accounting expert but I don't see any potential error as use cases are small.
1. I only see unit_price_company called in account_stock_continental, so for me no other modules use this.
2. Is defined on stock module.
* Nothing calls me the attention there.
3. It's overwritten on product_cost_warehouse module.
* As my understanding, this only sets the cost for each warehouse.
* Not sure if cost_price is also needing a compute_price? cost += qty * outgoing_move.cost_price

Did I miss anything?

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-11-22.13:54:42

Indeed this was introduced by rev c7da1bc65008

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-11-22.13:50:49

Did you review all use cases of unit_price_company?

Author: [hidden] (acaubet)
Date: 2021-11-22.12:47:37

Doing a shipment supplier with products cost price methods different than fixed and purchase unit different than product default unit it's not computing correctly the price because it's not calling Uom.compute_price().

History
Date User Action Args
2021-11-26 09:37:26reviewbotsetmessages: + msg71863
2021-11-23 10:35:31reviewbotsetmessages: + msg71782
2021-11-22 16:21:25cedsetmessages: + msg71781
2021-11-22 16:02:27acaubetsetmessages: + msg71779
2021-11-22 14:32:49cedsetkeyword: + backport
2021-11-22 14:22:15acaubetsetkeyword: - backport
messages: + msg71777
2021-11-22 13:54:42cedsetkeyword: + backport
messages: + msg71775
2021-11-22 13:50:49cedsetmessages: + msg71774
nosy: + ced
2021-11-22 13:06:44reviewbotsetmessages: + msg71772
nosy: + reviewbot
2021-11-22 12:47:51acaubetsetkeyword: + review
reviews: 385391002
status: in-progress -> testing
2021-11-22 12:47:37acaubetcreate