[FIX] point_of_sale: correctly compute cash profit for closing popup
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) <rhe@odoo.com> Signed-off-by: Engels Robin (roen) <roen@odoo.com>
This commit is contained in:
@@ -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.',
|
||||
|
||||
Reference in New Issue
Block a user