summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorSwapnesh <swapneshshah111@gmail.com>2021-04-13 17:54:29 +0000
committerwan <wan@odoo.com>2021-04-19 10:06:56 +0000
commit8fe9f552ed4591795b449f4d1e32e1563ce43ca2 (patch)
tree76fc9c656e62a154000a8a66af9752f128232fed /addons
parentbacfea994ce7232af33d7e5525a5b56d5cba5871 (diff)
[FIX]account: process one record to set debit/credit
Before this commit, There would be Expected singleton error on changing Credit/Debit for multile account in single call. Now, We are proocess one record to set `_set_opening_debit_credit` closes odoo/odoo#69435 X-original-commit: 72b5a17fc0e6f439d462647a7b55c9a26235a8df Signed-off-by: William André (wan) <wan@odoo.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/account/models/account_account.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/addons/account/models/account_account.py b/addons/account/models/account_account.py
index 82f1d6d3470..e0750616d93 100644
--- a/addons/account/models/account_account.py
+++ b/addons/account/models/account_account.py
@@ -284,10 +284,12 @@ class AccountAccount(models.Model):
account.is_off_balance = account.internal_group == "off_balance"
def _set_opening_debit(self):
- self._set_opening_debit_credit(self.opening_debit, 'debit')
+ for record in self:
+ record._set_opening_debit_credit(record.opening_debit, 'debit')
def _set_opening_credit(self):
- self._set_opening_debit_credit(self.opening_credit, 'credit')
+ for record in self:
+ record._set_opening_debit_credit(record.opening_credit, 'credit')
def _set_opening_debit_credit(self, amount, field):
""" Generic function called by both opening_debit and opening_credit's