Hello everyone, I would like to ask for your help in implementing a cash advance sort of system where an employee can request via approvals module a cash advance. Then when it gets approved it will generate a journal entry and/or a bill for the accounting department.
I tried automation in odoo studio but no journal entry is being created and bills is also not created.
I hope someone can help. Thank you!
Deze vraag is gerapporteerd
Hi,
If you're looking to manage approvals without heavy customization, we’ve built a Dynamic Approval Engine that works across any model — no coding required.
You can configure:
Multi-level approvals
Conditional approval rules (amount, user role, etc.)
Approval flows for Sales, Purchase, Invoice or any custom model
It’s designed to be flexible and save a lot of development time.
You can check it here: https://apps.odoo.com/apps/modules/19.0/skit_approval_engine
Happy to share a quick demo if needed 👍
models/cash_advance_request.py
request.journal_entry_id = move.id
Hope it helps
1. Create the Approval Type
Go to Approvals → Configuration → Approval Types → Create
Name: Cash Advance Request
Add fields: Employee, Amount, Purpose
Set approvers (Manager / Finance)
2. Create an Automated Action
Go to:
Settings → Technical → Automation → Automated Actions → Create
Set:
Model: Approvals Request
Trigger: On Update
Condition: state == 'approved'
Action: Execute Python Code
3. Paste This Code (for Journal Entry)
employee = record.employee_id
amount = record.amount or 0.0
journal = env['account.journal'].search([('type', '=', 'cash')], limit=1)
advance_account = env['account.account'].search([('code', '=', '141000')], limit=1)
cash_account = env['account.account'].search([('code', '=', '100000')], limit=1)
move_vals = {
'journal_id': journal.id,
'ref': f"Cash Advance - {employee.name}",
'line_ids': [
(0, 0, {'account_id': advance_account.id, 'name': 'Advance', 'debit': amount}),
(0, 0, {'account_id': cash_account.id, 'name': 'Cash Out', 'credit': amount}),
]
}
move = env['account.move'].create(move_vals)
move.action_post()
4. Test
Submit a cash advance request
Approve it
Check Accounting → Journal Entries
Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!
Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!
Aanmelden| Gerelateerde posts | Antwoorden | Weergaven | Activiteit | |
|---|---|---|---|---|
|
|
2
jun. 26
|
481 | ||
|
|
1
jul. 25
|
2444 | ||
|
|
1
feb. 25
|
4189 | ||
|
|
1
mei 24
|
2947 | ||
|
|
0
nov. 23
|
5397 |
Hello, Thank you for this. But this is where I get blocked by the problem, nothing is created in the journal entries even though I followed your instructions.
I hope you can help me further, Thank you!