When working with product variants, if the error which gets displayed does not include the product attributes, it's harder to identify the variant with the error.
closesodoo/odoo#27298
In the case where the user forces a sale with a negative product quantity on
hand, then the average price update might divide by zero.
We guard against this case.
opw 1886967
closesodoo/odoo#27232
- Create a Customer location (CL) and set a Company on it
- Configure Product A in FIFO / Perpetual
- Receive 2 Unit(s) of A in Stock
- Create an Internal Transfer
1 Unit(s) of Product A
Source location: Stock
Destination Location: CL
- Validate
The Inventory Valuation report incorrectly retrieves a quantity of 2 in
stock instead of 1.
The error is first due to a misconfiguration: the CL should not have a
Company set. However, we should not take into account any quantity in a
customer location, even if there is a Company set.
opw-1884675
opw-1884835
closesodoo/odoo#27145
- Set a product with real-time valuation
- Create a SO, select the Drop Ship route
- Validate the SO, the PO, and receive the picking
=> an accounting entry is created
- Return the picking
The reversed accounting entry is not created.
This is because the return of a drop ship picking is not recognized as
some kind of dropshipping.
opw-1879117
When clicking on "Inventory valuation" in Stock module, the display name
of the variants didn't appear. So with a product template with several
variants, all the variants had the same name in the inventory valuation.
opw:1879572
The to_refund attribute is set to copy=False.
However when splitting a move to create a backorder, a new move is created as
a copy with the remaining work to do.
This attribute is needed so that the backorder refund is consistently applied.
opw 1865324
Courtesy of Juan José Scarafía, ADHOC
The quality of the Spanish (Argentina) translations is very poor.
Remove them all and will start from scratch, translating only when needed.
When trying to click on "Mark as Done" on a MO with raw materials in a category
with automated fifo valuation, it raised in some a case (in function called
"_prepare_account_move_line") a user error saying:
"The cost of the product P is currently equal to 0. Change the cost or the
configuration of your product to avoid an incorrect valuation"
This problem coming from the fact that in some cases, self.price_unit was
equal to 1.04166666666667e-06 instead of 0
opw:1862153, 1866692
When the initial inventory adjustement is made after the accounting
openeing entry, no AML is created with the initial quantities. The
valuation report is therefore wrong.
Partial revert of 21099f3eaf. Although the existing solution
has also flaws, the fix highlights them even more.
opw-1859204
- Change the one of the following default account on a product category:
Stock Input Account
Stock Output Account
Stock Valuation Account
- Upgrade stock_account
The account is changed back to the default value.
This was due to commit 1bf25fc018 which attempted to solve an error
in a test.
We fix the test by making sure we check the right accounts. We also make
sure to avoid creating 2 identical `ir.properties` (one `False`, the
other with a value). We only update the property if it is `False`.
opw-1859706
Issue 1
-------
- Set a product with:
Inventory Valuation: Manual
Costing Method: Average Cost (or Standard Price)
- Receive 1 unit @ 10, set an owner
In the 'Inventory Valuation' report, the product is valued @ 10 while no
accounting entry was created.
The system simply multiplies the available quantity by the cost price,
without taking into account the ownership of the quants.
Issue 2
-------
- Set a product with:
Inventory Valuation: Automated
Costing Method: Average Cost (or Standard Price)
- Receive 1 unit @ 10, set an owner
In the 'Inventory Valuation' report, the product is valued @ 10 while no
accounting entry was created.
Once again, the system simply multiplies the available quantity by the
cost price, without taking into account the AML.
Solution
--------
A slight refactoring of the `_compute_stock_value` method is necessary
to make consistent the the FIFO computation and the Standard / Average
method:
- in case of manual valuation, the quantity on stock moves are taken
into account
- in case of perpetual valuation, the quantity on AMLs is taken into
account
The method `_compute_quantities_dict` needs a minor change so a `False`
value can be handled correctly.
The FIFO method is slightly changed:
- the quantity at date takes into account the owner
- in case of perpetual valuation, AMLs are used instead of stock moves
Bonus point: an error was discovered in `_create_account_move_line`
thanks to the test `test_change_cost_method_1`. The forced quantity
should follow the same sign logic than the product quantity.
opw-1849535
Somehow the function treated multiple records with
the new api translation from 9 to 10.
Steps to reproduce:
This applies to delivery orders and manufacturing orders. As an example:
Create an MO with 2 products on the BOM
Both products must have real time costing with FIFO
The first product on the bom must not be available
For the second product on the BOM, the standard_price must be different from the cost of the next quant to be consumed
Complete the MO, letting the first product result in a negative quant
Current behavior:
The standard_price of the second product on the BOM does not get updated.
Behavior after this fix:
The standard_price of the second product on the BOM gets updated.
Thanks to matt454357.
- Create a product where the associated product category has Costing
Method "Average Cost (AVCO)"
- Create a PO. Order 1 unit at $1000.
- Receive that unit. (System now has 1 unit at $1000).
- Create another PO. Order 3 units at $500 each.
- Receive only 1 unit and don’t create any back order.
System has 2 units @ $625, instead of $750.
The quantity computed should take into account the quantity actually
done.
opw-1843998
- Set the system parameter "stock.propagate_uom" to 1.
- Create a Sale Order with a product (1 Dozen).
- Confirm the Sale Order
- Validate the stock picking with 1 Dozen of quantity done.
- See the stock move form.
The value of the stock move is the price unit and not the correct value
because the amount is computed by the quantity_done (1) and not
12 Units.
Closes#24352
opw-1838335
When validating a delivery order with automated inventory,
some accounting moves are created.
Since an inventory user might not have accounting rights,
the validation of delivery orders might fail.
We simply had a sudo when in the internal method creating the move.
Moreover if the inventory valuation is set in FIFO,
the product price might be updated.
It might fail for lack of additional rights.
We add a sudo for this price update.
opw 1836761