Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
1 Svar
171 Visninger

Hello,


I want to apply an approval hierarchy on payments made for multiple vendor bills. However, Odoo doesn’t allow applying approval hierarchy when paying multiple bills at once.


Currently, the approval process works properly when making a single bill payment — we can apply approval on the “Pay” button for that case.


But when we select multiple bills and make a batch payment, the approval mechanism is skipped, and the system processes the payment directly without any approval step.


Please guide me on how this can be handled.


Regards,

Nabeel

Avatar
Kassér
Bedste svar

Hi,


In Odoo, the approval process for vendor payments works correctly when processing a single bill, but it’s skipped when paying multiple bills at once. This happens because the batch payment wizard (account.payment.register) directly creates and posts payments without triggering any approval workflow. As a result, the system processes batch payments immediately, bypassing the approval state or rules applied to individual payments.


To fix this, the approval step must be integrated into the batch payment creation flow. This can be achieved by overriding the action_create_payments() method in the account.payment.register model. The override ensures that payments created in bulk remain in the draft or to_approve state instead of being automatically posted. Additional logic can then set the payment’s approval state, record the requesting user, and optionally trigger a notification to the approver.


Next, you can extend the account.payment model with approval states such as “To Approve,” “Approved,” and “Rejected,” and add buttons in the form view for approvers to take action. When the payment is approved, it moves to the posted state. Access control rules can also be applied to ensure that only authorized users can post payments after approval.


In Odoo Enterprise, this process can be linked with the built-in Approvals app for a more integrated workflow, but even then, customizing the payment creation logic remains necessary to prevent automatic posting of batch payments.



Hope it helps

Avatar
Kassér