Hi all,
I ran into a little problem last night when entering a sales order and trying to proces the shipment.
I keep getting "the cost of xxxxx is 0, set the cost price of this product of change the settings for a correct inventory valuation"
My inventory valuation on all categories is set to automated and FIFO. So i can't set a product cost manually. It's only happening on this variation of this product (so far) I have sales with 2 other variations of the same product with no issues and I can see a cost there.
I tried a sale with another variation of the same product which has no previous sales (like the one with the problem) and it passed without issues, showing a cost price afterwards.
By the way, is it normal that cost is set to 0 if no sales of a product have occured? So it's always showing the cost of the last product sold. No problem when doing average cost but with FIFO the cost can change from 1 sale to another depending on the purchase value, so it's showing incorrect margin values on the sales order.
I tried to bypass the problem byt doing a manual inventory adjustment but it wouldn't let me, giving the same error. I could however set it to 0 and then to the new value. Then it gave a whole different total value (too high) so I used the stock_inventory_revaluation plugin to change it back. This worked and the product variation now showed a cost price.
So I tried a sale with the same product again which resulted in the same error: cost price is 0.
Could this be a case of data corruption? Or some weird bug?
I'm using Odoo 12 Community on Ubuntu18.04.4 LTS