Zum Inhalt springen
Odoo Menü
  • Anmelden
  • Jetzt gratis testen
  • Apps
    Finanzen
    • Buchhaltung
    • Rechnungsstellung
    • Spesenabrechnung
    • Tabellenkalkulation (BI)
    • Dokumente
    • E-Signatur
    Vertrieb
    • CRM
    • Vertrieb
    • Kassensystem – Shop
    • Kassensystem – Restaurant
    • Abonnements
    • Vermietung
    Websites
    • Website-Builder
    • E-Commerce
    • Blog
    • Forum
    • Livechat
    • E-Learning
    Lieferkette
    • Lager
    • Fertigung
    • PLM
    • Einkauf
    • Wartung
    • Qualität
    Personalwesen
    • Mitarbeiter
    • Personalbeschaffung
    • Abwesenheiten
    • Mitarbeiterbeurteilung
    • Personalempfehlungen
    • Fuhrpark
    Marketing
    • Social Marketing
    • E-Mail-Marketing
    • SMS-Marketing
    • Veranstaltungen
    • Marketing-Automatisierung
    • Umfragen
    Dienstleistungen
    • Projekte
    • Zeiterfassung
    • Außendienst
    • Kundendienst
    • Planung
    • Termine
    Produktivität
    • Dialog
    • Genehmigungen
    • IoT
    • VoIP
    • Wissensdatenbank
    • WhatsApp
    Apps von Drittanbietern Odoo Studio Odoo Cloud-Plattform
  • Branchen
    Einzelhandel
    • Buchladen
    • Kleidergeschäft
    • Möbelhaus
    • Lebensmittelgeschäft
    • Baumarkt
    • Spielwarengeschäft
    Essen & Gastgewerbe
    • Bar und Kneipe
    • Restaurant
    • Fast Food
    • Gästehaus
    • Getränkehändler
    • Hotel
    Immobilien
    • Immobilienagentur
    • Architekturbüro
    • Baugewerbe
    • Immobilienverwaltung
    • Gartenarbeit
    • Eigentümervereinigung
    Beratung
    • Buchhaltungsfirma
    • Odoo-Partner
    • Marketingagentur
    • Anwaltskanzlei
    • Talentakquise
    • Prüfung & Zertifizierung
    Fertigung
    • Textil
    • Metall
    • Möbel
    • Speisen
    • Brauerei
    • Firmengeschenke
    Gesundheit & Fitness
    • Sportklub
    • Brillengeschäft
    • Fitnessstudio
    • Therapeut
    • Apotheke
    • Friseursalon
    Handel
    • Handyman
    • IT-Hardware & -Support
    • Solarenergiesysteme
    • Schuster
    • Reinigungsdienstleistungen
    • HLK-Dienstleistungen
    Sonstiges
    • Gemeinnützige Organisation
    • Umweltschutzagentur
    • Plakatwandvermietung
    • Fotostudio
    • Fahrrad-Leasing
    • Software-Händler
    Alle Branchen ansehen
  • Community
    Lernen
    • Tutorials
    • Dokumentation
    • Zertifizierungen
    • Schulung
    • Blog
    • Podcast
    Bildung fördern
    • Bildungsprogramm
    • Scale-Up! Planspiel
    • Odoo besuchen
    Software anfragen
    • Herunterladen
    • Editionen vergleichen
    • Releases
    Zusammenarbeiten
    • Github
    • Forum
    • Veranstaltungen
    • Übersetzungen
    • Partner werden
    • Dienstleistungen für Partner
    • Buchhaltungsfirma registrieren
    Services anfragen
    • Partner finden
    • Buchhalter finden
    • Einen Experten treffen
    • Implementierungsservices
    • Kundenreferenzen
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Eine Demo erhalten
  • Preiskalkulation
  • Hilfe

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Buchhaltung
  • Lager
  • PoS
  • Projekte
  • MRP
All apps
Sie müssen registriert sein, um mit der Community zu interagieren.
Alle Beiträge Personen Abzeichen
Stichwörter (Alle anzeigen)
odoo accounting v14 pos v15
Über dieses Forum
Sie müssen registriert sein, um mit der Community zu interagieren.
Alle Beiträge Personen Abzeichen
Stichwörter (Alle anzeigen)
odoo accounting v14 pos v15
Über dieses Forum
Hilfe

How to automate from Approvals to Journal Entry/Bills

Abonnieren

Erhalten Sie eine Benachrichtigung, wenn es eine Aktivität zu diesem Beitrag gibt

Diese Frage wurde gekennzeichnet
accountingapprovalautomation
2 Antworten
128 Ansichten
Avatar
John Chris Aganan

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!

0
Avatar
Verwerfen
John Chris Aganan
Autor

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!

Avatar
Cybrosys Techno Solutions Pvt.Ltd
Beste Antwort
Hi,
To implement a cash-advance workflow in Odoo, the idea is to extend the Approvals module so that it can communicate with the Accounting module. The process begins by creating a dedicated Approval Category specifically for cash-advance requests. This category defines the structure of the request, including fields for the employee, the requested amount, and the purpose of the advance. Once this category is in place, employees submit their cash-advance requests through the standard approval.request model.

When the request reaches approval, you then override the action_approve() method of the approval request. Inside this method, you can add custom logic to automatically generate an accounting journal entry that reflects the cash advance granted to the employee. This ensures that the accounting team does not have to manually create any entries; everything is generated automatically once the manager approves the request. This complete workflow allows you to manage cash advances smoothly and consistently within Odoo.

