Removed check for duplicate in sales bom, set default income account in Company
This commit is contained in:
parent
f62da519d6
commit
a47bf2ab66
@ -3,11 +3,6 @@
|
|||||||
|
|
||||||
cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
||||||
cur_frm.toggle_enable('new_item_code', doc.__islocal);
|
cur_frm.toggle_enable('new_item_code', doc.__islocal);
|
||||||
if(!doc.__islocal) {
|
|
||||||
cur_frm.add_custom_button(__("Check for Duplicates"), function() {
|
|
||||||
return cur_frm.call_server('check_duplicate', 1)
|
|
||||||
}, 'icon-search')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cur_frm.fields_dict.new_item_code.get_query = function() {
|
cur_frm.fields_dict.new_item_code.get_query = function() {
|
||||||
|
@ -94,10 +94,13 @@ class Company(Document):
|
|||||||
|
|
||||||
def set_default_accounts(self):
|
def set_default_accounts(self):
|
||||||
def _set_default_account(fieldname, account_type):
|
def _set_default_account(fieldname, account_type):
|
||||||
|
if self.get(fieldname):
|
||||||
|
return
|
||||||
|
|
||||||
account = frappe.db.get_value("Account", {"account_type": account_type,
|
account = frappe.db.get_value("Account", {"account_type": account_type,
|
||||||
"group_or_ledger": "Ledger", "company": self.name})
|
"group_or_ledger": "Ledger", "company": self.name})
|
||||||
|
|
||||||
if account and not self.get(fieldname):
|
if account:
|
||||||
self.db_set(fieldname, account)
|
self.db_set(fieldname, account)
|
||||||
|
|
||||||
_set_default_account("default_cash_account", "Cash")
|
_set_default_account("default_cash_account", "Cash")
|
||||||
@ -108,6 +111,9 @@ class Company(Document):
|
|||||||
_set_default_account("stock_adjustment_account", "Stock Adjustment")
|
_set_default_account("stock_adjustment_account", "Stock Adjustment")
|
||||||
_set_default_account("expenses_included_in_valuation", "Expenses Included In Valuation")
|
_set_default_account("expenses_included_in_valuation", "Expenses Included In Valuation")
|
||||||
|
|
||||||
|
if not self.default_income_account:
|
||||||
|
self.db_set("default_income_account", frappe.db.get_value("Account", {"account_name": _("Sales")}))
|
||||||
|
|
||||||
def create_default_cost_center(self):
|
def create_default_cost_center(self):
|
||||||
cc_list = [
|
cc_list = [
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user