mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-19 10:14:59 +00:00
fix: set default posting_date value to None
using mutable python defaults, and especially function calls, inside
function definitions causes bugs that can be really hard to debug
sometimes. please refrain from using such defaults.
instead, using None is almost always a sane default. the values can
then be manipulated inside the function instead.
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
(cherry picked from commit 0d147b011e)
This commit is contained in:
committed by
mergify-bot
parent
804c8709e3
commit
a7f39a9879
@@ -199,10 +199,13 @@ def book_deferred_income_or_expense(doc, deferred_process, posting_date=None):
|
||||
if item.get(enable_check):
|
||||
_book_deferred_revenue_or_expense(item)
|
||||
|
||||
def process_deferred_accounting(posting_date=today()):
|
||||
def process_deferred_accounting(posting_date=None):
|
||||
''' Converts deferred income/expense into income/expense
|
||||
Executed via background jobs on every month end '''
|
||||
|
||||
if not posting_date:
|
||||
posting_date = today()
|
||||
|
||||
if not cint(frappe.db.get_singles_value('Accounts Settings', 'automatically_process_deferred_accounting_entry')):
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user