Default accounts in company should not be copied
This commit is contained in:
commit
8dc2c6a16c
@ -2,7 +2,7 @@
|
|||||||
{
|
{
|
||||||
"creation": "2013-04-10 08:35:39",
|
"creation": "2013-04-10 08:35:39",
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"modified": "2014-01-20 17:48:28",
|
"modified": "2014-01-30 16:32:41",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"owner": "Administrator"
|
"owner": "Administrator"
|
||||||
},
|
},
|
||||||
@ -110,6 +110,7 @@
|
|||||||
"fieldname": "default_cash_account",
|
"fieldname": "default_cash_account",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"label": "Default Cash Account",
|
"label": "Default Cash Account",
|
||||||
|
"no_copy": 1,
|
||||||
"options": "Account",
|
"options": "Account",
|
||||||
"read_only": 0
|
"read_only": 0
|
||||||
},
|
},
|
||||||
@ -142,6 +143,7 @@
|
|||||||
"fieldname": "default_expense_account",
|
"fieldname": "default_expense_account",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"label": "Default Expense Account",
|
"label": "Default Expense Account",
|
||||||
|
"no_copy": 1,
|
||||||
"options": "Account"
|
"options": "Account"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -149,6 +151,7 @@
|
|||||||
"fieldname": "default_income_account",
|
"fieldname": "default_income_account",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"label": "Default Income Account",
|
"label": "Default Income Account",
|
||||||
|
"no_copy": 1,
|
||||||
"options": "Account"
|
"options": "Account"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -87,8 +87,6 @@ class DocType(StockController):
|
|||||||
self.doc.status = "Sales Returned"
|
self.doc.status = "Sales Returned"
|
||||||
else:
|
else:
|
||||||
self.doc.status = "Available"
|
self.doc.status = "Available"
|
||||||
if not self.doc.warehouse:
|
|
||||||
self.doc.warehouse = last_sle.warehouse
|
|
||||||
else:
|
else:
|
||||||
if document_type == "Purchase Return":
|
if document_type == "Purchase Return":
|
||||||
self.doc.status = "Purchase Returned"
|
self.doc.status = "Purchase Returned"
|
||||||
|
@ -4,14 +4,16 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import webnotes
|
import webnotes
|
||||||
|
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
serial_nos = webnotes.conn.sql("""select name from `tabSerial No` where docstatus=0
|
serial_nos = webnotes.conn.sql("""select name from `tabSerial No` where docstatus=0
|
||||||
and status in ('Available', 'Sales Returned') and ifnull(warehouse, '') = ''""")
|
and status in ('Available', 'Sales Returned') and ifnull(warehouse, '') = ''""")
|
||||||
for sr in serial_nos:
|
for sr in serial_nos:
|
||||||
try:
|
try:
|
||||||
sr_bean = webnotes.bean("Serial No", sr[0])
|
last_sle = webnotes.bean("Serial No", sr[0]).make_controller().get_last_sle()
|
||||||
sr_bean.make_controller().via_stock_ledger = True
|
if last_sle.actual_qty > 0:
|
||||||
sr_bean.save()
|
webnotes.conn.set_value("Serial No", sr[0], "warehouse", last_sle.warehouse)
|
||||||
|
|
||||||
webnotes.conn.commit()
|
webnotes.conn.commit()
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
Loading…
x
Reference in New Issue
Block a user