summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Courtoy (pco) <pco@odoo.com>2021-01-27 07:58:58 +0000
committerGoffin Simon <sig@odoo.com>2021-02-09 11:12:24 +0000
commit550906d48682996cb47142bb0d519fdbfac69642 (patch)
treea49ee9ba7c274cd3c6e766c0dbbbeb02c59b4204
parent713ecc290909834671b155aa93b31dca6b3c18b2 (diff)
[FIX] incorrect method called in get balancing pos account
When the pos session can't be balanced, a balancing account is used. First, we take the company balancing account, but if it is not set, we need to take the property. Here, it was the wrong method used to get the property. opw:2439889 closes odoo/odoo#65791 Signed-off-by: Simon Goffin (sig) <sig@openerp.com> Co-authored-by: simongoffin <sig@odoo.com>
-rw-r--r--addons/point_of_sale/models/pos_session.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/point_of_sale/models/pos_session.py b/addons/point_of_sale/models/pos_session.py
index acde883d9c8..e46017fbf53 100644
--- a/addons/point_of_sale/models/pos_session.py
+++ b/addons/point_of_sale/models/pos_session.py
@@ -382,7 +382,8 @@ class PosSession(models.Model):
return self._credit_amounts(partial_vals, imbalance_amount_session, imbalance_amount)
def _get_balancing_account(self):
- return self.company_id.account_default_pos_receivable_account_id or self.env['ir.property'].get('property_account_receivable_id', 'res.partner')
+ propoerty_account = self.env['ir.property']._get('property_account_receivable_id', 'res.partner')
+ return self.company_id.account_default_pos_receivable_account_id or propoerty_account or self.env['account.account']
def _create_account_move(self):
""" Create account.move and account.move.line records for this session.