From b1474796058082dc389ab2fdca76a67cc45a5f91 Mon Sep 17 00:00:00 2001 From: "Laurent Mignon (Acsone)" Date: Thu, 12 Sep 2013 08:41:38 +0200 Subject: [PATCH] add a TODO in _update_lines to mention the potential pitfall with serializable fields --- account_statement_base_import/statement.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/account_statement_base_import/statement.py b/account_statement_base_import/statement.py index d78e40dd..f6730abe 100644 --- a/account_statement_base_import/statement.py +++ b/account_statement_base_import/statement.py @@ -284,7 +284,12 @@ class AccountStatementLine(Model): def _update_line(self, cr, uid, vals, context=None): """ Do raw update into database because ORM is awfully slow - when cheking security.""" + when cheking security. + TODO / WARM: sparse fields are skipped by the method. IOW, if your + completion rule update an sparse field, the updated value will never + be stored in the database. It would be safer to call the update method + from the ORM for records updating this kind of fields. + """ cols = self._get_available_columns([vals]) tmp_vals = (', '.join(['%s = %%(%s)s' % (i, i) for i in cols])) sql = "UPDATE account_bank_statement_line SET %s where id = %%(id)s;" % tmp_vals