-
- Downloads
[FIX] mrp_subcontracting_account: update inventory valuation
When buying a subcontracted product, if the inventory valuation of the product category is automated, the product delivery does not create a new journal entry, i.e. the automated inventory valuation is not done. To reproduce the error: (Need account_accountant,purchase) 1. In Settings, enable "Subcontracting" 2. Create a product category PC - Parent: All - Inventory Valuation: Automated 3. Create a product P - Must be storable - In category PC - Set a positive cost 4. Add a BoM to P - Type: Subcontracting 5. Create a RfQ - Vendor: BoM's subcontractor - Product: P 6. Confirm & Receive Products 7. Go to Accounting > Accounting > Miscellaneous > Journal Entries Error: There isn't any journal entry about the new product. This is an error because the inventory valuation for this product is automated, so there should be a line with the P-product and the cost set on step 3. When validating the delivery, the server checks the stock move lines considered as incoming: https://github.com/odoo/odoo/blob/5098cb25accce91347760cbd2f6427c07265fa00/addons/stock_account/models/stock_move.py#L61-L65 Problem is that `_should_be_valued` for subcontractor's location returns `True`, therefore the stock move line will not be added. => The `mrp_subcontracting` module needs to add a condition: A location can be valued if it is not subcontractor's location. OPW-2446298 closes odoo/odoo#65696 Signed-off-by:Adrien Widart <adwid@users.noreply.github.com>
Showing
- addons/mrp_subcontracting_account/models/__init__.py 1 addition, 0 deletionsaddons/mrp_subcontracting_account/models/__init__.py
- addons/mrp_subcontracting_account/models/stock_location.py 15 additions, 0 deletionsaddons/mrp_subcontracting_account/models/stock_location.py
- addons/mrp_subcontracting_account/tests/test_subcontracting_account.py 2 additions, 2 deletions...bcontracting_account/tests/test_subcontracting_account.py
Please register or sign in to comment