Skip to content Skip to sidebar Skip to footer

Filter Journal Item In General Ledger Report In Accounting Odoo

All bank account and their journal items are shown in general ledger. I have branch_id field in journal item and current login user also has branch_id field. I want to only display

Solution 1:

Try to alter the General Ledger action domain.

You can define a server action that gets the original action definition and alter the domain before returning the result then associate it with the General Ledger menu item under Accounting/Ledgers.

Example:

<recordmodel="ir.actions.server"id="action_account_moves_ledger_general"><fieldname="name">General Ledger</field><fieldname="model_id"ref="account.model_account_move_line"/><fieldname="state">code</field><fieldname="code">
action = env.ref('account.action_account_moves_ledger_general').read()[0]
action['domain'] = "[('display_type', 'not in', ('line_section', 'line_note')), ('branch_id', '=', {})]".format( env.user.branch_id.id)
        </field></record><recordmodel="ir.ui.menu"id="account.menu_action_account_moves_ledger_general"><fieldname="action"ref="action_account_moves_ledger_general"/></record>

Post a Comment for "Filter Journal Item In General Ledger Report In Accounting Odoo"