fix: ensure intercompany clearing moves are generated with sudo privileges for session validation
This commit is contained in:
parent
6718e33111
commit
86dd8b93ce
@ -12,7 +12,7 @@ class PosSession(models.Model):
|
|||||||
res = super(PosSession, self)._validate_session(balancing_account, amount_to_balance, bank_payment_method_diffs)
|
res = super(PosSession, self)._validate_session(balancing_account, amount_to_balance, bank_payment_method_diffs)
|
||||||
|
|
||||||
# After the standard validation and account move creation, we create the inter-company clearing moves
|
# After the standard validation and account move creation, we create the inter-company clearing moves
|
||||||
self._create_intercompany_clearing_moves()
|
self.sudo()._create_intercompany_clearing_moves()
|
||||||
|
|
||||||
return res
|
return res
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ class PosSession(models.Model):
|
|||||||
return res_data
|
return res_data
|
||||||
|
|
||||||
def _create_intercompany_clearing_moves(self):
|
def _create_intercompany_clearing_moves(self):
|
||||||
for session in self:
|
for session in self.sudo():
|
||||||
if session.state != 'closed' or not session.move_id:
|
if session.state != 'closed' or not session.move_id:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user