[FIX] point_of_sale: recompute for current session only

Backport of 0280354045

Original message:

The previous trigger would recompute all sessions of a config when modifying
the cash_control flag on the config.
It was not possible to enable cash_control if a previous session wasn't in
cash control mode.

Recompute only when changing the config

OPW 761025

Closes #18814
This commit is contained in:
Lucas Perais (lpe)
2017-08-16 08:56:44 +02:00
parent c49265afa1
commit 8c5d8af855
+1 -1
View File
@@ -93,7 +93,7 @@ class PosSession(models.Model):
_sql_constraints = [('uniq_name', 'unique(name)', _("The name of this POS Session must be unique !"))]
@api.depends('cash_control', 'cash_journal_id', 'config_id.cash_control')
@api.depends('cash_control', 'cash_journal_id', 'config_id', 'statement_ids')
def _compute_cash_all(self):
for session in self:
session.cash_journal_id = session.cash_register_id = session.cash_control = False