The method is calling validate_move which test the value in the database but
check_modification is called before the update of the database for write.
But on_modification is always called after the database modification.
Closes#15157
(grafted from a4629adf43a5dbf915a7eb031ae01e5763004396)
--HG--
branch : 8.0
This implements the same behavior as the payable/receivable date in
7caa97a96b95 ensuring that the cumulate balance is the same as the today field.
Also it allows to customize the date considered as today from the context date
key or _datetime (when browsing history).
Closes#14228
When the last line is pop from the debit/credit list, the access to the balance
may invalidate the cache of other records to fill the cache of the last one.
This may become very inefficient on large list of lines.
So by setting the record cache size to the size of the list of lines, we ensure
that no cache is invalidated during the calculation.
Closes#14230
If we round the tax amount already added to the other line, the result may vary
depending on the order of the lines.
This is because round half even is used so the result may depend on the already
summed tax amounts.
Closes#14047
The rounding error must not be distributed between taxable lines having
different taxes otherwise the tax amount is not stable for the same base
amount.
Closes#13673
The combination implementation is replaced by strategy that search the
smallest remaining from the order lines by removing the last debit or credit
depending on the remaining sign.
Closes#13451
Some Function fields has the move as prefix which is removed when applied to
the move. But when setting default value for the line, the move prefix must
not be removed.
Closes#12967
When a new parent is added to a tree template like types, taxes or tax codes,
the corresponding record of the new template parent is not yet created.
So we need to use a default value for the parent and update again the tree
after creating the new records.
Closes#12755
The fiscal years are created centered on the passed date such that if the
current day change during the execution, the fiscal year is still usable.
Also fiscal year can be created for a range of dates such that it is guarantee
that the dates are in the fiscal year.
And finally remove datetime and dateutil import when they are not used.
Closes#9977