We can save the cost values only when a cost value was computed for a product
already moved.
Also FIFO requires to save extra moves which can be included in the save loop
so the Move._do method returns an extra list of moves to save.
issue10640
review369361002
This is the same test done in Move._compute_product_cost_price. When the stock
quantity is below zero, the average cost price should not change.
And we process the incoming move first in order to keep quantity positive
where possible.
issue9484
review325801002
When there is no quantity in stock, we keep the last cost price instead of
setting it to zero. This gives the same behavior between on move computation
and on product recomputation.
issue9443
review317771007
We must consider any incoming moves (ex: inventory) for the computation of the
FIFO otherwise the back computation to find first in moves does not pick enough
moves. As not all incoming moves have a unit price, we use the current cost
price as fallback.
Also in re-computation, the in or out move test should only rely on the storage
location usage in order to properly compute the average cost.
issue9274
review321471002
We add a common method to round prices that are stored using the price digits.
It is useless to use the digits from the field because it can not be changed in
any other way than by configuration.
issue9146
review299521002
We add the flake8 configuration used so we ensure everyone uses the same.
We remove the usage of __all__ for non public API.
When possible, we rationalize the class name according to its __name__ and module.
issue9082
review297061002
The "Modify Cost Price" wizard create a revision record for each template or
product. The cost price re-computation methods apply those revisions at the
beginning of their date.
The stock accounting move is created and posted when the cost price is modified
by the re-computation.
issue8930
review260751002