Try the following steps.

1- Create an Approval Type
* This defines a new approval category called “Cash Advance Request”.

data/approval_category_data.xml

<?xml version="1.0" encoding="UTF-8"?>
<odoo>
    <record id="approval_category_cash_advance" model="approval.category">
        <field name="name">Cash Advance Request</field>
        <field name="description">Approval workflow used to request employee cash advances.</field>
        <field name="requires_approver">True</field>
        <field name="has_amount">True</field>
        <field name="approver_ids" eval="[(0,0,{'user_id': ref('base.user_admin')})]"/>
    </record>
</odoo>

2- Extend Approval Request to Add Cash Advance Fields
* You may want to store fields such as:
        - employee requesting the advance
        - amount requested
        - purpose
        - journal entry created

models/cash_advance_request.py


from odoo import models, fields, api
from odoo.exceptions import UserError


class ApprovalRequest(models.Model):
    _inherit = "approval.request"

    cash_advance_amount = fields.Monetary(
        string="Cash Advance Amount",
        currency_field="currency_id",
    )

    currency_id = fields.Many2one(
        "res.currency",
        default=lambda self: self.env.company.currency_id.id,
    )

    journal_entry_id = fields.Many2one(
        "account.move",
        string="Journal Entry",
        readonly=True,
    )

    def _is_cash_advance(self):
        """Check if the request belongs to our custom category"""
        return self.category_id == self.env.ref(
            "cash_advance.approval_category_cash_advance"
        )


3- Override action_approve() to Create a Journal Entry
* When a Cash Advance Request is approved:
          - Create a journal entry
          - Debit → Employee Receivable
          - Credit → Cash/Bank
          - Link the JE back to the request

models/cash_advance_request.py (continued)

    def action_approve(self):
        """Extend the approval workflow to create a journal entry."""
        res = super().action_approve()

        for request in self:
            if not request._is_cash_advance():
                continue

            if request.journal_entry_id:
                continue  # Avoid duplicates

            employee = request.request_owner_id.employee_id
            if not employee:
                raise UserError("No employee linked to the requester.")

            amount = request.cash_advance_amount
            if amount <= 0:
                raise UserError("Cash advance amount must be greater than zero.")

            # Journal with type 'cash' or 'bank'
            journal = self.env['account.journal'].search(
                [('type', 'in', ['cash', 'bank'])],
                limit=1
            )
            if not journal:
                raise UserError("Please configure a Cash or Bank Journal.")

            # Use employee’s receivable account
            receivable_account = employee.address_home_id.property_account_receivable_id
            if not receivable_account:
                raise UserError("Employee has no receivable account configured.")

            # Construct the journal entry
            move_vals = {
                'move_type': 'entry',
                'journal_id': journal.id,
                'ref': f"Cash Advance - {employee.name}",
                'line_ids': [
                    # Debit employee receivable
                    (0, 0, {
                        'name': "Cash Advance to Employee",
                        'account_id': receivable_account.id,
                        'debit': amount,
                    }),
                    # Credit cash/bank
                    (0, 0, {
                        'name': "Cash Advance Disbursement",
                        'account_id': journal.default_account_id.id,
                        'credit': amount,
                    }),
                ]
            }

            move = self.env["account.move"].create(move_vals)
            move.action_post()

            # Link JE to request

            request.journal_entry_id = move.id


        return res

Hope it helps

0
Avatar
Verwerfen
Avatar
Redian Software Pvt Ltd
Beste Antwort

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

0
Avatar
Verwerfen
Diskutieren Sie gerne? Treten Sie bei, statt nur zu lesen!

Erstellen Sie heute ein Konto, um exklusive Funktionen zu nutzen und mit unserer tollen Community zu interagieren!

Registrieren
Verknüpfte Beiträge Antworten Ansichten Aktivität
Unable to Use invoice_currency_rate in Automations – AttributeError in Odoo Online Gelöst
accounting automation
Avatar
1
Juli 25
1527
Automatic Accounting: Stock Input/Output Account Gelöst
stock accounting automation
Avatar
Avatar
1
Feb. 25
2809
Internal Transfer (Bank Account to Credit Card) Reconciliation Model
accounting reconciliation automation
Avatar
Avatar
1
Mai 24
2084
Auto reconcile imported invoices/bills with imported payments/bank statements using a scheduled action with no user intervention
accounting reconciliation automation
Avatar
0
Nov. 23
4248
Odoo 17: how to create records using Automation Rules
approval automation internal-transfer v17
Avatar
Avatar
1
Sept. 24
5338
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Herunterladen
  • Github
  • Runbot
  • Übersetzungen
Dienstleistungen
  • Odoo.sh-Hosting
  • Support
  • Upgrade
  • Individuelle Entwicklungen
  • Bildung
  • Buchhalter finden
  • Partner finden
  • Partner werden
Über uns
  • Unsere Firma
  • Markenwerte
  • Kontakt
  • Karriere
  • Veranstaltungen
  • Podcast
  • Blog
  • Kunden
  • Rechtliches • Datenschutz
  • Sicherheit
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo ist eine Suite von Open-Source-Betriebsanwendungen, die alle Bedürfnisse Ihres Unternehmens abdecken: CRM, E-Commerce, Buchhaltung, Lager, Kassensystem, Projektmanagement etc.

Das einzigartige Wertversprechen von Odoo ist, dass es gleichzeitig sehr einfach zu bedienen und voll integriert ist.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now