Nicolas Martinelli 21099f3eaf [FIX] stock, stock_account: valuation with owner
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
2018-06-07 08:30:04 +02:00
2017-11-30 16:03:58 +01:00
2018-05-30 10:44:38 +02:00
…
2017-12-12 17:19:01 +01:00
…
2015-09-08 17:58:38 +02:00
…
2017-10-11 11:38:36 +02:00
2017-10-12 08:43:21 +02:00

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, Purchase Management, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

Then follow the developer tutorials

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%