mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-15 19:19:17 +00:00
[fix] [minor] merge conflict fixed
This commit is contained in:
@@ -2,11 +2,12 @@
|
||||
{
|
||||
"creation": "2013-03-25 10:53:52",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-08-08 14:21:56",
|
||||
"modified": "2013-09-10 14:59:41",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
{
|
||||
"allow_import": 1,
|
||||
"autoname": "naming_series:",
|
||||
"doctype": "DocType",
|
||||
"icon": "icon-file-text",
|
||||
|
||||
@@ -40,13 +40,15 @@ class DocType:
|
||||
msgprint(_("Expense Account is mandatory"), raise_exception=1)
|
||||
|
||||
def validate_all_link_fields(self):
|
||||
accounts = {"Account": [self.doc.cash_bank_account, self.doc.income_account, self.doc.expense_account], \
|
||||
"Cost Center": [self.doc.cost_center], "Warehouse": [self.doc.warehouse]}
|
||||
accounts = {"Account": [self.doc.cash_bank_account, self.doc.income_account,
|
||||
self.doc.expense_account], "Cost Center": [self.doc.cost_center],
|
||||
"Warehouse": [self.doc.warehouse]}
|
||||
|
||||
for link_dt, dn_list in accounts.items():
|
||||
for link_dn in dn_list:
|
||||
if not webnotes.conn.exists({"doctype": link_dt, "company": self.doc.company, "name": link_dn}):
|
||||
msgprint(link_dn +_(" does not belong to ") + self.doc.company)
|
||||
if link_dn and not webnotes.conn.exists({"doctype": link_dt,
|
||||
"company": self.doc.company, "name": link_dn}):
|
||||
webnotes.throw(link_dn +_(" does not belong to ") + self.doc.company)
|
||||
|
||||
def on_update(self):
|
||||
webnotes.defaults.clear_default("is_pos")
|
||||
|
||||
@@ -62,8 +62,18 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
||||
|
||||
cur_frm.add_custom_button('Send SMS', cur_frm.cscript.send_sms);
|
||||
|
||||
if(cint(doc.update_stock)!=1)
|
||||
cur_frm.add_custom_button('Make Delivery', cur_frm.cscript['Make Delivery Note']);
|
||||
if(cint(doc.update_stock)!=1) {
|
||||
// show Make Delivery Note button only if Sales Invoice is not created from Delivery Note
|
||||
var from_delivery_note = false;
|
||||
from_delivery_note = cur_frm.get_doclist({parentfield: "entries"})
|
||||
.some(function(item) {
|
||||
return item.delivery_note ? true : false;
|
||||
});
|
||||
|
||||
if(!from_delivery_note)
|
||||
cur_frm.add_custom_button('Make Delivery', cur_frm.cscript['Make Delivery Note']);
|
||||
}
|
||||
|
||||
|
||||
if(doc.outstanding_amount!=0)
|
||||
cur_frm.add_custom_button('Make Payment Entry', cur_frm.cscript.make_bank_voucher);
|
||||
|
||||
Reference in New Issue
Block a user