mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-05 13:24:47 +00:00
fixes in cleanup data
This commit is contained in:
@@ -724,6 +724,8 @@ class DocType(SellingController):
|
|||||||
|
|
||||||
# expense account gl entries
|
# expense account gl entries
|
||||||
if auto_inventory_accounting and flt(item.buying_amount):
|
if auto_inventory_accounting and flt(item.buying_amount):
|
||||||
|
self.check_expense_account(item)
|
||||||
|
|
||||||
gl_entries.append(
|
gl_entries.append(
|
||||||
self.get_gl_dict({
|
self.get_gl_dict({
|
||||||
"account": item.expense_account,
|
"account": item.expense_account,
|
||||||
@@ -814,6 +816,11 @@ class DocType(SellingController):
|
|||||||
|
|
||||||
return item_buying_amount
|
return item_buying_amount
|
||||||
|
|
||||||
|
def check_expense_account(self, item):
|
||||||
|
if not item.expense_account:
|
||||||
|
msgprint(_("""Expense account is mandatory for item: """) + item.item_code,
|
||||||
|
raise_exception=1)
|
||||||
|
|
||||||
def update_c_form(self):
|
def update_c_form(self):
|
||||||
"""Update amended id in C-form"""
|
"""Update amended id in C-form"""
|
||||||
if self.doc.c_form_no and self.doc.amended_from:
|
if self.doc.c_form_no and self.doc.amended_from:
|
||||||
|
|||||||
@@ -20,16 +20,14 @@ import webnotes
|
|||||||
def delete_transactions():
|
def delete_transactions():
|
||||||
print "Deleting transactions..."
|
print "Deleting transactions..."
|
||||||
|
|
||||||
trans = ['Timesheet','Task','Support Ticket','Stock Reconciliation', 'Stock Ledger Entry', \
|
trans = ['Timesheet', 'Task', 'Support Ticket', 'Stock Reconciliation', 'Stock Ledger Entry',
|
||||||
'Stock Entry','Sales Order','Salary Slip','Sales Invoice','Quotation', 'Quality Inspection', \
|
'Stock Entry', 'Sales Order', 'Salary Slip','Sales Invoice', 'Quotation',
|
||||||
'Purchase Receipt','Purchase Order','Production Order', 'POS Setting','Period Closing Voucher', \
|
'Quality Inspection', 'Purchase Receipt', 'Purchase Order', 'Production Order',
|
||||||
'Purchase Invoice','Maintenance Visit','Maintenance Schedule','Leave Application', \
|
'POS Setting', 'Period Closing Voucher', 'Purchase Invoice', 'Maintenance Visit',
|
||||||
'Leave Allocation', 'Lead', 'Journal Voucher', 'Installation Note','Material Request', \
|
'Maintenance Schedule', 'Leave Application', 'Leave Allocation', 'Lead', 'Journal Voucher',
|
||||||
'GL Entry','Expense Claim','Opportunity','Delivery Note','Customer Issue','Bin', \
|
'Installation Note', 'Material Request', 'GL Entry', 'Expense Claim', 'Opportunity',
|
||||||
'Authorization Rule','Attendance', 'C-Form', 'Form 16A', 'Lease Agreement', \
|
'Delivery Note', 'Customer Issue', 'Bin', 'Authorization Rule', 'Attendance', 'C-Form',
|
||||||
'Lease Installment', 'TDS Payment', 'TDS Return Acknowledgement', 'Appraisal', \
|
'Appraisal', 'Installation Note', 'Communication']
|
||||||
'Installation Note', 'Communication'
|
|
||||||
]
|
|
||||||
for d in trans:
|
for d in trans:
|
||||||
for t in webnotes.conn.sql("select options from tabDocField where parent='%s' and fieldtype='Table'" % d):
|
for t in webnotes.conn.sql("select options from tabDocField where parent='%s' and fieldtype='Table'" % d):
|
||||||
webnotes.conn.sql("delete from `tab%s`" % (t))
|
webnotes.conn.sql("delete from `tab%s`" % (t))
|
||||||
@@ -115,7 +113,7 @@ def reset_all_series():
|
|||||||
def reset_transaction_series():
|
def reset_transaction_series():
|
||||||
webnotes.conn.sql("""update tabSeries set current = 0 where name in
|
webnotes.conn.sql("""update tabSeries set current = 0 where name in
|
||||||
('JV', 'INV', 'BILL', 'SO', 'DN', 'PO', 'LEAD', 'ENQUIRY', 'ENQ', 'CI',
|
('JV', 'INV', 'BILL', 'SO', 'DN', 'PO', 'LEAD', 'ENQUIRY', 'ENQ', 'CI',
|
||||||
'IN', 'PS', 'IDT', 'QAI', 'QTN', 'STE', 'SQTN', 'SUP', 'TDSP', 'SR',
|
'IN', 'PS', 'IDT', 'QAI', 'QTN', 'STE', 'SQTN', 'SUP', 'SR',
|
||||||
'POS', 'LAP', 'LAL', 'EXP')""")
|
'POS', 'LAP', 'LAL', 'EXP')""")
|
||||||
print "Series updated"
|
print "Series updated"
|
||||||
|
|
||||||
@@ -128,27 +126,27 @@ def delete_main_masters():
|
|||||||
webnotes.conn.sql("delete from `tab%s`" % (d))
|
webnotes.conn.sql("delete from `tab%s`" % (d))
|
||||||
print "Deleted " + d
|
print "Deleted " + d
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def reset_global_defaults():
|
def reset_global_defaults():
|
||||||
flds = {
|
flds = {
|
||||||
'default_company': '',
|
'default_company': None,
|
||||||
'default_currency': '',
|
'default_currency': None,
|
||||||
'current_fiscal_year': '',
|
'current_fiscal_year': None,
|
||||||
'date_format': 'dd-mm-yyyy',
|
'date_format': 'dd-mm-yyyy',
|
||||||
'sms_sender_name': '',
|
'sms_sender_name': None,
|
||||||
'default_item_group': 'Default',
|
'default_item_group': 'Default',
|
||||||
'default_stock_uom': 'Nos',
|
'default_stock_uom': 'Nos',
|
||||||
'default_valuation_method': 'FIFO',
|
'default_valuation_method': 'FIFO',
|
||||||
'default_warehouse_type': 'Default Warehouse Type',
|
'default_warehouse_type': 'Default Warehouse Type',
|
||||||
'tolerance': '',
|
'tolerance': None,
|
||||||
'acc_frozen_upto': '',
|
'acc_frozen_upto': None,
|
||||||
'bde_auth_role': '',
|
'bde_auth_role': None,
|
||||||
'credit_controller': '',
|
'credit_controller': None,
|
||||||
'default_customer_group': 'Default Customer Group',
|
'default_customer_group': 'Default Customer Group',
|
||||||
'default_territory': 'Default',
|
'default_territory': 'Default',
|
||||||
'default_price_list': 'Standard',
|
'default_price_list': 'Standard',
|
||||||
'default_supplier_type': 'Default Supplier Type'
|
'default_supplier_type': 'Default Supplier Type',
|
||||||
|
'hide_currency_symbol': None,
|
||||||
|
'default_price_list_currency': None,
|
||||||
}
|
}
|
||||||
|
|
||||||
from webnotes.model.code import get_obj
|
from webnotes.model.code import get_obj
|
||||||
|
|||||||
Reference in New Issue
Block a user