summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Martinelli <nim@odoo.com>2020-11-19 11:07:41 +0000
committerNicolas Martinelli <nim@odoo.com>2020-11-19 11:12:23 +0000
commitb325266bc9d3893e037b3fd8d734ac7d3d510c41 (patch)
tree433b66a95891d3bb6f6ef9172505cff3daebf24e
parent5aa873f4a260b3cbcbd137637d319100202e13e8 (diff)
[FIX] account: account creation
- Install accounting app - Go to "Charts of Accounts" view by setup panel - Create a new record A traceback occurs because `self.ids` is empty in the context of the creation of a new record. opw-2379463 closes odoo/odoo#62001 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
-rw-r--r--addons/account/models/account_account.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/account/models/account_account.py b/addons/account/models/account_account.py
index da1cc0cf0c1..1aa6c558bf8 100644
--- a/addons/account/models/account_account.py
+++ b/addons/account/models/account_account.py
@@ -224,7 +224,10 @@ class AccountAccount(models.Model):
raise UserError(_('Cannot generate an unused account code.'))
def _compute_opening_debit_credit(self):
- if not self:
+ self.opening_debit = 0
+ self.opening_credit = 0
+ self.opening_balance = 0
+ if not self.ids:
return
self.env.cr.execute("""
SELECT line.account_id,