When receiving goods with average price set as costing method,
for a move from another company than the SUPERUSER_id company,
the average price updated was the one from the SUPERUSER company
instead of the one of the move.
opw-634167
The `find` method will get the current accounting periode according to the
user's timezone while time do not. This means that it is possible that users
get a move with a date belongign to a different period that the one returned by
`find`.
Fixing b101808, linked to #4147, courtesy of Graeme Gellatly
The accounting entries generated (during confirmation of moves on real time
products) were based on the move date. This is correct but the creation of the
entries (from quants_move) is done before the change of state of the move
(which set the date of the move to now).
Instead of using the date of move that is changed a few steps laters, use
directly the current date for account move date.
Fixes#4147, opw 619902
Skip the creation of the corrective valuation entry
when a negative quant is reconciled with an incoming
shipment, when:
- the cost has not changed, so the journal entry would
be useless (credit/debit = 0)
- or, when the accounting period for the move causing
the negative quant is already closed, and must not be
updated (presumably the valuation was manually
set before closing that period)
This reverts commit 1fd13fbe2b.
For FIFO it was not needed as the cost is already set to the returned quant.
For standard price, this is wrong as the stock is reevaluated when the product
price is changed.
For FIFO and standard price, return product at the purchased price instead of
the cost or current standard price.
Not applied for average as returning a purchased product do not recompute
the average price and would lead to an inconsistency in the stock value.
opw 615263
In the new api an empty recordset converted to string is the name its class
while previously it was converted to an empty string.
The valid v7 condition sould have probably been
move.picking_id and move.picking_id.name or False
but in v8, simply move.picking_id.name is enough and avoids getting these
accounting entries strangly named when there is no picking.
[FIX] super of scheduler should have same params + use_new_cursor should be passed to procure orderpoint confirm
[IMP] Make sure the delivery works when doing phantom boms
[FIX] This should update the average price properly when having multiple moves with the same product
[FIX] Average price should take into account the quantities of all variants
[FIX] Make sure purchase picking type in other company works
[IMP] Views of quants and destination locations of moves
stock_account module override the action_done method of stock.move but does not return the same value
This causes problems when calling this function from xmlrpc because the resulting value is now None and that is not allowed to be marshaled by default.
A squashed merge is required as the conversion of the apiculture branch from
bzr to git was not correctly done. The git history contains irrelevant blobs
and commits. This branch brings a lot of changes and fixes, too many to list
exhaustively.
- New orm api, objects are now used instead of ids
- Environements to encapsulates cr uid context while maintaining backward compatibility
- Field compute attribute is a new object oriented way to define function fields
- Shared browse record cache
- New onchange protocol
- Optional copy flag on fields
- Documentation update
- Dead code cleanup
- Lots of fixes