From efe52d50bb9e8bee22517a25fec5cb85d50b9d85 Mon Sep 17 00:00:00 2001 From: roen-odoo Date: Tue, 27 Dec 2022 14:53:27 +0000 Subject: [PATCH] [FIX] point_of_sale: correctly compute cash profit for closing popup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Current behavior: If you add cash at the opening of a session that already has cash in the cash register; the closing popup will show a negative profit (loss) for the cash payment method. Steps to reproduce: - Open a POS session - Add cash to the cash register (50€) - Close the session - Open a new session - The popup show that there is already 50€ in the cash register, add cash to the cash register (100€) - Close the session, the closing popup will show a loss of 50€ for the cash payment method. Wich is not true, it's a profit of 50€. opw-3101297 closes odoo/odoo#108870 X-original-commit: d881de9079bc9d8cab6811872eaa2c2138f6612d Signed-off-by: Heinz Robin (rhe) Signed-off-by: Engels Robin (roen) --- addons/point_of_sale/models/pos_session.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/models/pos_session.py b/addons/point_of_sale/models/pos_session.py index 31e39105612..4e6580e3b74 100644 --- a/addons/point_of_sale/models/pos_session.py +++ b/addons/point_of_sale/models/pos_session.py @@ -340,7 +340,7 @@ class PosSession(models.Model): 'pos_session_id': self.id, } - if self.cash_register_difference < 0.0: + if amount < 0.0: if not self.cash_journal_id.loss_account_id: raise UserError( _('Please go on the %s journal and define a Loss Account. This account will be used to record cash difference.',