The new implementation of stock moves the cost of products from quants to moves. So we have implemented the FIFO and average cost method based on those moves instead of using quants. - When average price is choosed, a field average_price is set on the product. - The tests have been completed with an example of how fifo work with negative stock. As the use of real price method is really rare, because of the rigor required on traceability for such method, we removed this functionnality. - The tests purchase/test/fifo_price.yml have been adapted to use the FIFO costing method instead of real price. The old report stock history doesn't exist anymore, and is replaced by the move view that contains all the cost information. The methods `get_price_unit` have been moved from the stock to stock_account. The methods `_set_default_price_moves` and `set_default_price_unit_from_product` have been removed from stock. Explaination of FIFO and average: - In action_done for an out move in average and fifo, the price_unit and stock_value are updated. - For FIFO, it will use the qty_remaining on the in moves to check from which in moves to take the stock values for the out. - In case of negative stock in FIFO, it puts also qty_remaining on OUTs. - In the case of average, it will take the cumulated value of the last move and divide it by the quantity in stock. This commit is pretty much a 'work in progress': - Edit 'done' moves when the costing method is FIFO doesn't trigger the replay the FIFO stack. - The landed_costs feature doesn't work.
920 B
920 B
| 1 | id | name | model_id:id | group_id:id | perm_read | perm_write | perm_create | perm_unlink |
|---|---|---|---|---|---|---|---|---|
| 2 | access_account_invoice_user | account.invoice stock user | account.model_account_invoice | stock.group_stock_user | 1 | 1 | 1 | 0 |
| 3 | access_account_invoice_line_user | account.invoice.line stock user | account.model_account_invoice_line | stock.group_stock_user | 1 | 1 | 1 | 0 |
| 4 | access_account_invoice_tax_user | account.invoice.tax stock user | account.model_account_invoice_tax | stock.group_stock_user | 1 | 1 | 1 | 0 |
| 5 | access_account_journal_user | account.journal stock user | account.model_account_journal | stock.group_stock_user | 1 | 0 | 0 | 0 |
| 6 | access_account_account_stock_manager | account.account stock manager | account.model_account_account | stock.group_stock_manager | 1 | 0 | 0 | 0 |
| 7 | access_stock_picking_invoicing_payments | stock.picking | stock.model_stock_picking | account.group_account_invoice | 1 | 1 | 1 | 0 |
| 8 | access_stock_move_invoicing_payments | stock.move | model_stock_move | account.group_account_invoice | 1 | 1 | 1 | 0 |