2 related fixes:
- When removing an asset line depreciation move, we have to pass it
first to draft, or we won't be able to remove it even with the
context.
- When removing a move, the check for removing the linked asset should
be only for purchase documents, not for "not sale" documents.
If the assets are created before posting the invoice, they wouldn't have a name and the "code" field of the assets will be empty, but they would have the invoice name.
* account_asset: Do not loop on all the lines to search for one linked asset
Before this change, the use of `mapped` on self did loop on all the move
lines that are included in self to get the assets, what could be very
costly for a simple write on a lot of move lines. As the goal is to raise
an error only if at least one move is linked to an asset, we break the
loop if the condition is fulfilled.
* performance improvement
* [RMV] - Remove useless dependency
In 12.0 account_fiscal_year is a standard feature no need to depend on oca
module account_fiscal_year