Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
Dokos
Dokos
Commits
5c0e294f
Commit
5c0e294f
authored
Apr 16, 2020
by
Charles-Henri Decultot
Browse files
Merge branch 'staging'
parents
95377f1b
dc8e57b4
Changes
77
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
75 changed files
with
2942 additions
and
1722 deletions
+2942
-1722
erpnext/__init__.py
erpnext/__init__.py
+1
-1
erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py
.../chart_of_accounts/verified/standard_chart_of_accounts.py
+3
-0
erpnext/accounts/doctype/accounting_period/test_accounting_period.py
...ounts/doctype/accounting_period/test_accounting_period.py
+2
-2
erpnext/accounts/doctype/payment_request/payment_request.py
erpnext/accounts/doctype/payment_request/payment_request.py
+10
-4
erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
+3
-3
erpnext/accounts/doctype/subscription/subscription.py
erpnext/accounts/doctype/subscription/subscription.py
+7
-4
erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.py
...s/report/bank_clearance_summary/bank_clearance_summary.py
+2
-0
erpnext/assets/doctype/asset/asset.js
erpnext/assets/doctype/asset/asset.js
+1
-1
erpnext/assets/doctype/asset/asset.json
erpnext/assets/doctype/asset/asset.json
+507
-503
erpnext/assets/doctype/asset/asset.py
erpnext/assets/doctype/asset/asset.py
+26
-8
erpnext/assets/doctype/asset/asset_list.js
erpnext/assets/doctype/asset/asset_list.js
+1
-2
erpnext/assets/doctype/asset_category/asset_category.json
erpnext/assets/doctype/asset_category/asset_category.json
+114
-114
erpnext/assets/doctype/asset_category/asset_category.py
erpnext/assets/doctype/asset_category/asset_category.py
+1
-0
erpnext/assets/doctype/asset_finance_book/asset_finance_book.json
...assets/doctype/asset_finance_book/asset_finance_book.json
+84
-334
erpnext/assets/doctype/asset_maintenance/test_asset_maintenance.py
...ssets/doctype/asset_maintenance/test_asset_maintenance.py
+1
-1
erpnext/assets/doctype/asset_movement/asset_movement.json
erpnext/assets/doctype/asset_movement/asset_movement.json
+148
-148
erpnext/assets/doctype/asset_movement/asset_movement.py
erpnext/assets/doctype/asset_movement/asset_movement.py
+1
-1
erpnext/assets/doctype/asset_movement/test_asset_movement.py
erpnext/assets/doctype/asset_movement/test_asset_movement.py
+1
-1
erpnext/assets/doctype/asset_movement_item/asset_movement_item.json
...sets/doctype/asset_movement_item/asset_movement_item.json
+85
-85
erpnext/assets/doctype/asset_movement_item/asset_movement_item.py
...assets/doctype/asset_movement_item/asset_movement_item.py
+1
-1
erpnext/assets/doctype/asset_value_adjustment/asset_value_adjustment.py
.../doctype/asset_value_adjustment/asset_value_adjustment.py
+1
-1
erpnext/assets/doctype/depreciation_schedule/depreciation_schedule.json
.../doctype/depreciation_schedule/depreciation_schedule.json
+94
-305
erpnext/assets/doctype/location/location.json
erpnext/assets/doctype/location/location.json
+28
-1
erpnext/commands/__init__.py
erpnext/commands/__init__.py
+3
-2
erpnext/controllers/buying_controller.py
erpnext/controllers/buying_controller.py
+1
-1
erpnext/crm/doctype/lead/lead.json
erpnext/crm/doctype/lead/lead.json
+1
-8
erpnext/demo/data/en/account.json
erpnext/demo/data/en/account.json
+0
-0
erpnext/demo/data/en/address.json
erpnext/demo/data/en/address.json
+0
-0
erpnext/demo/data/en/assessment_criteria.json
erpnext/demo/data/en/assessment_criteria.json
+0
-0
erpnext/demo/data/en/asset.json
erpnext/demo/data/en/asset.json
+0
-0
erpnext/demo/data/en/asset_category.json
erpnext/demo/data/en/asset_category.json
+12
-12
erpnext/demo/data/en/bom.json
erpnext/demo/data/en/bom.json
+0
-0
erpnext/demo/data/en/contact.json
erpnext/demo/data/en/contact.json
+0
-0
erpnext/demo/data/en/department.json
erpnext/demo/data/en/department.json
+0
-0
erpnext/demo/data/en/employee.json
erpnext/demo/data/en/employee.json
+0
-0
erpnext/demo/data/en/item.json
erpnext/demo/data/en/item.json
+0
-0
erpnext/demo/data/en/lead.json
erpnext/demo/data/en/lead.json
+0
-0
erpnext/demo/data/en/operation.json
erpnext/demo/data/en/operation.json
+0
-0
erpnext/demo/data/en/user.json
erpnext/demo/data/en/user.json
+1
-1
erpnext/demo/data/fr/account.json
erpnext/demo/data/fr/account.json
+18
-0
erpnext/demo/data/fr/address.json
erpnext/demo/data/fr/address.json
+218
-0
erpnext/demo/data/fr/assessment_criteria.json
erpnext/demo/data/fr/assessment_criteria.json
+18
-0
erpnext/demo/data/fr/asset.json
erpnext/demo/data/fr/asset.json
+58
-0
erpnext/demo/data/fr/asset_category.json
erpnext/demo/data/fr/asset_category.json
+38
-0
erpnext/demo/data/fr/bom.json
erpnext/demo/data/fr/bom.json
+180
-0
erpnext/demo/data/fr/contact.json
erpnext/demo/data/fr/contact.json
+164
-0
erpnext/demo/data/fr/department.json
erpnext/demo/data/fr/department.json
+30
-0
erpnext/demo/data/fr/employee.json
erpnext/demo/data/fr/employee.json
+92
-0
erpnext/demo/data/fr/item.json
erpnext/demo/data/fr/item.json
+493
-0
erpnext/demo/data/fr/lead.json
erpnext/demo/data/fr/lead.json
+127
-0
erpnext/demo/data/fr/operation.json
erpnext/demo/data/fr/operation.json
+32
-0
erpnext/demo/data/fr/user.json
erpnext/demo/data/fr/user.json
+134
-0
erpnext/demo/data/program.json
erpnext/demo/data/program.json
+0
-46
erpnext/demo/demo.py
erpnext/demo/demo.py
+6
-2
erpnext/demo/domains.py
erpnext/demo/domains.py
+1
-1
erpnext/demo/setup/manufacture.py
erpnext/demo/setup/manufacture.py
+10
-6
erpnext/demo/setup/retail.py
erpnext/demo/setup/retail.py
+1
-1
erpnext/demo/setup/setup_data.py
erpnext/demo/setup/setup_data.py
+35
-33
erpnext/demo/user/accounts.py
erpnext/demo/user/accounts.py
+7
-1
erpnext/demo/user/dashboard.py
erpnext/demo/user/dashboard.py
+29
-0
erpnext/demo/user/fixed_asset.py
erpnext/demo/user/fixed_asset.py
+16
-31
erpnext/demo/user/hr.py
erpnext/demo/user/hr.py
+6
-3
erpnext/demo/user/manufacturing.py
erpnext/demo/user/manufacturing.py
+9
-6
erpnext/demo/user/projects.py
erpnext/demo/user/projects.py
+4
-2
erpnext/demo/user/purchase.py
erpnext/demo/user/purchase.py
+4
-2
erpnext/demo/user/sales.py
erpnext/demo/user/sales.py
+13
-8
erpnext/demo/user/stock.py
erpnext/demo/user/stock.py
+6
-4
erpnext/erpnext_integrations/doctype/gocardless_settings/gocardless_settings.py
...ations/doctype/gocardless_settings/gocardless_settings.py
+6
-6
erpnext/erpnext_integrations/webhooks_controller.py
erpnext/erpnext_integrations/webhooks_controller.py
+31
-11
erpnext/hooks.py
erpnext/hooks.py
+2
-1
erpnext/setup/doctype/naming_series/naming_series.py
erpnext/setup/doctype/naming_series/naming_series.py
+1
-1
erpnext/setup/utils.py
erpnext/setup/utils.py
+1
-1
erpnext/templates/emails/confirm_appointment.html
erpnext/templates/emails/confirm_appointment.html
+1
-1
erpnext/templates/pages/demo.html
erpnext/templates/pages/demo.html
+3
-3
erpnext/translations/fr-CA.json
erpnext/translations/fr-CA.json
+8
-8
No files found.
erpnext/__init__.py
View file @
5c0e294f
...
...
@@ -5,7 +5,7 @@ import frappe
from
erpnext.hooks
import
regional_overrides
from
frappe.utils
import
getdate
__version__
=
'1.
3.15
'
__version__
=
'1.
4.0
'
def
get_default_company
(
user
=
None
):
'''Get default company for user'''
...
...
erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py
View file @
5c0e294f
...
...
@@ -81,6 +81,9 @@ def get():
},
_
(
"Expenses"
):
{
_
(
"Direct Expenses"
):
{
_
(
"Direct Expenses Account"
):
{
"account_type"
:
"Expense Account"
},
_
(
"Stock Expenses"
):
{
_
(
"Cost of Goods Sold"
):
{
"account_type"
:
"Cost of Goods Sold"
...
...
erpnext/accounts/doctype/accounting_period/test_accounting_period.py
View file @
5c0e294f
...
...
@@ -13,11 +13,11 @@ from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sal
class
TestAccountingPeriod
(
unittest
.
TestCase
):
def
test_overlap
(
self
):
ap1
=
create_accounting_period
(
start_date
=
"2018-04-01"
,
end_date
=
"2018-06-30"
,
company
=
"Wind Power
LLC
"
)
end_date
=
"2018-06-30"
,
company
=
"Wind Power"
)
ap1
.
save
()
ap2
=
create_accounting_period
(
start_date
=
"2018-06-30"
,
end_date
=
"2018-07-10"
,
company
=
"Wind Power
LLC
"
,
period_name
=
"Test Accounting Period 1"
)
end_date
=
"2018-07-10"
,
company
=
"Wind Power"
,
period_name
=
"Test Accounting Period 1"
)
self
.
assertRaises
(
OverlapError
,
ap2
.
save
)
def
test_accounting_period
(
self
):
...
...
erpnext/accounts/doctype/payment_request/payment_request.py
View file @
5c0e294f
...
...
@@ -471,6 +471,7 @@ def make_payment_request(**args):
pr
=
frappe
.
new_doc
(
"Payment Request"
)
pr
.
update
({
"currency"
:
ref_doc
.
currency
,
"no_payment_link"
:
args
.
no_payment_link
,
"grand_total"
:
grand_total
,
"email_to"
:
args
.
recipient_id
or
""
,
"subject"
:
_
(
"Payment Request for {0}"
).
format
(
args
.
dn
),
...
...
@@ -541,21 +542,26 @@ def get_existing_payment_request_amount(ref_dt, ref_dn):
def
get_gateway_details
(
args
):
"""return gateway and payment account of default payment gateway"""
filters
=
{}
if
args
.
get
(
"currency"
):
filters
.
update
({
"currency"
:
args
.
get
(
"currency"
)})
if
args
.
get
(
"payment_gateway"
):
return
get_payment_gateway_account
(
args
.
get
(
"payment_gateway"
))
filters
.
update
({
"payment_gateway"
:
args
.
get
(
"payment_gateway"
)})
return
get_payment_gateway_account
(
filters
)
if
args
.
order_type
==
"Shopping Cart"
:
payment_gateway_account
=
frappe
.
get_doc
(
"Shopping Cart Settings"
).
payment_gateway_account
return
get_payment_gateway_account
(
payment_gateway_account
)
gateway_account
=
get_payment_gateway_account
({
"is_default"
:
1
})
filters
.
update
({
"is_default"
:
1
})
gateway_account
=
get_payment_gateway_account
(
filters
)
return
gateway_account
def
get_payment_gateway_account
(
args
):
return
frappe
.
db
.
get_value
(
"Payment Gateway Account"
,
args
,
[
"name"
,
"payment_gateway"
,
"message"
],
as_dict
=
1
)
[
"name"
,
"payment_gateway"
],
as_dict
=
1
)
@
frappe
.
whitelist
()
def
get_print_format_list
(
ref_doctype
):
...
...
erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
View file @
5c0e294f
...
...
@@ -1702,7 +1702,7 @@ class TestSalesInvoice(unittest.TestCase):
})
customer
.
append
(
"companies"
,
{
"company"
:
"Wind Power
LLC
"
"company"
:
"Wind Power"
})
customer
.
insert
()
...
...
@@ -1713,7 +1713,7 @@ class TestSalesInvoice(unittest.TestCase):
"supplier_name"
:
"_Test Internal Supplier"
,
"doctype"
:
"Supplier"
,
"is_internal_supplier"
:
1
,
"represents_company"
:
"Wind Power
LLC
"
"represents_company"
:
"Wind Power"
})
supplier
.
append
(
"companies"
,
{
...
...
@@ -1723,7 +1723,7 @@ class TestSalesInvoice(unittest.TestCase):
supplier
.
insert
()
si
=
create_sales_invoice
(
company
=
"Wind Power
LLC
"
,
company
=
"Wind Power"
,
customer
=
"_Test Internal Customer"
,
debit_to
=
"Debtors - WP"
,
warehouse
=
"Stores - WP"
,
...
...
erpnext/accounts/doctype/subscription/subscription.py
View file @
5c0e294f
...
...
@@ -101,15 +101,18 @@ class Subscription(Document):
if
not
self
.
has_invoice_for_period
():
self
.
generate_invoice
(
payment_entry
=
payment_entry
)
self
.
update_subscription_period
(
add_days
(
self
.
current_invoice_end
,
1
))
self
.
save
()
self
.
generate_sales_order
()
else
:
self
.
update_subscription_period
(
add_days
(
self
.
current_invoice_end
,
1
))
self
.
save
()
self
.
generate_sales_order
()
elif
self
.
generate_invoice_at_period_start
:
self
.
set_plan_details_status
()
if
self
.
has_invoice_for_period
()
and
self
.
period_has_passed
(
self
.
current_invoice_end
):
self
.
update_subscription_period
(
add_days
(
self
.
current_invoice_end
,
1
))
self
.
save
()
self
.
generate_sales_order
()
self
.
generate_invoice
(
payment_entry
=
payment_entry
)
...
...
@@ -117,8 +120,6 @@ class Subscription(Document):
self
.
generate_sales_order
()
self
.
generate_invoice
(
payment_entry
=
payment_entry
)
self
.
save
()
@
staticmethod
def
period_has_passed
(
end_date
):
if
not
end_date
:
...
...
@@ -565,7 +566,8 @@ class Subscription(Document):
filters
=
{
"event_type"
:
"Payment request created"
,
"period_start"
:
self
.
current_invoice_start
,
"period_end"
:
self
.
current_invoice_end
"period_end"
:
self
.
current_invoice_end
,
"subscription"
:
self
.
name
}
):
return
False
...
...
@@ -791,7 +793,8 @@ def check_gateway_payments():
"party"
:
doc
.
customer
,
"submit_doc"
:
True
,
"mute_email"
:
True
,
"payment_gateway"
:
doc
.
payment_gateway
"payment_gateway"
:
doc
.
payment_gateway
,
"currency"
:
doc
.
currency
})
if
pr
.
get
(
"payment_gateway_account"
)
and
float
(
pr
.
get
(
"grand_total"
))
>
0
:
...
...
erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.py
View file @
5c0e294f
...
...
@@ -78,6 +78,8 @@ def get_entries(filters):
order by si.posting_date DESC, si.name DESC"""
.
format
(
conditions
),
filters
,
as_list
=
1
)
mops
=
tuple
([
frappe
.
db
.
escape
(
x
.
parent
)
for
x
in
frappe
.
get_all
(
"Mode of Payment Account"
,
{
"default_account"
:
filters
.
get
(
"account"
)},
"parent"
)])
if
not
mops
:
frappe
.
throw
(
_
(
"Please create at least one mode of payment for this bank account first"
))
expense_claims
=
frappe
.
db
.
sql
(
"""SELECT
"Expense Claim", name, posting_date, remark, clearance_date, employee,
total_amount_reimbursed
...
...
erpnext/assets/doctype/asset/asset.js
View file @
5c0e294f
...
...
@@ -518,4 +518,4 @@ erpnext.asset.transfer_asset = function() {
}
}
});
};
\ No newline at end of file
};
erpnext/assets/doctype/asset/asset.json
View file @
5c0e294f
This diff is collapsed.
Click to expand it.
erpnext/assets/doctype/asset/asset.py
View file @
5c0e294f
...
...
@@ -6,7 +6,7 @@ from __future__ import unicode_literals
import
frappe
,
erpnext
,
math
,
json
from
frappe
import
_
from
six
import
string_types
from
frappe.utils
import
flt
,
add_months
,
cint
,
nowdate
,
getdate
,
today
,
date_diff
,
month_diff
,
add_days
from
frappe.utils
import
flt
,
add_months
,
cint
,
nowdate
,
getdate
,
today
,
date_diff
,
month_diff
,
add_days
,
get_last_day
from
frappe.model.document
import
Document
from
erpnext.assets.doctype.asset_category.asset_category
import
get_asset_category_account
from
erpnext.assets.doctype.asset.depreciation
\
...
...
@@ -194,8 +194,11 @@ class Asset(AccountsController):
d
.
total_number_of_depreciations
,
d
)
if
not
has_pro_rata
or
n
<
cint
(
number_of_pending_depreciations
)
-
1
:
schedule_date
=
add_months
(
d
.
depreciation_start_date
,
n
*
cint
(
d
.
frequency_of_depreciation
))
if
d
.
depreciation_method
==
"Prorated Straight Line (360 Days)"
and
self
.
schedules
:
schedule_date
=
add_months
(
self
.
schedules
[
-
1
].
schedule_date
,
cint
(
d
.
frequency_of_depreciation
))
else
:
schedule_date
=
add_months
(
d
.
depreciation_start_date
,
n
*
cint
(
d
.
frequency_of_depreciation
))
# schedule date will be a year later from start date
# so monthly schedule date is calculated by removing 11 months from it
...
...
@@ -220,7 +223,11 @@ class Asset(AccountsController):
monthly_schedule_date
=
add_months
(
schedule_date
,
1
)
schedule_date
=
add_days
(
schedule_date
,
days
)
if
d
.
depreciation_method
==
"Prorated Straight Line (360 Days)"
:
schedule_date
=
add_months
(
self
.
available_for_use_date
,
n
*
cint
(
d
.
frequency_of_depreciation
))
else
:
schedule_date
=
add_days
(
schedule_date
,
days
)
last_schedule_date
=
schedule_date
if
not
depreciation_amount
:
continue
...
...
@@ -284,7 +291,10 @@ class Asset(AccountsController):
has_pro_rata
=
False
days
=
date_diff
(
row
.
depreciation_start_date
,
self
.
available_for_use_date
)
+
1
total_days
=
get_total_days
(
row
.
depreciation_start_date
,
row
.
frequency_of_depreciation
)
if
row
.
depreciation_method
==
"Prorated Straight Line (360 Days)"
:
total_days
=
360
else
:
total_days
=
get_total_days
(
row
.
depreciation_start_date
,
row
.
frequency_of_depreciation
)
if
days
<
total_days
:
has_pro_rata
=
True
...
...
@@ -373,6 +383,8 @@ class Asset(AccountsController):
depreciation_amount
=
(
flt
(
row
.
value_after_depreciation
)
-
flt
(
row
.
expected_value_after_useful_life
))
/
depreciation_left
elif
row
.
depreciation_method
==
'Prorated Straight Line (360 Days)'
:
return
flt
(
row
.
value_after_depreciation
)
*
(
1.0
/
cint
(
row
.
total_number_of_depreciations
))
else
:
depreciation_amount
=
flt
(
depreciable_value
*
(
flt
(
row
.
rate_of_depreciation
)
/
100
),
precision
)
...
...
@@ -687,9 +699,15 @@ def is_cwip_accounting_enabled(asset_category):
return
cint
(
frappe
.
db
.
get_value
(
"Asset Category"
,
asset_category
,
"enable_cwip_accounting"
))
def
get_pro_rata_amt
(
row
,
depreciation_amount
,
from_date
,
to_date
):
days
=
date_diff
(
to_date
,
from_date
)
months
=
month_diff
(
to_date
,
from_date
)
total_days
=
get_total_days
(
to_date
,
row
.
frequency_of_depreciation
)
if
row
.
depreciation_method
==
"Prorated Straight Line (360 Days)"
:
todate
=
get_last_day
(
from_date
)
if
getdate
(
to_date
).
month
==
12
else
to_date
fromdate
=
get_last_day
(
to_date
)
if
getdate
(
from_date
).
month
==
12
else
from_date
days
=
date_diff
(
todate
,
fromdate
)
+
(
cint
(
months
)
-
1
)
*
30
total_days
=
min
(
get_total_days
(
to_date
,
row
.
frequency_of_depreciation
),
360
)
else
:
total_days
=
get_total_days
(
to_date
,
row
.
frequency_of_depreciation
)
days
=
date_diff
(
to_date
,
from_date
)
return
(
depreciation_amount
*
flt
(
days
))
/
flt
(
total_days
),
days
,
months
...
...
@@ -697,4 +715,4 @@ def get_total_days(date, frequency):
period_start_date
=
add_months
(
date
,
cint
(
frequency
)
*
-
1
)
return
date_diff
(
date
,
period_start_date
)
\ No newline at end of file
return
date_diff
(
date
,
period_start_date
)
erpnext/assets/doctype/asset/asset_list.js
View file @
5c0e294f
...
...
@@ -30,7 +30,6 @@ frappe.listview_settings['Asset'] = {
}
else
if
(
doc
.
status
===
"
Draft
"
)
{
return
[
__
(
"
Draft
"
),
"
red
"
,
"
status,=,Draft
"
];
}
},
onload
:
function
(
me
)
{
...
...
@@ -50,5 +49,5 @@ frappe.listview_settings['Asset'] = {
}
});
});
}
}
,
}
\ No newline at end of file
erpnext/assets/doctype/asset_category/asset_category.json
View file @
5c0e294f
{
"allow_import"
:
1
,
"allow_rename"
:
1
,
"autoname"
:
"field:asset_category_name"
,
"creation"
:
"2016-03-01 17:41:39.778765"
,
"doctype"
:
"DocType"
,
"document_type"
:
"Document"
,
"engine"
:
"InnoDB"
,
"field_order"
:
[
"asset_category_name"
,
"column_break_3"
,
"depreciation_options"
,
"enable_cwip_accounting"
,
"finance_book_detail"
,
"finance_books"
,
"section_break_2"
,
"accounts"
],
"fields"
:
[
{
"fieldname"
:
"asset_category_name"
,
"fieldtype"
:
"Data"
,
"in_list_view"
:
1
,
"label"
:
"Asset Category Name"
,
"reqd"
:
1
,
"unique"
:
1
},
{
"fieldname"
:
"column_break_3"
,
"fieldtype"
:
"Column Break"
},
{
"fieldname"
:
"finance_book_detail"
,
"fieldtype"
:
"Section Break"
,
"label"
:
"Finance Book Detail"
},
{
"fieldname"
:
"finance_books"
,
"fieldtype"
:
"Table"
,
"label"
:
"Finance Books"
,
"options"
:
"Asset Finance Book"
},
{
"fieldname"
:
"section_break_2"
,
"fieldtype"
:
"Section Break"
,
"label"
:
"Accounts"
},
{
"fieldname"
:
"accounts"
,
"fieldtype"
:
"Table"
,
"label"
:
"Accounts"
,
"options"
:
"Asset Category Account"
,
"reqd"
:
1
},
{
"fieldname"
:
"depreciation_options"
,
"fieldtype"
:
"Section Break"
,
"label"
:
"Depreciation Options"
},
{
"default"
:
"0"
,
"fieldname"
:
"enable_cwip_accounting"
,
"fieldtype"
:
"Check"
,
"label"
:
"Enable Capital Work in Progress Accounting"
}
],
"modified"
:
"2019-10-11 12:19:59.759136"
,
"modified_by"
:
"Administrator"
,
"module"
:
"Assets"
,
"name"
:
"Asset Category"
,
"owner"
:
"Administrator"
,
"permissions"
:
[
{
"create"
:
1
,
"delete"
:
1
,
"email"
:
1
,
"export"
:
1
,
"import"
:
1
,
"print"
:
1
,
"read"
:
1
,
"report"
:
1
,
"role"
:
"Accounts User"
,
"share"
:
1
,
"write"
:
1
},
{
"create"
:
1
,
"delete"
:
1
,
"email"
:
1
,
"export"
:
1
,
"import"
:
1
,
"print"
:
1
,
"read"
:
1
,
"report"
:
1
,
"role"
:
"Accounts Manager"
,
"share"
:
1
,
"write"
:
1
},
{
"create"
:
1
,
"delete"
:
1
,
"email"
:
1
,
"export"
:
1
,
"print"
:
1
,
"read"
:
1
,
"report"
:
1
,
"role"
:
"Quality Manager"
,
"share"
:
1
,
"write"
:
1
}
],
"show_name_in_global_search"
:
1
,
"sort_field"
:
"modified"
,
"sort_order"
:
"DESC"
}
\ No newline at end of file
"allow_import"
:
1
,
"allow_rename"
:
1
,
"autoname"
:
"field:asset_category_name"
,
"creation"
:
"2016-03-01 17:41:39.778765"
,
"doctype"
:
"DocType"
,
"document_type"
:
"Document"
,
"engine"
:
"InnoDB"
,
"field_order"
:
[
"asset_category_name"
,
"column_break_3"
,
"depreciation_options"
,
"enable_cwip_accounting"
,
"finance_book_detail"
,
"finance_books"
,
"section_break_2"
,
"accounts"
],
"fields"
:
[
{
"fieldname"
:
"asset_category_name"
,
"fieldtype"
:
"Data"
,
"in_list_view"
:
1
,
"label"
:
"Asset Category Name"
,
"reqd"
:
1
,
"unique"
:
1
},
{
"fieldname"
:
"column_break_3"
,
"fieldtype"
:
"Column Break"
},
{
"fieldname"
:
"finance_book_detail"
,
"fieldtype"
:
"Section Break"
,
"label"
:
"Finance Book Detail"
},
{
"fieldname"
:
"finance_books"
,
"fieldtype"
:
"Table"
,
"label"
:
"Finance Books"
,
"options"
:
"Asset Finance Book"
},
{
"fieldname"
:
"section_break_2"
,
"fieldtype"
:
"Section Break"
,
"label"
:
"Accounts"
},
{
"fieldname"
:
"accounts"
,
"fieldtype"
:
"Table"
,
"label"
:
"Accounts"
,
"options"
:
"Asset Category Account"
,
"reqd"
:
1
},
{
"fieldname"
:
"depreciation_options"
,
"fieldtype"
:
"Section Break"
,
"label"
:
"Depreciation Options"
},
{
"default"
:
"0"
,
"fieldname"
:
"enable_cwip_accounting"
,
"fieldtype"
:
"Check"
,
"label"
:
"Enable Capital Work in Progress Accounting"
}
],
"modified"
:
"2019-10-11 12:19:59.759136"
,
"modified_by"
:
"Administrator"
,
"module"
:
"Assets"
,
"name"
:
"Asset Category"
,
"owner"
:
"Administrator"
,
"permissions"
:
[
{
"create"
:
1
,
"delete"
:
1
,
"email"
:
1
,
"export"
:
1
,
"import"
:
1
,
"print"
:
1
,
"read"
:
1
,
"report"
:
1
,
"role"
:
"Accounts User"
,
"share"
:
1
,
"write"
:
1
},
{
"create"
:
1
,
"delete"
:
1
,
"email"
:
1
,
"export"
:
1
,
"import"
:
1
,
"print"
:
1
,
"read"
:
1
,
"report"
:
1
,
"role"
:
"Accounts Manager"
,
"share"
:
1
,
"write"
:
1
},
{
"create"
:
1
,
"delete"
:
1
,
"email"
:
1
,
"export"
:
1
,
"print"
:
1
,
"read"
:
1
,
"report"
:
1
,
"role"
:
"Quality Manager"
,
"share"
:
1
,
"write"
:
1
}
],
"show_name_in_global_search"
:
1
,
"sort_field"
:
"modified"
,
"sort_order"
:
"DESC"
}
\ No newline at end of file
erpnext/assets/doctype/asset_category/asset_category.py
View file @
5c0e294f
...
...
@@ -22,6 +22,7 @@ class AssetCategory(Document):
def
get_asset_category_account
(
fieldname
,
item
=
None
,
asset
=
None
,
account
=
None
,
asset_category
=
None
,
company
=
None
):
if
item
and
frappe
.
db
.
get_value
(
"Item"
,
item
,
"is_fixed_asset"
):
asset_category
=
frappe
.
db
.
get_value
(
"Item"
,
item
,
[
"asset_category"
])
elif
not
asset_category
or
not
company
:
if
account
:
if
frappe
.
db
.
get_value
(
"Account"
,
account
,
"account_type"
)
!=
"Fixed Asset"
:
...
...
erpnext/assets/doctype/asset_finance_book/asset_finance_book.json
View file @
5c0e294f
{
"allow_copy"
:
0
,
"allow_events_in_timeline"
:
0
,
"allow_guest_to_view"
:
0
,
"allow_import"
:
0
,
"allow_rename"
:
0
,
"beta"
:
0
,
"creation"
:
"2018-05-08 14:44:37.095570"
,
"custom"
:
0
,
"docstatus"
:
0
,
"doctype"
:
"DocType"
,
"document_type"
:
""
,
"editable_grid"
:
1
,
"engine"
:
"InnoDB"
,
"actions"
:
[],
"creation"
:
"2018-05-08 14:44:37.095570"
,
"doctype"
:
"DocType"
,
"editable_grid"
:
1
,
"engine"
:
"InnoDB"
,
"field_order"
:
[
"finance_book"
,
"depreciation_method"
,
"total_number_of_depreciations"
,
"column_break_5"
,
"frequency_of_depreciation"
,
"depreciation_start_date"
,
"expected_value_after_useful_life"
,
"value_after_depreciation"
,
"rate_of_depreciation"
],
"fields"
:
[
{
"allow_bulk_edit"
:
0
,
"allow_in_quick_entry"
:
0
,
"allow_on_submit"
:
0
,
"bold"
:
0
,
"collapsible"
:
0
,
"columns"
:
0
,
"depends_on"
:
""
,
"fetch_if_empty"
:
0
,
"fieldname"
:
"finance_book"
,
"fieldtype"
:
"Link"
,
"hidden"
:
0
,
"ignore_user_permissions"
:
0
,
"ignore_xss_filter"
:
0
,
"in_filter"
:
0
,
"in_global_search"
:
0
,
"in_list_view"
:
1
,
"in_standard_filter"
:
0
,
"label"
:
"Finance Book"
,
"length"
:
0
,