Issue 10972

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

Created on 2021-11-22.12:47:37 by acaubet, last changed 4 months ago by roundup-bot.

Messages

New changeset 7483efadec76 by Cédric Krier in branch '6.2':
Convert unit_price_company from product uom to move uom
https://hg.tryton.org/modules/account_stock_continental/rev/7483efadec76

New changeset 09ebec6d2d0e by Cédric Krier in branch '6.0':
Convert unit_price_company from product uom to move uom
https://hg.tryton.org/modules/account_stock_continental/rev/09ebec6d2d0e

New changeset d230c643b0ed by Cédric Krier in branch '5.0':
Convert unit_price_company from product uom to move uom
https://hg.tryton.org/modules/account_stock_continental/rev/d230c643b0ed
New changeset 5e73dcbf2e18 by Cédric Krier in branch 'default':
Convert unit_price_company from product uom to move uom
https://hg.tryton.org/tryton-env/rev/5e73dcbf2e18
New changeset 20d76675d09f by Cédric Krier in branch 'default':
Convert unit_price_company from product uom to move uom
https://hg.tryton.org/modules/account_stock_continental/rev/20d76675d09f

New changeset 41ced2658d33 by Cédric Krier in branch 'default':
Test with different units of measure
https://hg.tryton.org/modules/account_stock_continental/rev/41ced2658d33
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
2022-01-22 21:17:15roundup-botsetkeyword: - backport
messages: + msg73399
2022-01-20 19:06:14roundup-botsetmessages: + msg73357
2022-01-20 19:06:08roundup-botsetmessages: + msg73356
nosy: + roundup-bot
status: testing -> resolved
2022-01-10 23:22:00reviewbotsetmessages: + msg73188
2022-01-10 22:55:56cedsetassignedto: acaubet -> ced
2021-12-01 10:57:41reviewbotsetmessages: + msg71957
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

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