Skip to content

Commit 6852ec5

Browse files
committed
[FIX] account_background_post: avoid name collision on validate_move method
Rename the inserted Confirm button to validate_move_confirm and add a bridge method validate_move_confirm() that delegates to validate_move(). This removes the name="validate_move" collision so the background-post button cannot accidentally trigger the synchronous validate path. closes #262 X-original-commit: 36a5489 Signed-off-by: rov-adhoc <rov@adhoc.com.ar> Signed-off-by: Camila Vives <cav@adhoc.inc>
1 parent f07b0ab commit 6852ec5

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

account_background_post/wizards/validate_account_move.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,9 @@ def validate_move(self):
5959
return {"type": "ir.actions.act_window_close"}
6060
else:
6161
return super().validate_move()
62+
63+
def validate_move_confirm(self):
64+
"""Bridge method called from the view's Confirm button renamed to
65+
avoid name collision. It delegates to `validate_move` to keep the
66+
same behaviour."""
67+
return self.validate_move()

account_background_post/wizards/validate_account_move_views.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<button name="validate_move" position="before">
2020
<button string="Post in Background" name="action_background_post" type="object" default_focus="1" class="btn-primary" data-hotkey="a" help="With this, all the invoices selected to be validated will be marked and they will be validated one by one. If an error is found when validating any invoice, the automatic validation of the same will be unmarked and it will be notified via messaging"
2121
invisible="abnormal_amount_partner_ids or abnormal_date_partner_ids"/>
22-
<button string="Confirm" name="validate_move" type="object"
22+
<button string="Confirm Now" name="validate_move_confirm" type="object"
2323
default_focus="1" class="btn-primary" data-hotkey="q" context="{'validate_analytic': True}"
2424
confirm="Only use this option to post a small batch of invoices" invisible="force_background"
2525
/>

0 commit comments

Comments
 (0)