Merge pull request #6340 from nabinhait/se_difference_account
Remove Difference Account field from Stock Entry parent form
This commit is contained in:
commit
33a20bdb13
@ -302,6 +302,9 @@ class PurchaseInvoice(BuyingController):
|
||||
asset.save()
|
||||
|
||||
def make_gl_entries(self, repost_future_gle=True):
|
||||
if not self.grand_total:
|
||||
return
|
||||
|
||||
self.auto_accounting_for_stock = \
|
||||
cint(frappe.defaults.get_global_default("auto_accounting_for_stock"))
|
||||
|
||||
|
@ -491,6 +491,8 @@ class SalesInvoice(SellingController):
|
||||
throw(_("Delivery Note {0} is not submitted").format(d.delivery_note))
|
||||
|
||||
def make_gl_entries(self, repost_future_gle=True):
|
||||
if not self.grand_total:
|
||||
return
|
||||
gl_entries = self.get_gl_entries()
|
||||
|
||||
if gl_entries:
|
||||
|
@ -40,14 +40,6 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({
|
||||
}
|
||||
}
|
||||
}
|
||||
this.frm.set_query("difference_account", function() {
|
||||
return {
|
||||
"filters": {
|
||||
"company": me.frm.doc.company,
|
||||
"is_group": 0
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
this.frm.get_field('items').grid.editable_fields = [
|
||||
|
@ -844,33 +844,6 @@
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"description": "",
|
||||
"fieldname": "difference_account",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Difference Account",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Account",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
@ -1431,7 +1404,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-04-07 06:40:03.284036",
|
||||
"modified": "2016-09-08 06:40:03.284036",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Stock Entry",
|
||||
|
@ -71,9 +71,6 @@ class StockEntry(StockController):
|
||||
if self.purpose not in valid_purposes:
|
||||
frappe.throw(_("Purpose must be one of {0}").format(comma_or(valid_purposes)))
|
||||
|
||||
if self.purpose in ("Manufacture", "Repack") and not self.difference_account:
|
||||
self.difference_account = frappe.db.get_value("Company", self.company, "default_expense_account")
|
||||
|
||||
def set_transfer_qty(self):
|
||||
for item in self.get("items"):
|
||||
if not flt(item.qty):
|
||||
@ -97,9 +94,6 @@ class StockEntry(StockController):
|
||||
if f in ["stock_uom", "conversion_factor"] or not item.get(f):
|
||||
item.set(f, item_details.get(f))
|
||||
|
||||
if self.difference_account and not item.expense_account:
|
||||
item.expense_account = self.difference_account
|
||||
|
||||
if not item.transfer_qty and item.qty:
|
||||
item.transfer_qty = item.qty * item.conversion_factor
|
||||
|
||||
|
@ -57,8 +57,6 @@ def make_stock_entry(**args):
|
||||
s.purchase_receipt_no = args.purchase_receipt_no
|
||||
s.delivery_note_no = args.delivery_note_no
|
||||
s.sales_invoice_no = args.sales_invoice_no
|
||||
if args.difference_account:
|
||||
s.difference_account = args.difference_account
|
||||
if not args.cost_center:
|
||||
args.cost_center = frappe.get_value('Company', s.company, 'cost_center')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user