I can't update information on my company doc. It produces this error:

I can’t update information on my company doc. It produces this error:

AttributeError: ‘Company’ object has no attribute ’
default_payroll_payable_account’
Possible source of error: hrms (app)

Pls Help

Please paste the error that you are facing. and also share the versions of ERPNext and HRMS.

Please paste the error that you are facing.

check it in the console and paste here.

Title
‘Company’ object has no attribute ‘default_payroll_payable_account’

method
Error

Traceback with variables (most recent call last):
File “apps/frappe/frappe/app.py”, line 110, in application
response = frappe.api.handle(request)
request = <Request ‘http://127.0.0.1/api/method/frappe.desk.form.save.savedocs’ [POST]>
response = None
rollback = True
e = AttributeError(“‘Company’ object has no attribute ‘default_payroll_payable_account’”)
File “apps/frappe/frappe/api/init.py”, line 49, in handle
data = endpoint(**arguments)
request = <Request ‘http://127.0.0.1/api/method/frappe.desk.form.save.savedocs’ [POST]>
endpoint = <function handle_rpc_call at 0x7010bddce0c0>
arguments = {‘method’: ‘frappe.desk.form.save.savedocs’}
File “apps/frappe/frappe/api/v1.py”, line 36, in handle_rpc_call
return frappe.handler.handle()
method = ‘frappe.desk.form.save.savedocs’
frappe = <module ‘frappe’ from ‘apps/frappe/frappe/init.py’>
File “apps/frappe/frappe/handler.py”, line 49, in handle
data = execute_cmd(cmd)
cmd = ‘frappe.desk.form.save.savedocs’
data = None
File “apps/frappe/frappe/handler.py”, line 85, in execute_cmd
return frappe.call(method, **frappe.form_dict)
cmd = ‘frappe.desk.form.save.savedocs’
from_async = False
server_script = None
method = <function savedocs at 0x7010bc27dee0>
File “apps/frappe/frappe/init.py”, line 1718, in call
return fn(*args, **newargs)
fn = <function savedocs at 0x7010bc27dee0>
args = ()
kwargs = {‘doc’: ‘{“name”:“Hilina Enriched Foods PLC”,“owner”:“Administrator”,“creation”:“2024-01-16 11:16:16.138742”,“modified”:“2024-03-22 08:50:45.322543”,“modified_by”:“Administrator”,“docstatus”:0,“idx”:193,“company_name”:“Hilina Enriched Foods PLC”,“abbr”:“HEFP”,“default_currency”:“ETB”,“country”:“Ethiopia”,“is_group”:0,“lft”:1,“rgt”:2,“old_parent”:“”,“create_chart_of_accounts_based_on”:“Standard Template”,“chart_of_accounts”:“Standard with Numbers”,“default_bank_account”:“Bank Account - HEFP”,“default_cash_account”:“1110 - Cash - HEFP”,“default_receivable_account”:“1310 - Debtors - HEFP”,“round_off_account”:“5212 - Round Off - HEFP”,“round_off_cost_center”:“Main - HEFP”,“write_off_account”:“5218 - Write Off - HEFP”,“exchange_gain_loss_account”:“5219 - Exchange Gain/Loss - HEFP”,“allow_account_creation_against_child_company”:0,“default_payable_account”:“2110 - Creditors - HEFP”,“default_expense_account”:“5111 - Cost of Goods Sold - HEFP”,“default_income_account”:“4110 - Sales - HEFP”,“cos…
newargs = {‘doc’: '{“name”:“Hilina Enriched Foods PLC”,“owner”:“Administrator”,“creation”:“2024-01-16 11:16:16.138742”,“modified”:“2024-03-22 08:50:45.322543”,“modified_by”:“Administrator”,“docstatus”:0,“idx”:193,“company_name”:“Hilina Enriched Foods PLC”,“abbr”:“HEFP”,“default_currency”:“ETB”,“country”:“Ethiopia”,“is_group”:0,“lft”:1,“rgt”:2,“old_parent”:”“,“create_chart_of_accounts_based_on”:“Standard Template”,“chart_of_accounts”:“Standard with Numbers”,“default_bank_account”:“Bank Account - HEFP”,“default_cash_account”:“1110 - Cash - HEFP”,“default_receivable_account”:“1310 - Debtors - HEFP”,“round_off_account”:“5212 - Round Off - HEFP”,“round_off_cost_center”:“Main - HEFP”,“write_off_account”:“5218 - Write Off - HEFP”,“exchange_gain_loss_account”:“5219 - Exchange Gain/Loss - HEFP”,“allow_account_creation_against_child_company”:0,“default_payable_account”:“2110 - Creditors - HEFP”,“default_expense_account”:“5111 - Cost of Goods Sold - HEFP”,“default_income_account”:“4110 - Sales - HEFP”,“cos…
File “apps/frappe/frappe/utils/typing_validations.py”, line 31, in wrapper
return func(*args, **kwargs)
args = ()
kwargs = {‘doc’: '{“name”:“Hilina Enriched Foods PLC”,“owner”:“Administrator”,“creation”:“2024-01-16 11:16:16.138742”,“modified”:“2024-03-22 08:50:45.322543”,“modified_by”:“Administrator”,“docstatus”:0,“idx”:193,“company_name”:“Hilina Enriched Foods PLC”,“abbr”:“HEFP”,“default_currency”:“ETB”,“country”:“Ethiopia”,“is_group”:0,“lft”:1,“rgt”:2,“old_parent”:””,“create_chart_of_accounts_based_on”:“Standard Template”,“chart_of_accounts”:“Standard with Numbers”,“default_bank_account”:“Bank Account - HEFP”,“default_cash_account”:“1110 - Cash - HEFP”,“default_receivable_account”:“1310 - Debtors - HEFP”,“round_off_account”:“5212 - Round Off - HEFP”,“round_off_cost_center”:“Main - HEFP”,“write_off_account”:“5218 - Write Off - HEFP”,“exchange_gain_loss_account”:“5219 - Exchange Gain/Loss - HEFP”,“allow_account_creation_against_child_company”:0,“default_payable_account”:“2110 - Creditors - HEFP”,“default_expense_account”:“5111 - Cost of Goods Sold - HEFP”,“default_income_account”:“4110 - Sales - HEFP”,"cos…
apply_condition = <function whitelist..innerfn.. at 0x7010bc27de40>
func = <function savedocs at 0x7010bc237600>
File “apps/frappe/frappe/desk/form/save.py”, line 39, in savedocs
doc.save()
doc = <Company: Hilina Enriched Foods PLC>
action = ‘Save’
File “apps/frappe/frappe/model/document.py”, line 335, in save
return self._save(*args, **kwargs)
self = <Company: Hilina Enriched Foods PLC>
args = ()
kwargs = {}
File “apps/frappe/frappe/model/document.py”, line 371, in _save
self.run_before_save_methods()
self = <Company: Hilina Enriched Foods PLC>
ignore_permissions = None
ignore_version = None
File “apps/frappe/frappe/model/document.py”, line 1089, in run_before_save_methods
self.run_method(“validate”)
self = <Company: Hilina Enriched Foods PLC>
File “apps/frappe/frappe/model/document.py”, line 960, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
self = <Company: Hilina Enriched Foods PLC>
method = ‘validate’
args = ()
kwargs = {}
fn = <function Document.run_method..fn at 0x7010bbcca980>
File “apps/frappe/frappe/model/document.py”, line 1320, in composer
return composed(self, method, args, **kwargs)
self = <Company: Hilina Enriched Foods PLC>
args = ()
kwargs = {}
hooks = [<function validate_default_accounts at 0x7010bbc10a40>, <function apply at 0x7010bbc13e20>]
method = ‘validate’
doc_events = {'
’: {‘on_update’: [‘frappe.desk.notifications.clear_doctype_notifications’, ‘frappe.workflow.doctype.workflow_action.workflow_action.process_workflow_actions’, ‘frappe.core.doctype.file.utils.attach_files_to_document’, ‘frappe.automation.doctype.assignment_rule.assignment_rule.apply’, ‘frappe.automation.doctype.assignment_rule.assignment_rule.update_due_date’, ‘frappe.core.doctype.user_type.user_type.apply_permissions_for_non_standard_user_type’], ‘after_rename’: [‘frappe.desk.notifications.clear_doctype_notifications’], ‘on_cancel’: [‘frappe.desk.notifications.clear_doctype_notifications’, ‘frappe.workflow.doctype.workflow_action.workflow_action.process_workflow_actions’, ‘frappe.automation.doctype.assignment_rule.assignment_rule.apply’], ‘on_trash’: [‘frappe.desk.notifications.clear_doctype_notifications’, ‘frappe.workflow.doctype.workflow_action.workflow_action.process_workflow_actions’], ‘on_update_after_submit’: ['frappe.workflow.doctype.workflow_action.workflow_action.process_w…
handler = ‘erpnext.support.doctype.service_level_agreement.service_level_agreement.apply’
composed = <function Document.hook..compose..runner at 0x7010bbc102c0>
compose = <function Document.hook..compose at 0x7010bbbb6160>
f = <function Document.run_method..fn at 0x7010bbcca980>
File “apps/frappe/frappe/model/document.py”, line 1304, in runner
add_to_return_value(self, f(self, method, *args, **kwargs))
self = <Company: Hilina Enriched Foods PLC>
method = ‘validate’
args = ()
kwargs = {}
f = <function validate_default_accounts at 0x7010bbc10a40>
add_to_return_value = <function Document.hook..add_to_return_value at 0x7010bbbb5b20>
fn = <function Document.run_method..fn at 0x7010bbcca980>
hooks = (<function validate_default_accounts at 0x7010bbc10a40>, <function apply at 0x7010bbc13e20>)
File “apps/hrms/hrms/overrides/company.py”, line 120, in validate_default_accounts
if doc.default_payroll_payable_account:
doc = <Company: Hilina Enriched Foods PLC>
method = ‘validate’
builtins.AttributeError: ‘Company’ object has no attribute ‘default_payroll_payable_account’

App Versions

{
	"erpnext": "15.17.3",
	"frappe": "15.18.0",
	"hrms": "15.14.2",
	"payments": "0.0.1"
}

Route

Form/Company/Hilina Enriched Foods PLC

Traceback

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 110, in application
    response = frappe.api.handle(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/api/__init__.py", line 49, in handle
    data = endpoint(**arguments)
           ^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/api/v1.py", line 36, in handle_rpc_call
    return frappe.handler.handle()
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/handler.py", line 49, in handle
    data = execute_cmd(cmd)
           ^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/handler.py", line 85, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/__init__.py", line 1718, in call
    return fn(*args, **newargs)
           ^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/utils/typing_validations.py", line 31, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/desk/form/save.py", line 39, in savedocs
    doc.save()
  File "apps/frappe/frappe/model/document.py", line 335, in save
    return self._save(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/model/document.py", line 371, in _save
    self.run_before_save_methods()
  File "apps/frappe/frappe/model/document.py", line 1089, in run_before_save_methods
    self.run_method("validate")
  File "apps/frappe/frappe/model/document.py", line 960, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/model/document.py", line 1320, in composer
    return composed(self, method, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/model/document.py", line 1304, in runner
    add_to_return_value(self, f(self, method, *args, **kwargs))
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/hrms/hrms/overrides/company.py", line 120, in validate_default_accounts
    if doc.default_payroll_payable_account:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Company' object has no attribute 'default_payroll_payable_account'

Request Data

{
	"type": "POST",
	"args": {
		"doc": "{\"name\":\"Hilina Enriched Foods PLC\",\"owner\":\"Administrator\",\"creation\":\"2024-01-16 11:16:16.138742\",\"modified\":\"2024-03-22 08:50:45.322543\",\"modified_by\":\"Administrator\",\"docstatus\":0,\"idx\":193,\"company_name\":\"Hilina Enriched Foods PLC\",\"abbr\":\"HEFP\",\"default_currency\":\"ETB\",\"country\":\"Ethiopia\",\"is_group\":0,\"lft\":1,\"rgt\":2,\"old_parent\":\"\",\"create_chart_of_accounts_based_on\":\"Standard Template\",\"chart_of_accounts\":\"Standard with Numbers\",\"default_bank_account\":\"Bank Account - HEFP\",\"default_cash_account\":\"1110 - Cash - HEFP\",\"default_receivable_account\":\"1310 - Debtors - HEFP\",\"round_off_account\":\"5212 - Round Off - HEFP\",\"round_off_cost_center\":\"Main - HEFP\",\"write_off_account\":\"5218 - Write Off - HEFP\",\"exchange_gain_loss_account\":\"5219 - Exchange Gain/Loss - HEFP\",\"allow_account_creation_against_child_company\":0,\"default_payable_account\":\"2110 - Creditors - HEFP\",\"default_expense_account\":\"5111 - Cost of Goods Sold - HEFP\",\"default_income_account\":\"4110 - Sales - HEFP\",\"cost_center\":\"Main - HEFP\",\"book_advance_payments_in_separate_party_account\":0,\"auto_exchange_rate_revaluation\":0,\"auto_err_frequency\":\"Daily\",\"submit_err_jv\":0,\"accumulated_depreciation_account\":\"1780 - Accumulated Depreciation - HEFP\",\"depreciation_expense_account\":\"5203 - Depreciation - HEFP\",\"expenses_included_in_asset_valuation\":\"5112 - Expenses Included In Asset Valuation - HEFP\",\"disposal_account\":\"5220 - Gain/Loss on Asset Disposal - HEFP\",\"depreciation_cost_center\":\"Main - HEFP\",\"capital_work_in_progress_account\":\"1790 - CWIP Account - HEFP\",\"asset_received_but_not_billed\":\"2211 - Asset Received But Not Billed - HEFP\",\"sales_monthly_history\":\"{}\",\"monthly_sales_target\":0,\"total_monthly_sales\":0,\"credit_limit\":0,\"transactions_annual_history\":\"{}\",\"enable_perpetual_inventory\":1,\"enable_provisional_accounting_for_non_stock_items\":0,\"default_inventory_account\":\"1410 - Stock In Hand - HEFP\",\"stock_adjustment_account\":\"5119 - Stock Adjustment - HEFP\",\"stock_received_but_not_billed\":\"2210 - Stock Received But Not Billed - HEFP\",\"expenses_included_in_valuation\":\"5118 - Expenses Included In Valuation - HEFP\",\"doctype\":\"Company\",\"__onload\":{\"addr_list\":[],\"contact_list\":[]},\"date_of_establishment\":\"2024-03-22\",\"__unsaved\":1}",
		"action": "Save"
	},
	"btn": {
		"jQuery370080666330765350241": {
			"events": {
				"click": [
					{
						"type": "click",
						"origType": "click",
						"guid": 910,
						"namespace": ""
					}
				]
			}
		}
	},
	"freeze": true,
	"headers": {},
	"error_handlers": {},
	"url": "/api/method/frappe.desk.form.save.savedocs",
	"request_id": null
}

Response Data

{
	"exception": "AttributeError: 'Company' object has no attribute 'default_payroll_payable_account'",
	"exc_type": "AttributeError",
	"_exc_source": "hrms (app)"
}

Hi @ghion_tesfaw,

We checked in latest version 15 but we haven’t faced the issue.

If the Default Payroll Payable Account is not created then please create it and check it.

Thank You!

HR & Payroll tab not available in my installation?

build the app and migrate the site.

bench build --force
bench --site [your-sitename.com] migrate

Thank You!

I tried your suggestion. Problem Still persists. The Payment module is still in develop mode. Would that be a problem?

Please check it.