Skip to content

Commit 4935c16

Browse files
committed
[FIX] account_background_post: When account_background_post is installed, validated invoices always use action_post instead of _post
X-original-commit: 50ce5c5
1 parent 984f56f commit 4935c16

1 file changed

Lines changed: 24 additions & 12 deletions

File tree

account_background_post/wizards/validate_account_move.py

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,33 @@ def validate_move(self):
4141
4242
3. Limitamos sui el usuario quiere validar mas facturas que el batch size definido directamente
4343
le pedimos que las valide en background."""
44-
if self.count_inv <= 1: # or 0 or 1
45-
return super().validate_move()
46-
47-
if self.count_inv > self.batch_size:
48-
raise UserError(
49-
_(
50-
"You can only validate on batches of size < %s invoices. If you need to validate"
51-
" more invoices please use the validate on background option",
52-
self.batch_size,
44+
if self.count_inv:
45+
if self.count_inv > self.batch_size:
46+
raise UserError(
47+
_(
48+
"You can only validate on batches of size < %s invoices. If you need to validate"
49+
" more invoices please use the validate on background option",
50+
self.batch_size,
51+
)
5352
)
54-
)
5553

54+
<<<<<<< 984f56ffbb6378a378d8b14981f8779bce1767e0
5655
for move in self.move_ids:
5756
_logger.info("Validating invoice %s", move.id)
5857
move.action_post()
5958
move.env.cr.commit()
60-
61-
return {"type": "ir.actions.act_window_close"}
59+
||||||| deb7806009a0464f3d0bb75f57df036f1b9b3adf
60+
for move in self.move_ids:
61+
_logger.info("Validating invoice %s", move.id)
62+
move.action_post()
63+
move._cr.commit()
64+
=======
65+
for move in self.move_ids:
66+
_logger.info("Validating invoice %s", move.id)
67+
move.action_post()
68+
move._cr.commit()
69+
>>>>>>> 0cfdd1e2339af4eafcf83cd20c27e59d6cfce98e
70+
71+
return {"type": "ir.actions.act_window_close"}
72+
else:
73+
return super().validate_move()

0 commit comments

Comments
 (0)