Skip to content

Commit

Permalink
Merge pull request OCA#592 from hbrunn/9.0-account-use-sql
Browse files Browse the repository at this point in the history
[FIX] also write account_code_digits via sql if there's only one temp…
  • Loading branch information
pedrobaeza authored Jul 30, 2016
2 parents 7eeee4a + a83beb7 commit ec5cc01
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion addons/account/migrations/9.0.1.1/post-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,14 @@ def account_templates(cr):
# right one
company.write({
'chart_template_id': account_templates.id,
'accounts_code_digits': accounts_code_digits,
'transfer_account_id': account_templates.transfer_account_id.id
})
# we need to write accounts_code_digits via sql because the orm
# would try to renumber existing accounts which we don't want
env.cr.execute(
'update res_company set accounts_code_digits=%s '
'where id in %s',
(accounts_code_digits, tuple(company.ids)))
continue
# when there are multiple charts of accounts, things get messy.
# we assign the chart of accounts with the most matches concerning
Expand Down

0 comments on commit ec5cc01

Please sign in to comment.