From d7da5d2ba0e4916509624caa9a0bf2a842e09879 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 20 Dec 2013 12:33:33 +0100 Subject: [PATCH] Rationalize relation actions * Remove relation field actions: - delete_all - unlink_all - set * Rename relation field action unlink into remove issue3457 review2271002 --- invoice.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/invoice.py b/invoice.py index dadf105f1a..38db340a61 100644 --- a/invoice.py +++ b/invoice.py @@ -144,8 +144,14 @@ class InvoiceLine: if account_id \ and account_id not in accounts: accounts.append(account_id) + to_remove = list( + set((a.id for a in line.analytic_accounts.accounts)) + - set(accounts)) Selection.write([line.analytic_accounts], { - 'accounts': [('set', accounts)], + 'accounts': [ + ('remove', to_remove), + ('add', accounts), + ], }) args.extend((lines, values)) super(InvoiceLine, cls).write(*args)