From 5ca48a0cf29e3c1c9d5dfca994b439512bb20a47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dar=C3=ADo=20Lodeiros?= Date: Mon, 14 Nov 2022 14:03:47 +0100 Subject: [PATCH] [TMP]pms: add context variable to avoid auto create transactions cash payments --- pms/models/pms_folio.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pms/models/pms_folio.py b/pms/models/pms_folio.py index cf3894a62..5690c2b33 100644 --- a/pms/models/pms_folio.py +++ b/pms/models/pms_folio.py @@ -2129,7 +2129,8 @@ class PmsFolio(models.Model): move._autoreconcile_folio_payments() # Automatic register payment in cash register - if pay_type == "cash": + # TODO: no_cash_register to avoid flow in the new api (delete it in the future) + if pay_type == "cash" and not self.env.context.get("no_cash_register"): line = self._get_statement_line_vals( journal=journal, receivable_account=receivable_account, @@ -2214,7 +2215,8 @@ class PmsFolio(models.Model): pay.action_post() # Automatic register refund in cash register - if pay_type == "cash": + # TODO: no_cash_register to avoid flow in the new api (delete it in the future) + if pay_type == "cash" and not self.env.context.get("no_cash_register"): line = self._get_statement_line_vals( journal=journal, receivable_account=receivable_account,