[FIX] account: avoid cache invalidation at the opening of an invoice
[FIX] account: avoid cache invalidation at the opening of an invoice

* Avoid to invalidate the cache if no actual deletion has been
made when recomputing the taxes

* Avoid to create analytic entries to delete them right away
few lines further in the same method:
 - Analytic entries are created at line 903
   - account_invoice.py:751 `move_line_dict['analytic_line_ids'] = [(0, 0, line._get_analytic_line())]`
   - account_invoice.py:840 `iml = inv.invoice_line_move_line_get()`
   - account_invoice.py:886 `line = inv.group_lines(iml, line)`
   - account_invoice.py:894 `'line_ids': line,`
   - account_invoice.py:903 `move = account_move.with_context(ctx_nolang).create(move_vals)`
 - Then, at line 907, they are deleted and others are created again:
   - account_invoice.py:907 `move.post()`
   - account_move.py:130 `move.line_ids.create_analytic_lines()`
   - account_move.py:1258 `self.mapped('analytic_line_ids').unlink()`
   - account_move.py:1262 `self.env['account.analytic.line'].create(vals_line)`
  Deleting these analytic entries indeed implies the invalidation of the cache.
  Besides, generally speaking, we should avoid to waste resources
  by creating/unlinking records without a good reason.

ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo