Skip to content

Wrong Cost Center When use on Multi Tenant #3

@staumoepeau

Description

@staumoepeau

I really like this Expenses Request, it is very simple and also easy for the non-accounting users. Good Job

Here is an issue that i picked up, when more than one Company, creating the Journal Entry pickup the wrong cost center. On the api.py file I replace these 3 lines:

#        payment_mode = frappe.get_doc('Mode of Payment Account', {'parent' : expense_entry.mode_of_payment, 'company' : expense_entry.company})
#        for acc in payment_mode.accounts:
#            pay_account = acc.default_account

with this line:

   ` pay_account = frappe.db.get_value('Mode of Payment Account', {'parent' : expense_entry.mode_of_payment, 'company' : expense_entry.company}, 'default_account')`

then I added this line at the bottom of the accounts.append
'cost_center': expense_entry.default_cost_center

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions