summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/fields/relational_fields.js
diff options
context:
space:
mode:
authorDenis Ledoux <dle@odoo.com>2018-05-07 16:47:38 +0200
committerDenis Ledoux <dle@odoo.com>2018-05-07 17:02:02 +0200
commitda6b4add237490d6415414a053d967d9a549a918 (patch)
treee6d0a409ee6f8a7cd3f74c114f5152b3279e4469 /addons/web/static/src/js/fields/relational_fields.js
parenta8ab14a67263d094daa816557216087a4f680f80 (diff)
[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.
Diffstat (limited to 'addons/web/static/src/js/fields/relational_fields.js')
0 files changed, 0 insertions, 0 deletions