[FIX] point_of_sale: _compute_cash_balance falsy
The computation of the cash_balance of the sessions was falsy due to a change retrieving a part of the domain related to the payment lines of the session. The change of the domain led to retrieving all payments done during the entire lifetime of the config instead of only the ones done during the session and leading to miscomputation of the cash balance. closes odoo/odoo#124817 X-original-commit: d6d9e5ade690fb807b6c3644622e38b34b14de2c Signed-off-by: Heinz Robin (rhe) <rhe@odoo.com> Signed-off-by: Guilliams Adrien (adgu) <adgu@odoo.com>
This commit is contained in:
@@ -111,7 +111,7 @@ class PosSession(models.Model):
|
||||
if cash_payment_method:
|
||||
total_cash_payment = 0.0
|
||||
last_session = session.search([('config_id', '=', session.config_id.id), ('id', '!=', session.id)], limit=1)
|
||||
result = self.env['pos.payment']._read_group([('payment_method_id', '=', cash_payment_method.id)], aggregates=['amount:sum'])
|
||||
result = self.env['pos.payment']._read_group([('session_id', '=', session.id), ('payment_method_id', '=', cash_payment_method.id)], aggregates=['amount:sum'])
|
||||
total_cash_payment = result[0][0] or 0.0
|
||||
session.cash_register_total_entry_encoding = sum(session.statement_line_ids.mapped('amount')) + (
|
||||
0.0 if session.state == 'closed' else total_cash_payment
|
||||
|
||||
Reference in New Issue
Block a user