install, web serving, session booting webnotes/wnframework#351
This commit is contained in:
parent
d2dd83c3a3
commit
1f84799f2d
@ -206,7 +206,7 @@ class DocType:
|
|||||||
|
|
||||||
def before_rename(self, old, new, merge=False):
|
def before_rename(self, old, new, merge=False):
|
||||||
# Add company abbr if not provided
|
# Add company abbr if not provided
|
||||||
from setup.doctype.company.company import get_name_with_abbr
|
from erpnext.setup.doctype.company.company import get_name_with_abbr
|
||||||
new_account = get_name_with_abbr(new, self.doc.company)
|
new_account = get_name_with_abbr(new, self.doc.company)
|
||||||
|
|
||||||
# Validate properties before merging
|
# Validate properties before merging
|
||||||
|
@ -76,7 +76,7 @@ class DocType:
|
|||||||
}
|
}
|
||||||
|
|
||||||
def get_invoice_nos(doctype, txt, searchfield, start, page_len, filters):
|
def get_invoice_nos(doctype, txt, searchfield, start, page_len, filters):
|
||||||
from utilities import build_filter_conditions
|
from erpnext.utilities import build_filter_conditions
|
||||||
conditions, filter_values = build_filter_conditions(filters)
|
conditions, filter_values = build_filter_conditions(filters)
|
||||||
|
|
||||||
return webnotes.conn.sql("""select name from `tabSales Invoice` where docstatus = 1
|
return webnotes.conn.sql("""select name from `tabSales Invoice` where docstatus = 1
|
||||||
|
@ -75,7 +75,7 @@ class DocType(DocTypeNestedSet):
|
|||||||
|
|
||||||
def before_rename(self, olddn, newdn, merge=False):
|
def before_rename(self, olddn, newdn, merge=False):
|
||||||
# Add company abbr if not provided
|
# Add company abbr if not provided
|
||||||
from setup.doctype.company.company import get_name_with_abbr
|
from erpnext.setup.doctype.company.company import get_name_with_abbr
|
||||||
new_cost_center = get_name_with_abbr(newdn, self.doc.company)
|
new_cost_center = get_name_with_abbr(newdn, self.doc.company)
|
||||||
|
|
||||||
# Validate properties before merging
|
# Validate properties before merging
|
||||||
|
@ -51,7 +51,7 @@ class DocType:
|
|||||||
self.doc.cost_center = None
|
self.doc.cost_center = None
|
||||||
|
|
||||||
def validate_posting_date(self):
|
def validate_posting_date(self):
|
||||||
from accounts.utils import validate_fiscal_year
|
from erpnext.accounts.utils import validate_fiscal_year
|
||||||
validate_fiscal_year(self.doc.posting_date, self.doc.fiscal_year, "Posting Date")
|
validate_fiscal_year(self.doc.posting_date, self.doc.fiscal_year, "Posting Date")
|
||||||
|
|
||||||
def check_pl_account(self):
|
def check_pl_account(self):
|
||||||
|
@ -165,7 +165,7 @@ cur_frm.cscript.account = function(doc,dt,dn) {
|
|||||||
var d = locals[dt][dn];
|
var d = locals[dt][dn];
|
||||||
if(d.account) {
|
if(d.account) {
|
||||||
return wn.call({
|
return wn.call({
|
||||||
method: "accounts.utils.get_balance_on",
|
method: "erpnext.accounts.utils.get_balance_on",
|
||||||
args: {account: d.account, date: doc.posting_date},
|
args: {account: d.account, date: doc.posting_date},
|
||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
d.balance = r.message;
|
d.balance = r.message;
|
||||||
@ -208,7 +208,7 @@ cur_frm.cscript.voucher_type = function(doc, cdt, cdn) {
|
|||||||
if(in_list(["Bank Voucher", "Cash Voucher"], doc.voucher_type)) {
|
if(in_list(["Bank Voucher", "Cash Voucher"], doc.voucher_type)) {
|
||||||
return wn.call({
|
return wn.call({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
method: "accounts.doctype.journal_voucher.journal_voucher.get_default_bank_cash_account",
|
method: "erpnext.accounts.doctype.journal_voucher.journal_voucher.get_default_bank_cash_account",
|
||||||
args: {
|
args: {
|
||||||
"voucher_type": doc.voucher_type,
|
"voucher_type": doc.voucher_type,
|
||||||
"company": doc.company
|
"company": doc.company
|
||||||
@ -222,7 +222,7 @@ cur_frm.cscript.voucher_type = function(doc, cdt, cdn) {
|
|||||||
} else if(doc.voucher_type=="Opening Entry") {
|
} else if(doc.voucher_type=="Opening Entry") {
|
||||||
return wn.call({
|
return wn.call({
|
||||||
type:"GET",
|
type:"GET",
|
||||||
method: "accounts.doctype.journal_voucher.journal_voucher.get_opening_accounts",
|
method: "erpnext.accounts.doctype.journal_voucher.journal_voucher.get_opening_accounts",
|
||||||
args: {
|
args: {
|
||||||
"company": doc.company
|
"company": doc.company
|
||||||
},
|
},
|
||||||
|
@ -8,9 +8,9 @@ from webnotes.utils import cint, cstr, flt, fmt_money, formatdate, getdate
|
|||||||
from webnotes.model.doc import addchild
|
from webnotes.model.doc import addchild
|
||||||
from webnotes.model.bean import getlist
|
from webnotes.model.bean import getlist
|
||||||
from webnotes import msgprint, _
|
from webnotes import msgprint, _
|
||||||
from setup.utils import get_company_currency
|
from erpnext.setup.utils import get_company_currency
|
||||||
|
|
||||||
from controllers.accounts_controller import AccountsController
|
from erpnext.controllers.accounts_controller import AccountsController
|
||||||
|
|
||||||
class DocType(AccountsController):
|
class DocType(AccountsController):
|
||||||
def __init__(self,d,dl):
|
def __init__(self,d,dl):
|
||||||
@ -47,7 +47,7 @@ class DocType(AccountsController):
|
|||||||
self.check_credit_limit()
|
self.check_credit_limit()
|
||||||
|
|
||||||
def on_cancel(self):
|
def on_cancel(self):
|
||||||
from accounts.utils import remove_against_link_from_jv
|
from erpnext.accounts.utils import remove_against_link_from_jv
|
||||||
remove_against_link_from_jv(self.doc.doctype, self.doc.name, "against_jv")
|
remove_against_link_from_jv(self.doc.doctype, self.doc.name, "against_jv")
|
||||||
|
|
||||||
self.make_gl_entries(1)
|
self.make_gl_entries(1)
|
||||||
@ -240,7 +240,7 @@ class DocType(AccountsController):
|
|||||||
Purchase Invoice"))
|
Purchase Invoice"))
|
||||||
|
|
||||||
def make_gl_entries(self, cancel=0, adv_adj=0):
|
def make_gl_entries(self, cancel=0, adv_adj=0):
|
||||||
from accounts.general_ledger import make_gl_entries
|
from erpnext.accounts.general_ledger import make_gl_entries
|
||||||
gl_map = []
|
gl_map = []
|
||||||
for d in self.doclist.get({"parentfield": "entries"}):
|
for d in self.doclist.get({"parentfield": "entries"}):
|
||||||
if d.debit or d.credit:
|
if d.debit or d.credit:
|
||||||
@ -334,7 +334,7 @@ class DocType(AccountsController):
|
|||||||
|
|
||||||
@webnotes.whitelist()
|
@webnotes.whitelist()
|
||||||
def get_default_bank_cash_account(company, voucher_type):
|
def get_default_bank_cash_account(company, voucher_type):
|
||||||
from accounts.utils import get_balance_on
|
from erpnext.accounts.utils import get_balance_on
|
||||||
account = webnotes.conn.get_value("Company", company,
|
account = webnotes.conn.get_value("Company", company,
|
||||||
voucher_type=="Bank Voucher" and "default_bank_account" or "default_cash_account")
|
voucher_type=="Bank Voucher" and "default_bank_account" or "default_cash_account")
|
||||||
if account:
|
if account:
|
||||||
@ -345,7 +345,7 @@ def get_default_bank_cash_account(company, voucher_type):
|
|||||||
|
|
||||||
@webnotes.whitelist()
|
@webnotes.whitelist()
|
||||||
def get_payment_entry_from_sales_invoice(sales_invoice):
|
def get_payment_entry_from_sales_invoice(sales_invoice):
|
||||||
from accounts.utils import get_balance_on
|
from erpnext.accounts.utils import get_balance_on
|
||||||
si = webnotes.bean("Sales Invoice", sales_invoice)
|
si = webnotes.bean("Sales Invoice", sales_invoice)
|
||||||
jv = get_payment_entry(si.doc)
|
jv = get_payment_entry(si.doc)
|
||||||
jv.doc.remark = 'Payment received against Sales Invoice %(name)s. %(remarks)s' % si.doc.fields
|
jv.doc.remark = 'Payment received against Sales Invoice %(name)s. %(remarks)s' % si.doc.fields
|
||||||
@ -363,7 +363,7 @@ def get_payment_entry_from_sales_invoice(sales_invoice):
|
|||||||
|
|
||||||
@webnotes.whitelist()
|
@webnotes.whitelist()
|
||||||
def get_payment_entry_from_purchase_invoice(purchase_invoice):
|
def get_payment_entry_from_purchase_invoice(purchase_invoice):
|
||||||
from accounts.utils import get_balance_on
|
from erpnext.accounts.utils import get_balance_on
|
||||||
pi = webnotes.bean("Purchase Invoice", purchase_invoice)
|
pi = webnotes.bean("Purchase Invoice", purchase_invoice)
|
||||||
jv = get_payment_entry(pi.doc)
|
jv = get_payment_entry(pi.doc)
|
||||||
jv.doc.remark = 'Payment against Purchase Invoice %(name)s. %(remarks)s' % pi.doc.fields
|
jv.doc.remark = 'Payment against Purchase Invoice %(name)s. %(remarks)s' % pi.doc.fields
|
||||||
@ -407,7 +407,7 @@ def get_payment_entry(doc):
|
|||||||
@webnotes.whitelist()
|
@webnotes.whitelist()
|
||||||
def get_opening_accounts(company):
|
def get_opening_accounts(company):
|
||||||
"""get all balance sheet accounts for opening entry"""
|
"""get all balance sheet accounts for opening entry"""
|
||||||
from accounts.utils import get_balance_on
|
from erpnext.accounts.utils import get_balance_on
|
||||||
accounts = webnotes.conn.sql_list("""select name from tabAccount
|
accounts = webnotes.conn.sql_list("""select name from tabAccount
|
||||||
where group_or_ledger='Ledger' and is_pl_account='No' and company=%s""", company)
|
where group_or_ledger='Ledger' and is_pl_account='No' and company=%s""", company)
|
||||||
|
|
||||||
|
@ -34,14 +34,14 @@ class TestJournalVoucher(unittest.TestCase):
|
|||||||
where against_jv=%s""", jv_invoice.doc.name))
|
where against_jv=%s""", jv_invoice.doc.name))
|
||||||
|
|
||||||
def test_jv_against_stock_account(self):
|
def test_jv_against_stock_account(self):
|
||||||
from stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory
|
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory
|
||||||
set_perpetual_inventory()
|
set_perpetual_inventory()
|
||||||
|
|
||||||
jv = webnotes.bean(copy=test_records[0])
|
jv = webnotes.bean(copy=test_records[0])
|
||||||
jv.doclist[1].account = "_Test Warehouse - _TC"
|
jv.doclist[1].account = "_Test Warehouse - _TC"
|
||||||
jv.insert()
|
jv.insert()
|
||||||
|
|
||||||
from accounts.general_ledger import StockAccountInvalidTransaction
|
from erpnext.accounts.general_ledger import StockAccountInvalidTransaction
|
||||||
self.assertRaises(StockAccountInvalidTransaction, jv.submit)
|
self.assertRaises(StockAccountInvalidTransaction, jv.submit)
|
||||||
|
|
||||||
set_perpetual_inventory(0)
|
set_perpetual_inventory(0)
|
||||||
@ -61,7 +61,7 @@ class TestJournalVoucher(unittest.TestCase):
|
|||||||
{"voucher_type": "Journal Voucher", "voucher_no": jv.doc.name}))
|
{"voucher_type": "Journal Voucher", "voucher_no": jv.doc.name}))
|
||||||
|
|
||||||
def test_monthly_budget_crossed_stop(self):
|
def test_monthly_budget_crossed_stop(self):
|
||||||
from accounts.utils import BudgetError
|
from erpnext.accounts.utils import BudgetError
|
||||||
webnotes.conn.set_value("Company", "_Test Company", "monthly_bgt_flag", "Stop")
|
webnotes.conn.set_value("Company", "_Test Company", "monthly_bgt_flag", "Stop")
|
||||||
self.clear_account_balance()
|
self.clear_account_balance()
|
||||||
|
|
||||||
@ -77,7 +77,7 @@ class TestJournalVoucher(unittest.TestCase):
|
|||||||
webnotes.conn.set_value("Company", "_Test Company", "monthly_bgt_flag", "Ignore")
|
webnotes.conn.set_value("Company", "_Test Company", "monthly_bgt_flag", "Ignore")
|
||||||
|
|
||||||
def test_yearly_budget_crossed_stop(self):
|
def test_yearly_budget_crossed_stop(self):
|
||||||
from accounts.utils import BudgetError
|
from erpnext.accounts.utils import BudgetError
|
||||||
self.clear_account_balance()
|
self.clear_account_balance()
|
||||||
self.test_monthly_budget_crossed_ignore()
|
self.test_monthly_budget_crossed_ignore()
|
||||||
|
|
||||||
@ -96,7 +96,7 @@ class TestJournalVoucher(unittest.TestCase):
|
|||||||
webnotes.conn.set_value("Company", "_Test Company", "yearly_bgt_flag", "Ignore")
|
webnotes.conn.set_value("Company", "_Test Company", "yearly_bgt_flag", "Ignore")
|
||||||
|
|
||||||
def test_monthly_budget_on_cancellation(self):
|
def test_monthly_budget_on_cancellation(self):
|
||||||
from accounts.utils import BudgetError
|
from erpnext.accounts.utils import BudgetError
|
||||||
webnotes.conn.set_value("Company", "_Test Company", "monthly_bgt_flag", "Stop")
|
webnotes.conn.set_value("Company", "_Test Company", "monthly_bgt_flag", "Stop")
|
||||||
self.clear_account_balance()
|
self.clear_account_balance()
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ from __future__ import unicode_literals
|
|||||||
import webnotes
|
import webnotes
|
||||||
from webnotes.utils import flt, get_first_day, get_last_day, has_common
|
from webnotes.utils import flt, get_first_day, get_last_day, has_common
|
||||||
import webnotes.defaults
|
import webnotes.defaults
|
||||||
from accounts.utils import get_balance_on
|
from erpnext.accounts.utils import get_balance_on
|
||||||
|
|
||||||
class DocType:
|
class DocType:
|
||||||
def __init__(self, doc, doclist):
|
def __init__(self, doc, doclist):
|
||||||
@ -29,7 +29,7 @@ class DocType:
|
|||||||
|
|
||||||
ret['period'] = ['Annual','Half Yearly','Quarterly','Monthly']
|
ret['period'] = ['Annual','Half Yearly','Quarterly','Monthly']
|
||||||
|
|
||||||
from accounts.page.accounts_browser.accounts_browser import get_companies
|
from erpnext.accounts.page.accounts_browser.accounts_browser import get_companies
|
||||||
ret['company'] = get_companies()
|
ret['company'] = get_companies()
|
||||||
|
|
||||||
#--- to get fiscal year and start_date of that fiscal year -----
|
#--- to get fiscal year and start_date of that fiscal year -----
|
||||||
|
@ -121,14 +121,14 @@ class DocType:
|
|||||||
lst.append(args)
|
lst.append(args)
|
||||||
|
|
||||||
if lst:
|
if lst:
|
||||||
from accounts.utils import reconcile_against_document
|
from erpnext.accounts.utils import reconcile_against_document
|
||||||
reconcile_against_document(lst)
|
reconcile_against_document(lst)
|
||||||
msgprint("Successfully allocated.")
|
msgprint("Successfully allocated.")
|
||||||
else:
|
else:
|
||||||
msgprint("No amount allocated.", raise_exception=1)
|
msgprint("No amount allocated.", raise_exception=1)
|
||||||
|
|
||||||
def gl_entry_details(doctype, txt, searchfield, start, page_len, filters):
|
def gl_entry_details(doctype, txt, searchfield, start, page_len, filters):
|
||||||
from controllers.queries import get_match_cond
|
from erpnext.controllers.queries import get_match_cond
|
||||||
|
|
||||||
return webnotes.conn.sql("""select gle.voucher_no, gle.posting_date,
|
return webnotes.conn.sql("""select gle.voucher_no, gle.posting_date,
|
||||||
gle.%(account_type)s from `tabGL Entry` gle
|
gle.%(account_type)s from `tabGL Entry` gle
|
||||||
|
@ -5,7 +5,7 @@ from __future__ import unicode_literals
|
|||||||
import webnotes
|
import webnotes
|
||||||
from webnotes.utils import cstr, flt, getdate
|
from webnotes.utils import cstr, flt, getdate
|
||||||
from webnotes import msgprint, _
|
from webnotes import msgprint, _
|
||||||
from controllers.accounts_controller import AccountsController
|
from erpnext.controllers.accounts_controller import AccountsController
|
||||||
|
|
||||||
class DocType(AccountsController):
|
class DocType(AccountsController):
|
||||||
def __init__(self,d,dl):
|
def __init__(self,d,dl):
|
||||||
@ -33,7 +33,7 @@ class DocType(AccountsController):
|
|||||||
_("must be a Liability account"))
|
_("must be a Liability account"))
|
||||||
|
|
||||||
def validate_posting_date(self):
|
def validate_posting_date(self):
|
||||||
from accounts.utils import get_fiscal_year
|
from erpnext.accounts.utils import get_fiscal_year
|
||||||
self.year_start_date = get_fiscal_year(self.doc.posting_date, self.doc.fiscal_year)[1]
|
self.year_start_date = get_fiscal_year(self.doc.posting_date, self.doc.fiscal_year)[1]
|
||||||
|
|
||||||
pce = webnotes.conn.sql("""select name from `tabPeriod Closing Voucher`
|
pce = webnotes.conn.sql("""select name from `tabPeriod Closing Voucher`
|
||||||
@ -99,5 +99,5 @@ class DocType(AccountsController):
|
|||||||
"credit": abs(net_pl_balance) if net_pl_balance < 0 else 0
|
"credit": abs(net_pl_balance) if net_pl_balance < 0 else 0
|
||||||
}))
|
}))
|
||||||
|
|
||||||
from accounts.general_ledger import make_gl_entries
|
from erpnext.accounts.general_ledger import make_gl_entries
|
||||||
make_gl_entries(gl_entries)
|
make_gl_entries(gl_entries)
|
||||||
|
@ -11,7 +11,7 @@ class TestPeriodClosingVoucher(unittest.TestCase):
|
|||||||
# clear GL Entries
|
# clear GL Entries
|
||||||
webnotes.conn.sql("""delete from `tabGL Entry`""")
|
webnotes.conn.sql("""delete from `tabGL Entry`""")
|
||||||
|
|
||||||
from accounts.doctype.journal_voucher.test_journal_voucher import test_records as jv_records
|
from erpnext.accounts.doctype.journal_voucher.test_journal_voucher import test_records as jv_records
|
||||||
jv = webnotes.bean(copy=jv_records[2])
|
jv = webnotes.bean(copy=jv_records[2])
|
||||||
jv.insert()
|
jv.insert()
|
||||||
jv.submit()
|
jv.submit()
|
||||||
|
@ -44,7 +44,7 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
|
|||||||
cur_frm.add_custom_button(wn._('From Purchase Order'),
|
cur_frm.add_custom_button(wn._('From Purchase Order'),
|
||||||
function() {
|
function() {
|
||||||
wn.model.map_current_doc({
|
wn.model.map_current_doc({
|
||||||
method: "buying.doctype.purchase_order.purchase_order.make_purchase_invoice",
|
method: "erpnext.buying.doctype.purchase_order.purchase_order.make_purchase_invoice",
|
||||||
source_doctype: "Purchase Order",
|
source_doctype: "Purchase Order",
|
||||||
get_query_filters: {
|
get_query_filters: {
|
||||||
supplier: cur_frm.doc.supplier || undefined,
|
supplier: cur_frm.doc.supplier || undefined,
|
||||||
@ -59,7 +59,7 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
|
|||||||
cur_frm.add_custom_button(wn._('From Purchase Receipt'),
|
cur_frm.add_custom_button(wn._('From Purchase Receipt'),
|
||||||
function() {
|
function() {
|
||||||
wn.model.map_current_doc({
|
wn.model.map_current_doc({
|
||||||
method: "stock.doctype.purchase_receipt.purchase_receipt.make_purchase_invoice",
|
method: "erpnext.stock.doctype.purchase_receipt.purchase_receipt.make_purchase_invoice",
|
||||||
source_doctype: "Purchase Receipt",
|
source_doctype: "Purchase Receipt",
|
||||||
get_query_filters: {
|
get_query_filters: {
|
||||||
supplier: cur_frm.doc.supplier || undefined,
|
supplier: cur_frm.doc.supplier || undefined,
|
||||||
@ -107,7 +107,7 @@ cur_frm.cscript.is_opening = function(doc, dt, dn) {
|
|||||||
|
|
||||||
cur_frm.cscript.make_bank_voucher = function() {
|
cur_frm.cscript.make_bank_voucher = function() {
|
||||||
return wn.call({
|
return wn.call({
|
||||||
method: "accounts.doctype.journal_voucher.journal_voucher.get_payment_entry_from_purchase_invoice",
|
method: "erpnext.accounts.doctype.journal_voucher.journal_voucher.get_payment_entry_from_purchase_invoice",
|
||||||
args: {
|
args: {
|
||||||
"purchase_invoice": cur_frm.doc.name,
|
"purchase_invoice": cur_frm.doc.name,
|
||||||
},
|
},
|
||||||
|
@ -8,12 +8,12 @@ from webnotes.utils import add_days, cint, cstr, flt, formatdate
|
|||||||
from webnotes.model.bean import getlist
|
from webnotes.model.bean import getlist
|
||||||
from webnotes.model.code import get_obj
|
from webnotes.model.code import get_obj
|
||||||
from webnotes import msgprint, _
|
from webnotes import msgprint, _
|
||||||
from setup.utils import get_company_currency
|
from erpnext.setup.utils import get_company_currency
|
||||||
|
|
||||||
import webnotes.defaults
|
import webnotes.defaults
|
||||||
|
|
||||||
|
|
||||||
from controllers.buying_controller import BuyingController
|
from erpnext.controllers.buying_controller import BuyingController
|
||||||
class DocType(BuyingController):
|
class DocType(BuyingController):
|
||||||
def __init__(self,d,dl):
|
def __init__(self,d,dl):
|
||||||
self.doc, self.doclist = d, dl
|
self.doc, self.doclist = d, dl
|
||||||
@ -289,7 +289,7 @@ class DocType(BuyingController):
|
|||||||
lst.append(args)
|
lst.append(args)
|
||||||
|
|
||||||
if lst:
|
if lst:
|
||||||
from accounts.utils import reconcile_against_document
|
from erpnext.accounts.utils import reconcile_against_document
|
||||||
reconcile_against_document(lst)
|
reconcile_against_document(lst)
|
||||||
|
|
||||||
def on_submit(self):
|
def on_submit(self):
|
||||||
@ -425,11 +425,11 @@ class DocType(BuyingController):
|
|||||||
)
|
)
|
||||||
|
|
||||||
if gl_entries:
|
if gl_entries:
|
||||||
from accounts.general_ledger import make_gl_entries
|
from erpnext.accounts.general_ledger import make_gl_entries
|
||||||
make_gl_entries(gl_entries, cancel=(self.doc.docstatus == 2))
|
make_gl_entries(gl_entries, cancel=(self.doc.docstatus == 2))
|
||||||
|
|
||||||
def on_cancel(self):
|
def on_cancel(self):
|
||||||
from accounts.utils import remove_against_link_from_jv
|
from erpnext.accounts.utils import remove_against_link_from_jv
|
||||||
remove_against_link_from_jv(self.doc.doctype, self.doc.name, "against_voucher")
|
remove_against_link_from_jv(self.doc.doctype, self.doc.name, "against_voucher")
|
||||||
|
|
||||||
self.update_prevdoc_status()
|
self.update_prevdoc_status()
|
||||||
@ -455,7 +455,7 @@ class DocType(BuyingController):
|
|||||||
|
|
||||||
@webnotes.whitelist()
|
@webnotes.whitelist()
|
||||||
def get_expense_account(doctype, txt, searchfield, start, page_len, filters):
|
def get_expense_account(doctype, txt, searchfield, start, page_len, filters):
|
||||||
from controllers.queries import get_match_cond
|
from erpnext.controllers.queries import get_match_cond
|
||||||
|
|
||||||
# expense account can be any Debit account,
|
# expense account can be any Debit account,
|
||||||
# but can also be a Liability account with account_type='Expense Account' in special circumstances.
|
# but can also be a Liability account with account_type='Expense Account' in special circumstances.
|
||||||
|
@ -9,7 +9,7 @@ import webnotes.model
|
|||||||
import json
|
import json
|
||||||
from webnotes.utils import cint
|
from webnotes.utils import cint
|
||||||
import webnotes.defaults
|
import webnotes.defaults
|
||||||
from stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory
|
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory
|
||||||
|
|
||||||
test_dependencies = ["Item", "Cost Center"]
|
test_dependencies = ["Item", "Cost Center"]
|
||||||
test_ignore = ["Serial No"]
|
test_ignore = ["Serial No"]
|
||||||
@ -171,7 +171,7 @@ class TestPurchaseInvoice(unittest.TestCase):
|
|||||||
self.assertEqual(tax.total, expected_values[i][2])
|
self.assertEqual(tax.total, expected_values[i][2])
|
||||||
|
|
||||||
def test_purchase_invoice_with_advance(self):
|
def test_purchase_invoice_with_advance(self):
|
||||||
from accounts.doctype.journal_voucher.test_journal_voucher \
|
from erpnext.accounts.doctype.journal_voucher.test_journal_voucher \
|
||||||
import test_records as jv_test_records
|
import test_records as jv_test_records
|
||||||
|
|
||||||
jv = webnotes.bean(copy=jv_test_records[1])
|
jv = webnotes.bean(copy=jv_test_records[1])
|
||||||
|
@ -199,7 +199,7 @@ erpnext.POS = Class.extend({
|
|||||||
var me = this;
|
var me = this;
|
||||||
me.item_timeout = null;
|
me.item_timeout = null;
|
||||||
wn.call({
|
wn.call({
|
||||||
method: 'accounts.doctype.sales_invoice.pos.get_items',
|
method: 'erpnext.accounts.doctype.sales_invoice.pos.get_items',
|
||||||
args: {
|
args: {
|
||||||
sales_or_purchase: this.sales_or_purchase,
|
sales_or_purchase: this.sales_or_purchase,
|
||||||
price_list: this.price_list,
|
price_list: this.price_list,
|
||||||
@ -450,7 +450,7 @@ erpnext.POS = Class.extend({
|
|||||||
var me = this;
|
var me = this;
|
||||||
me.barcode_timeout = null;
|
me.barcode_timeout = null;
|
||||||
wn.call({
|
wn.call({
|
||||||
method: 'accounts.doctype.sales_invoice.pos.get_item_code',
|
method: 'erpnext.accounts.doctype.sales_invoice.pos.get_item_code',
|
||||||
args: {barcode_serial_no: this.barcode.$input.val()},
|
args: {barcode_serial_no: this.barcode.$input.val()},
|
||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
if (r.message) {
|
if (r.message) {
|
||||||
@ -503,7 +503,7 @@ erpnext.POS = Class.extend({
|
|||||||
msgprint(wn._("Payment cannot be made for empty cart"));
|
msgprint(wn._("Payment cannot be made for empty cart"));
|
||||||
else {
|
else {
|
||||||
wn.call({
|
wn.call({
|
||||||
method: 'accounts.doctype.sales_invoice.pos.get_mode_of_payment',
|
method: 'erpnext.accounts.doctype.sales_invoice.pos.get_mode_of_payment',
|
||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
for (x=0; x<=r.message.length - 1; x++) {
|
for (x=0; x<=r.message.length - 1; x++) {
|
||||||
mode_of_payment.push(r.message[x].name);
|
mode_of_payment.push(r.message[x].name);
|
||||||
|
@ -90,7 +90,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
|||||||
this.$sales_order_btn = cur_frm.appframe.add_primary_action(wn._('From Sales Order'),
|
this.$sales_order_btn = cur_frm.appframe.add_primary_action(wn._('From Sales Order'),
|
||||||
function() {
|
function() {
|
||||||
wn.model.map_current_doc({
|
wn.model.map_current_doc({
|
||||||
method: "selling.doctype.sales_order.sales_order.make_sales_invoice",
|
method: "erpnext.selling.doctype.sales_order.sales_order.make_sales_invoice",
|
||||||
source_doctype: "Sales Order",
|
source_doctype: "Sales Order",
|
||||||
get_query_filters: {
|
get_query_filters: {
|
||||||
docstatus: 1,
|
docstatus: 1,
|
||||||
@ -107,7 +107,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
|||||||
this.$delivery_note_btn = cur_frm.appframe.add_primary_action(wn._('From Delivery Note'),
|
this.$delivery_note_btn = cur_frm.appframe.add_primary_action(wn._('From Delivery Note'),
|
||||||
function() {
|
function() {
|
||||||
wn.model.map_current_doc({
|
wn.model.map_current_doc({
|
||||||
method: "stock.doctype.delivery_note.delivery_note.make_sales_invoice",
|
method: "erpnext.stock.doctype.delivery_note.delivery_note.make_sales_invoice",
|
||||||
source_doctype: "Delivery Note",
|
source_doctype: "Delivery Note",
|
||||||
get_query: function() {
|
get_query: function() {
|
||||||
var filters = {
|
var filters = {
|
||||||
@ -258,14 +258,14 @@ cur_frm.cscript.is_opening = function(doc, dt, dn) {
|
|||||||
|
|
||||||
cur_frm.cscript['Make Delivery Note'] = function() {
|
cur_frm.cscript['Make Delivery Note'] = function() {
|
||||||
wn.model.open_mapped_doc({
|
wn.model.open_mapped_doc({
|
||||||
method: "accounts.doctype.sales_invoice.sales_invoice.make_delivery_note",
|
method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.make_delivery_note",
|
||||||
source_name: cur_frm.doc.name
|
source_name: cur_frm.doc.name
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
cur_frm.cscript.make_bank_voucher = function() {
|
cur_frm.cscript.make_bank_voucher = function() {
|
||||||
return wn.call({
|
return wn.call({
|
||||||
method: "accounts.doctype.journal_voucher.journal_voucher.get_payment_entry_from_sales_invoice",
|
method: "erpnext.accounts.doctype.journal_voucher.journal_voucher.get_payment_entry_from_sales_invoice",
|
||||||
args: {
|
args: {
|
||||||
"sales_invoice": cur_frm.doc.name
|
"sales_invoice": cur_frm.doc.name
|
||||||
},
|
},
|
||||||
|
@ -17,7 +17,7 @@ from webnotes import _, msgprint
|
|||||||
|
|
||||||
month_map = {'Monthly': 1, 'Quarterly': 3, 'Half-yearly': 6, 'Yearly': 12}
|
month_map = {'Monthly': 1, 'Quarterly': 3, 'Half-yearly': 6, 'Yearly': 12}
|
||||||
|
|
||||||
from controllers.selling_controller import SellingController
|
from erpnext.controllers.selling_controller import SellingController
|
||||||
|
|
||||||
class DocType(SellingController):
|
class DocType(SellingController):
|
||||||
def __init__(self,d,dl):
|
def __init__(self,d,dl):
|
||||||
@ -109,7 +109,7 @@ class DocType(SellingController):
|
|||||||
|
|
||||||
self.check_stop_sales_order("sales_order")
|
self.check_stop_sales_order("sales_order")
|
||||||
|
|
||||||
from accounts.utils import remove_against_link_from_jv
|
from erpnext.accounts.utils import remove_against_link_from_jv
|
||||||
remove_against_link_from_jv(self.doc.doctype, self.doc.name, "against_invoice")
|
remove_against_link_from_jv(self.doc.doctype, self.doc.name, "against_invoice")
|
||||||
|
|
||||||
self.update_status_updater_args()
|
self.update_status_updater_args()
|
||||||
@ -184,7 +184,7 @@ class DocType(SellingController):
|
|||||||
if cint(self.doc.is_pos) != 1:
|
if cint(self.doc.is_pos) != 1:
|
||||||
return
|
return
|
||||||
|
|
||||||
from selling.utils import get_pos_settings, apply_pos_settings
|
from erpnext.selling.utils import get_pos_settings, apply_pos_settings
|
||||||
pos = get_pos_settings(self.doc.company)
|
pos = get_pos_settings(self.doc.company)
|
||||||
|
|
||||||
if pos:
|
if pos:
|
||||||
@ -285,7 +285,7 @@ class DocType(SellingController):
|
|||||||
lst.append(args)
|
lst.append(args)
|
||||||
|
|
||||||
if lst:
|
if lst:
|
||||||
from accounts.utils import reconcile_against_document
|
from erpnext.accounts.utils import reconcile_against_document
|
||||||
reconcile_against_document(lst)
|
reconcile_against_document(lst)
|
||||||
|
|
||||||
def validate_customer_account(self):
|
def validate_customer_account(self):
|
||||||
@ -464,7 +464,7 @@ class DocType(SellingController):
|
|||||||
if not d.warehouse:
|
if not d.warehouse:
|
||||||
d.warehouse = cstr(w)
|
d.warehouse = cstr(w)
|
||||||
|
|
||||||
from stock.doctype.packed_item.packed_item import make_packing_list
|
from erpnext.stock.doctype.packed_item.packed_item import make_packing_list
|
||||||
make_packing_list(self, 'entries')
|
make_packing_list(self, 'entries')
|
||||||
else:
|
else:
|
||||||
self.doclist = self.doc.clear_table(self.doclist, 'packing_details')
|
self.doclist = self.doc.clear_table(self.doclist, 'packing_details')
|
||||||
@ -511,7 +511,7 @@ class DocType(SellingController):
|
|||||||
gl_entries = self.get_gl_entries()
|
gl_entries = self.get_gl_entries()
|
||||||
|
|
||||||
if gl_entries:
|
if gl_entries:
|
||||||
from accounts.general_ledger import make_gl_entries
|
from erpnext.accounts.general_ledger import make_gl_entries
|
||||||
|
|
||||||
update_outstanding = cint(self.doc.is_pos) and self.doc.write_off_account \
|
update_outstanding = cint(self.doc.is_pos) and self.doc.write_off_account \
|
||||||
and 'No' or 'Yes'
|
and 'No' or 'Yes'
|
||||||
@ -523,7 +523,7 @@ class DocType(SellingController):
|
|||||||
self.update_gl_entries_after()
|
self.update_gl_entries_after()
|
||||||
|
|
||||||
def get_gl_entries(self, warehouse_account=None):
|
def get_gl_entries(self, warehouse_account=None):
|
||||||
from accounts.general_ledger import merge_similar_entries
|
from erpnext.accounts.general_ledger import merge_similar_entries
|
||||||
|
|
||||||
gl_entries = []
|
gl_entries = []
|
||||||
|
|
||||||
@ -749,7 +749,7 @@ def manage_recurring_invoices(next_date=None, commit=True):
|
|||||||
|
|
||||||
def make_new_invoice(ref_wrapper, posting_date):
|
def make_new_invoice(ref_wrapper, posting_date):
|
||||||
from webnotes.model.bean import clone
|
from webnotes.model.bean import clone
|
||||||
from accounts.utils import get_fiscal_year
|
from erpnext.accounts.utils import get_fiscal_year
|
||||||
new_invoice = clone(ref_wrapper)
|
new_invoice = clone(ref_wrapper)
|
||||||
|
|
||||||
mcount = month_map[ref_wrapper.doc.recurring_type]
|
mcount = month_map[ref_wrapper.doc.recurring_type]
|
||||||
@ -903,7 +903,7 @@ def get_bank_cash_account(mode_of_payment):
|
|||||||
|
|
||||||
@webnotes.whitelist()
|
@webnotes.whitelist()
|
||||||
def get_income_account(doctype, txt, searchfield, start, page_len, filters):
|
def get_income_account(doctype, txt, searchfield, start, page_len, filters):
|
||||||
from controllers.queries import get_match_cond
|
from erpnext.controllers.queries import get_match_cond
|
||||||
|
|
||||||
# income account can be any Credit account,
|
# income account can be any Credit account,
|
||||||
# but can also be a Asset account with account_type='Income Account' in special circumstances.
|
# but can also be a Asset account with account_type='Income Account' in special circumstances.
|
||||||
|
@ -9,7 +9,7 @@ from webnotes.utils import flt, fmt_money
|
|||||||
no_cache = True
|
no_cache = True
|
||||||
|
|
||||||
def get_context():
|
def get_context():
|
||||||
from portal.utils import get_transaction_context
|
from erpnext.portal.utils import get_transaction_context
|
||||||
context = get_transaction_context("Sales Invoice", webnotes.form_dict.name)
|
context = get_transaction_context("Sales Invoice", webnotes.form_dict.name)
|
||||||
modify_status(context.get("doc"))
|
modify_status(context.get("doc"))
|
||||||
context.update({
|
context.update({
|
||||||
|
@ -7,7 +7,7 @@ import webnotes
|
|||||||
no_cache = True
|
no_cache = True
|
||||||
|
|
||||||
def get_context():
|
def get_context():
|
||||||
from portal.utils import get_currency_context
|
from erpnext.portal.utils import get_currency_context
|
||||||
context = get_currency_context()
|
context = get_currency_context()
|
||||||
context.update({
|
context.update({
|
||||||
"title": "Invoices",
|
"title": "Invoices",
|
||||||
@ -20,8 +20,8 @@ def get_context():
|
|||||||
|
|
||||||
@webnotes.whitelist()
|
@webnotes.whitelist()
|
||||||
def get_invoices(start=0):
|
def get_invoices(start=0):
|
||||||
from portal.utils import get_transaction_list
|
from erpnext.portal.utils import get_transaction_list
|
||||||
from accounts.doctype.sales_invoice.templates.pages.invoice import modify_status
|
from erpnext.accounts.doctype.sales_invoice.templates.pages.invoice import modify_status
|
||||||
invoices = get_transaction_list("Sales Invoice", start, ["outstanding_amount"])
|
invoices = get_transaction_list("Sales Invoice", start, ["outstanding_amount"])
|
||||||
for d in invoices:
|
for d in invoices:
|
||||||
modify_status(d)
|
modify_status(d)
|
||||||
|
@ -5,8 +5,8 @@ import webnotes
|
|||||||
import unittest, json
|
import unittest, json
|
||||||
from webnotes.utils import flt
|
from webnotes.utils import flt
|
||||||
from webnotes.model.bean import DocstatusTransitionError, TimestampMismatchError
|
from webnotes.model.bean import DocstatusTransitionError, TimestampMismatchError
|
||||||
from accounts.utils import get_stock_and_account_difference
|
from erpnext.accounts.utils import get_stock_and_account_difference
|
||||||
from stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory
|
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory
|
||||||
|
|
||||||
class TestSalesInvoice(unittest.TestCase):
|
class TestSalesInvoice(unittest.TestCase):
|
||||||
def make(self):
|
def make(self):
|
||||||
@ -262,7 +262,7 @@ class TestSalesInvoice(unittest.TestCase):
|
|||||||
webnotes.conn.sql("""delete from `tabGL Entry`""")
|
webnotes.conn.sql("""delete from `tabGL Entry`""")
|
||||||
w = self.make()
|
w = self.make()
|
||||||
|
|
||||||
from accounts.doctype.journal_voucher.test_journal_voucher \
|
from erpnext.accounts.doctype.journal_voucher.test_journal_voucher \
|
||||||
import test_records as jv_test_records
|
import test_records as jv_test_records
|
||||||
|
|
||||||
jv = webnotes.bean(webnotes.copy_doclist(jv_test_records[0]))
|
jv = webnotes.bean(webnotes.copy_doclist(jv_test_records[0]))
|
||||||
@ -399,7 +399,7 @@ class TestSalesInvoice(unittest.TestCase):
|
|||||||
webnotes.delete_doc("Account", "_Test Warehouse No Account - _TC")
|
webnotes.delete_doc("Account", "_Test Warehouse No Account - _TC")
|
||||||
|
|
||||||
# insert purchase receipt
|
# insert purchase receipt
|
||||||
from stock.doctype.purchase_receipt.test_purchase_receipt import test_records \
|
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import test_records \
|
||||||
as pr_test_records
|
as pr_test_records
|
||||||
pr = webnotes.bean(copy=pr_test_records[0])
|
pr = webnotes.bean(copy=pr_test_records[0])
|
||||||
pr.doc.naming_series = "_T-Purchase Receipt-"
|
pr.doc.naming_series = "_T-Purchase Receipt-"
|
||||||
@ -505,7 +505,7 @@ class TestSalesInvoice(unittest.TestCase):
|
|||||||
set_perpetual_inventory(0)
|
set_perpetual_inventory(0)
|
||||||
|
|
||||||
def _insert_purchase_receipt(self):
|
def _insert_purchase_receipt(self):
|
||||||
from stock.doctype.purchase_receipt.test_purchase_receipt import test_records \
|
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import test_records \
|
||||||
as pr_test_records
|
as pr_test_records
|
||||||
pr = webnotes.bean(copy=pr_test_records[0])
|
pr = webnotes.bean(copy=pr_test_records[0])
|
||||||
pr.doc.naming_series = "_T-Purchase Receipt-"
|
pr.doc.naming_series = "_T-Purchase Receipt-"
|
||||||
@ -514,7 +514,7 @@ class TestSalesInvoice(unittest.TestCase):
|
|||||||
pr.submit()
|
pr.submit()
|
||||||
|
|
||||||
def _insert_delivery_note(self):
|
def _insert_delivery_note(self):
|
||||||
from stock.doctype.delivery_note.test_delivery_note import test_records \
|
from erpnext.stock.doctype.delivery_note.test_delivery_note import test_records \
|
||||||
as dn_test_records
|
as dn_test_records
|
||||||
dn = webnotes.bean(copy=dn_test_records[0])
|
dn = webnotes.bean(copy=dn_test_records[0])
|
||||||
dn.doc.naming_series = "_T-Delivery Note-"
|
dn.doc.naming_series = "_T-Delivery Note-"
|
||||||
@ -523,7 +523,7 @@ class TestSalesInvoice(unittest.TestCase):
|
|||||||
return dn
|
return dn
|
||||||
|
|
||||||
def _insert_pos_settings(self):
|
def _insert_pos_settings(self):
|
||||||
from accounts.doctype.pos_setting.test_pos_setting \
|
from erpnext.accounts.doctype.pos_setting.test_pos_setting \
|
||||||
import test_records as pos_setting_test_records
|
import test_records as pos_setting_test_records
|
||||||
webnotes.conn.sql("""delete from `tabPOS Setting`""")
|
webnotes.conn.sql("""delete from `tabPOS Setting`""")
|
||||||
|
|
||||||
@ -531,7 +531,7 @@ class TestSalesInvoice(unittest.TestCase):
|
|||||||
ps.insert()
|
ps.insert()
|
||||||
|
|
||||||
def test_sales_invoice_with_advance(self):
|
def test_sales_invoice_with_advance(self):
|
||||||
from accounts.doctype.journal_voucher.test_journal_voucher \
|
from erpnext.accounts.doctype.journal_voucher.test_journal_voucher \
|
||||||
import test_records as jv_test_records
|
import test_records as jv_test_records
|
||||||
|
|
||||||
jv = webnotes.bean(copy=jv_test_records[0])
|
jv = webnotes.bean(copy=jv_test_records[0])
|
||||||
@ -654,7 +654,7 @@ class TestSalesInvoice(unittest.TestCase):
|
|||||||
|
|
||||||
def _test_recurring_invoice(self, base_si, first_and_last_day):
|
def _test_recurring_invoice(self, base_si, first_and_last_day):
|
||||||
from webnotes.utils import add_months, get_last_day
|
from webnotes.utils import add_months, get_last_day
|
||||||
from accounts.doctype.sales_invoice.sales_invoice import manage_recurring_invoices
|
from erpnext.accounts.doctype.sales_invoice.sales_invoice import manage_recurring_invoices
|
||||||
|
|
||||||
no_of_months = ({"Monthly": 1, "Quarterly": 3, "Yearly": 12})[base_si.doc.recurring_type]
|
no_of_months = ({"Monthly": 1, "Quarterly": 3, "Yearly": 12})[base_si.doc.recurring_type]
|
||||||
|
|
||||||
@ -706,8 +706,8 @@ class TestSalesInvoice(unittest.TestCase):
|
|||||||
webnotes.conn.sql("delete from `tabGL Entry`")
|
webnotes.conn.sql("delete from `tabGL Entry`")
|
||||||
|
|
||||||
def test_serialized(self):
|
def test_serialized(self):
|
||||||
from stock.doctype.stock_entry.test_stock_entry import make_serialized_item
|
from erpnext.stock.doctype.stock_entry.test_stock_entry import make_serialized_item
|
||||||
from stock.doctype.serial_no.serial_no import get_serial_nos
|
from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos
|
||||||
|
|
||||||
se = make_serialized_item()
|
se = make_serialized_item()
|
||||||
serial_nos = get_serial_nos(se.doclist[1].serial_no)
|
serial_nos = get_serial_nos(se.doclist[1].serial_no)
|
||||||
@ -728,7 +728,7 @@ class TestSalesInvoice(unittest.TestCase):
|
|||||||
return si
|
return si
|
||||||
|
|
||||||
def test_serialized_cancel(self):
|
def test_serialized_cancel(self):
|
||||||
from stock.doctype.serial_no.serial_no import get_serial_nos
|
from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos
|
||||||
si = self.test_serialized()
|
si = self.test_serialized()
|
||||||
si.cancel()
|
si.cancel()
|
||||||
|
|
||||||
@ -740,8 +740,8 @@ class TestSalesInvoice(unittest.TestCase):
|
|||||||
"delivery_document_no"))
|
"delivery_document_no"))
|
||||||
|
|
||||||
def test_serialize_status(self):
|
def test_serialize_status(self):
|
||||||
from stock.doctype.serial_no.serial_no import SerialNoStatusError, get_serial_nos
|
from erpnext.stock.doctype.serial_no.serial_no import SerialNoStatusError, get_serial_nos
|
||||||
from stock.doctype.stock_entry.test_stock_entry import make_serialized_item
|
from erpnext.stock.doctype.stock_entry.test_stock_entry import make_serialized_item
|
||||||
|
|
||||||
se = make_serialized_item()
|
se = make_serialized_item()
|
||||||
serial_nos = get_serial_nos(se.doclist[1].serial_no)
|
serial_nos = get_serial_nos(se.doclist[1].serial_no)
|
||||||
|
@ -8,7 +8,7 @@ import webnotes
|
|||||||
from webnotes import _, msgprint
|
from webnotes import _, msgprint
|
||||||
from webnotes.utils import flt, fmt_money
|
from webnotes.utils import flt, fmt_money
|
||||||
from webnotes.model.controller import DocListController
|
from webnotes.model.controller import DocListController
|
||||||
from setup.utils import get_company_currency
|
from erpnext.setup.utils import get_company_currency
|
||||||
|
|
||||||
class OverlappingConditionError(webnotes.ValidationError): pass
|
class OverlappingConditionError(webnotes.ValidationError): pass
|
||||||
class FromGreaterThanToError(webnotes.ValidationError): pass
|
class FromGreaterThanToError(webnotes.ValidationError): pass
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
import webnotes
|
import webnotes
|
||||||
import unittest
|
import unittest
|
||||||
from accounts.doctype.shipping_rule.shipping_rule import FromGreaterThanToError, ManyBlankToValuesError, OverlappingConditionError
|
from erpnext.accounts.doctype.shipping_rule.shipping_rule import FromGreaterThanToError, ManyBlankToValuesError, OverlappingConditionError
|
||||||
|
|
||||||
class TestShippingRule(unittest.TestCase):
|
class TestShippingRule(unittest.TestCase):
|
||||||
def test_from_greater_than_to(self):
|
def test_from_greater_than_to(self):
|
||||||
|
@ -5,7 +5,7 @@ from __future__ import unicode_literals
|
|||||||
import webnotes
|
import webnotes
|
||||||
from webnotes.utils import flt, cstr
|
from webnotes.utils import flt, cstr
|
||||||
from webnotes import _
|
from webnotes import _
|
||||||
from accounts.utils import validate_expense_against_budget
|
from erpnext.accounts.utils import validate_expense_against_budget
|
||||||
|
|
||||||
|
|
||||||
class StockAccountInvalidTransaction(webnotes.ValidationError): pass
|
class StockAccountInvalidTransaction(webnotes.ValidationError): pass
|
||||||
@ -107,7 +107,7 @@ def validate_account_for_auto_accounting_for_stock(gl_map):
|
|||||||
def delete_gl_entries(gl_entries=None, voucher_type=None, voucher_no=None,
|
def delete_gl_entries(gl_entries=None, voucher_type=None, voucher_no=None,
|
||||||
adv_adj=False, update_outstanding="Yes"):
|
adv_adj=False, update_outstanding="Yes"):
|
||||||
|
|
||||||
from accounts.doctype.gl_entry.gl_entry import check_negative_balance, \
|
from erpnext.accounts.doctype.gl_entry.gl_entry import check_negative_balance, \
|
||||||
check_freezing_date, update_outstanding_amt, validate_frozen_account
|
check_freezing_date, update_outstanding_amt, validate_frozen_account
|
||||||
|
|
||||||
if not gl_entries:
|
if not gl_entries:
|
||||||
|
@ -63,7 +63,7 @@ pscript['onload_Accounts Browser'] = function(wrapper){
|
|||||||
|
|
||||||
// load up companies
|
// load up companies
|
||||||
return wn.call({
|
return wn.call({
|
||||||
method:'accounts.page.accounts_browser.accounts_browser.get_companies',
|
method: 'erpnext.accounts.page.accounts_browser.accounts_browser.get_companies',
|
||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
wrapper.$company_select.empty();
|
wrapper.$company_select.empty();
|
||||||
$.each(r.message, function(i, v) {
|
$.each(r.message, function(i, v) {
|
||||||
@ -108,7 +108,7 @@ erpnext.AccountsChart = Class.extend({
|
|||||||
parent: $(wrapper),
|
parent: $(wrapper),
|
||||||
label: ctype==="Account" ? "Accounts" : "Cost Centers",
|
label: ctype==="Account" ? "Accounts" : "Cost Centers",
|
||||||
args: {ctype: ctype, comp: company},
|
args: {ctype: ctype, comp: company},
|
||||||
method: 'accounts.page.accounts_browser.accounts_browser.get_children',
|
method: 'erpnext.accounts.page.accounts_browser.accounts_browser.get_children',
|
||||||
click: function(link) {
|
click: function(link) {
|
||||||
if(me.cur_toolbar)
|
if(me.cur_toolbar)
|
||||||
$(me.cur_toolbar).toggle(false);
|
$(me.cur_toolbar).toggle(false);
|
||||||
@ -261,7 +261,7 @@ erpnext.AccountsChart = Class.extend({
|
|||||||
|
|
||||||
return wn.call({
|
return wn.call({
|
||||||
args: v,
|
args: v,
|
||||||
method:'accounts.utils.add_ac',
|
method: 'erpnext.accounts.utils.add_ac',
|
||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
$(btn).done_working();
|
$(btn).done_working();
|
||||||
d.hide();
|
d.hide();
|
||||||
@ -308,7 +308,7 @@ erpnext.AccountsChart = Class.extend({
|
|||||||
|
|
||||||
return wn.call({
|
return wn.call({
|
||||||
args: v,
|
args: v,
|
||||||
method:'accounts.utils.add_cc',
|
method: 'erpnext.accounts.utils.add_cc',
|
||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
$(btn).done_working();
|
$(btn).done_working();
|
||||||
d.hide();
|
d.hide();
|
||||||
|
@ -5,7 +5,7 @@ from __future__ import unicode_literals
|
|||||||
import webnotes
|
import webnotes
|
||||||
import webnotes.defaults
|
import webnotes.defaults
|
||||||
from webnotes.utils import flt
|
from webnotes.utils import flt
|
||||||
from accounts.utils import get_balance_on
|
from erpnext.accounts.utils import get_balance_on
|
||||||
|
|
||||||
@webnotes.whitelist()
|
@webnotes.whitelist()
|
||||||
def get_companies():
|
def get_companies():
|
||||||
|
@ -5,7 +5,7 @@ from __future__ import unicode_literals
|
|||||||
import webnotes
|
import webnotes
|
||||||
from webnotes.utils import getdate, nowdate, flt, cstr
|
from webnotes.utils import getdate, nowdate, flt, cstr
|
||||||
from webnotes import msgprint, _
|
from webnotes import msgprint, _
|
||||||
from accounts.report.accounts_receivable.accounts_receivable import get_ageing_data
|
from erpnext.accounts.report.accounts_receivable.accounts_receivable import get_ageing_data
|
||||||
|
|
||||||
def execute(filters=None):
|
def execute(filters=None):
|
||||||
if not filters: filters = {}
|
if not filters: filters = {}
|
||||||
|
@ -12,7 +12,7 @@ def execute(filters=None):
|
|||||||
columns = get_columns()
|
columns = get_columns()
|
||||||
data = get_entries(filters)
|
data = get_entries(filters)
|
||||||
|
|
||||||
from accounts.utils import get_balance_on
|
from erpnext.accounts.utils import get_balance_on
|
||||||
balance_as_per_company = get_balance_on(filters["account"], filters["report_date"])
|
balance_as_per_company = get_balance_on(filters["account"], filters["report_date"])
|
||||||
|
|
||||||
total_debit, total_credit = 0,0
|
total_debit, total_credit = 0,0
|
||||||
|
@ -6,8 +6,8 @@ import webnotes
|
|||||||
from webnotes import _, msgprint
|
from webnotes import _, msgprint
|
||||||
from webnotes.utils import flt
|
from webnotes.utils import flt
|
||||||
import time
|
import time
|
||||||
from accounts.utils import get_fiscal_year
|
from erpnext.accounts.utils import get_fiscal_year
|
||||||
from controllers.trends import get_period_date_ranges, get_period_month_ranges
|
from erpnext.controllers.trends import get_period_date_ranges, get_period_month_ranges
|
||||||
|
|
||||||
def execute(filters=None):
|
def execute(filters=None):
|
||||||
if not filters: filters = {}
|
if not filters: filters = {}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import webnotes
|
import webnotes
|
||||||
from webnotes.utils import flt
|
from webnotes.utils import flt
|
||||||
from stock.utils import get_buying_amount, get_sales_bom_buying_amount
|
from erpnext.stock.utils import get_buying_amount, get_sales_bom_buying_amount
|
||||||
|
|
||||||
def execute(filters=None):
|
def execute(filters=None):
|
||||||
if not filters: filters = {}
|
if not filters: filters = {}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import webnotes
|
import webnotes
|
||||||
from webnotes import msgprint, _
|
from webnotes import msgprint, _
|
||||||
from accounts.report.accounts_receivable.accounts_receivable import get_ageing_data
|
from erpnext.accounts.report.accounts_receivable.accounts_receivable import get_ageing_data
|
||||||
|
|
||||||
def execute(filters=None):
|
def execute(filters=None):
|
||||||
if not filters: filters = {}
|
if not filters: filters = {}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import webnotes
|
import webnotes
|
||||||
from controllers.trends import get_columns,get_data
|
from erpnext.controllers.trends import get_columns,get_data
|
||||||
|
|
||||||
def execute(filters=None):
|
def execute(filters=None):
|
||||||
if not filters: filters ={}
|
if not filters: filters ={}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import webnotes
|
import webnotes
|
||||||
from controllers.trends import get_columns,get_data
|
from erpnext.controllers.trends import get_columns,get_data
|
||||||
|
|
||||||
def execute(filters=None):
|
def execute(filters=None):
|
||||||
if not filters: filters ={}
|
if not filters: filters ={}
|
||||||
|
@ -8,7 +8,7 @@ from webnotes.utils import nowdate, nowtime, cstr, flt, now, getdate, add_months
|
|||||||
from webnotes.model.doc import addchild
|
from webnotes.model.doc import addchild
|
||||||
from webnotes import msgprint, _
|
from webnotes import msgprint, _
|
||||||
from webnotes.utils import formatdate
|
from webnotes.utils import formatdate
|
||||||
from utilities import build_filter_conditions
|
from erpnext.utilities import build_filter_conditions
|
||||||
|
|
||||||
|
|
||||||
class FiscalYearError(webnotes.ValidationError): pass
|
class FiscalYearError(webnotes.ValidationError): pass
|
||||||
@ -260,7 +260,7 @@ def fix_total_debit_credit():
|
|||||||
(d.diff, d.voucher_type, d.voucher_no))
|
(d.diff, d.voucher_type, d.voucher_no))
|
||||||
|
|
||||||
def get_stock_and_account_difference(account_list=None, posting_date=None):
|
def get_stock_and_account_difference(account_list=None, posting_date=None):
|
||||||
from stock.utils import get_stock_balance_on
|
from erpnext.stock.utils import get_stock_balance_on
|
||||||
|
|
||||||
if not posting_date: posting_date = nowdate()
|
if not posting_date: posting_date = nowdate()
|
||||||
|
|
||||||
|
@ -14,6 +14,6 @@ class DocType:
|
|||||||
for key in ["supplier_type", "supp_master_name", "maintain_same_rate", "buying_price_list"]:
|
for key in ["supplier_type", "supp_master_name", "maintain_same_rate", "buying_price_list"]:
|
||||||
webnotes.conn.set_default(key, self.doc.fields.get(key, ""))
|
webnotes.conn.set_default(key, self.doc.fields.get(key, ""))
|
||||||
|
|
||||||
from setup.doctype.naming_series.naming_series import set_by_naming_series
|
from erpnext.setup.doctype.naming_series.naming_series import set_by_naming_series
|
||||||
set_by_naming_series("Supplier", "supplier_name",
|
set_by_naming_series("Supplier", "supplier_name",
|
||||||
self.doc.get("supp_master_name")=="Naming Series", hide_name_field=False)
|
self.doc.get("supp_master_name")=="Naming Series", hide_name_field=False)
|
||||||
|
@ -112,7 +112,7 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
|
|||||||
cur_frm.fields_dict[me.frm.cscript.fname].grid.grid_rows[item.idx - 1].remove();
|
cur_frm.fields_dict[me.frm.cscript.fname].grid.grid_rows[item.idx - 1].remove();
|
||||||
} else {
|
} else {
|
||||||
return this.frm.call({
|
return this.frm.call({
|
||||||
method: "buying.utils.get_item_details",
|
method: "erpnext.buying.utils.get_item_details",
|
||||||
child: item,
|
child: item,
|
||||||
args: {
|
args: {
|
||||||
args: {
|
args: {
|
||||||
@ -178,7 +178,7 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
|
|||||||
var item = wn.model.get_doc(cdt, cdn);
|
var item = wn.model.get_doc(cdt, cdn);
|
||||||
if(item.item_code && item.uom) {
|
if(item.item_code && item.uom) {
|
||||||
return this.frm.call({
|
return this.frm.call({
|
||||||
method: "buying.utils.get_conversion_factor",
|
method: "erpnext.buying.utils.get_conversion_factor",
|
||||||
child: item,
|
child: item,
|
||||||
args: {
|
args: {
|
||||||
item_code: item.item_code,
|
item_code: item.item_code,
|
||||||
@ -211,7 +211,7 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
|
|||||||
var item = wn.model.get_doc(cdt, cdn);
|
var item = wn.model.get_doc(cdt, cdn);
|
||||||
if(item.item_code && item.warehouse) {
|
if(item.item_code && item.warehouse) {
|
||||||
return this.frm.call({
|
return this.frm.call({
|
||||||
method: "buying.utils.get_projected_qty",
|
method: "erpnext.buying.utils.get_projected_qty",
|
||||||
child: item,
|
child: item,
|
||||||
args: {
|
args: {
|
||||||
item_code: item.item_code,
|
item_code: item.item_code,
|
||||||
|
@ -8,10 +8,10 @@ from webnotes.utils import cstr, flt
|
|||||||
from webnotes.model.utils import getlist
|
from webnotes.model.utils import getlist
|
||||||
from webnotes import msgprint, _
|
from webnotes import msgprint, _
|
||||||
|
|
||||||
from buying.utils import get_last_purchase_details
|
from erpnext.buying.utils import get_last_purchase_details
|
||||||
|
|
||||||
|
|
||||||
from controllers.buying_controller import BuyingController
|
from erpnext.controllers.buying_controller import BuyingController
|
||||||
class DocType(BuyingController):
|
class DocType(BuyingController):
|
||||||
def __init__(self, doc, doclist=None):
|
def __init__(self, doc, doclist=None):
|
||||||
self.doc = doc
|
self.doc = doc
|
||||||
@ -94,7 +94,7 @@ class DocType(BuyingController):
|
|||||||
if not item:
|
if not item:
|
||||||
msgprint("Item %s does not exist in Item Master." % cstr(d.item_code), raise_exception=True)
|
msgprint("Item %s does not exist in Item Master." % cstr(d.item_code), raise_exception=True)
|
||||||
|
|
||||||
from stock.utils import validate_end_of_life
|
from erpnext.stock.utils import validate_end_of_life
|
||||||
validate_end_of_life(d.item_code, item[0][3])
|
validate_end_of_life(d.item_code, item[0][3])
|
||||||
|
|
||||||
# validate stock item
|
# validate stock item
|
||||||
|
@ -42,14 +42,14 @@ erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend(
|
|||||||
|
|
||||||
make_purchase_receipt: function() {
|
make_purchase_receipt: function() {
|
||||||
wn.model.open_mapped_doc({
|
wn.model.open_mapped_doc({
|
||||||
method: "buying.doctype.purchase_order.purchase_order.make_purchase_receipt",
|
method: "erpnext.buying.doctype.purchase_order.purchase_order.make_purchase_receipt",
|
||||||
source_name: cur_frm.doc.name
|
source_name: cur_frm.doc.name
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
make_purchase_invoice: function() {
|
make_purchase_invoice: function() {
|
||||||
wn.model.open_mapped_doc({
|
wn.model.open_mapped_doc({
|
||||||
method: "buying.doctype.purchase_order.purchase_order.make_purchase_invoice",
|
method: "erpnext.buying.doctype.purchase_order.purchase_order.make_purchase_invoice",
|
||||||
source_name: cur_frm.doc.name
|
source_name: cur_frm.doc.name
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -58,7 +58,7 @@ erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend(
|
|||||||
cur_frm.add_custom_button(wn._('From Material Request'),
|
cur_frm.add_custom_button(wn._('From Material Request'),
|
||||||
function() {
|
function() {
|
||||||
wn.model.map_current_doc({
|
wn.model.map_current_doc({
|
||||||
method: "stock.doctype.material_request.material_request.make_purchase_order",
|
method: "erpnext.stock.doctype.material_request.material_request.make_purchase_order",
|
||||||
source_doctype: "Material Request",
|
source_doctype: "Material Request",
|
||||||
get_query_filters: {
|
get_query_filters: {
|
||||||
material_request_type: "Purchase",
|
material_request_type: "Purchase",
|
||||||
@ -74,7 +74,7 @@ erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend(
|
|||||||
cur_frm.add_custom_button(wn._('From Supplier Quotation'),
|
cur_frm.add_custom_button(wn._('From Supplier Quotation'),
|
||||||
function() {
|
function() {
|
||||||
wn.model.map_current_doc({
|
wn.model.map_current_doc({
|
||||||
method: "buying.doctype.supplier_quotation.supplier_quotation.make_purchase_order",
|
method: "erpnext.buying.doctype.supplier_quotation.supplier_quotation.make_purchase_order",
|
||||||
source_doctype: "Supplier Quotation",
|
source_doctype: "Supplier Quotation",
|
||||||
get_query_filters: {
|
get_query_filters: {
|
||||||
docstatus: 1,
|
docstatus: 1,
|
||||||
@ -88,7 +88,7 @@ erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend(
|
|||||||
cur_frm.add_custom_button(wn._('For Supplier'),
|
cur_frm.add_custom_button(wn._('For Supplier'),
|
||||||
function() {
|
function() {
|
||||||
wn.model.map_current_doc({
|
wn.model.map_current_doc({
|
||||||
method: "stock.doctype.material_request.material_request.make_purchase_order_based_on_supplier",
|
method: "erpnext.stock.doctype.material_request.material_request.make_purchase_order_based_on_supplier",
|
||||||
source_doctype: "Supplier",
|
source_doctype: "Supplier",
|
||||||
get_query_filters: {
|
get_query_filters: {
|
||||||
docstatus: ["!=", 2],
|
docstatus: ["!=", 2],
|
||||||
|
@ -10,7 +10,7 @@ from webnotes.model.code import get_obj
|
|||||||
from webnotes import msgprint
|
from webnotes import msgprint
|
||||||
|
|
||||||
|
|
||||||
from controllers.buying_controller import BuyingController
|
from erpnext.controllers.buying_controller import BuyingController
|
||||||
class DocType(BuyingController):
|
class DocType(BuyingController):
|
||||||
def __init__(self, doc, doclist=[]):
|
def __init__(self, doc, doclist=[]):
|
||||||
self.doc = doc
|
self.doc = doc
|
||||||
@ -35,8 +35,8 @@ class DocType(BuyingController):
|
|||||||
if not self.doc.status:
|
if not self.doc.status:
|
||||||
self.doc.status = "Draft"
|
self.doc.status = "Draft"
|
||||||
|
|
||||||
import utilities
|
from erpnext.utilities import validate_status
|
||||||
utilities.validate_status(self.doc.status, ["Draft", "Submitted", "Stopped",
|
validate_status(self.doc.status, ["Draft", "Submitted", "Stopped",
|
||||||
"Cancelled"])
|
"Cancelled"])
|
||||||
|
|
||||||
pc_obj = get_obj(dt='Purchase Common')
|
pc_obj = get_obj(dt='Purchase Common')
|
||||||
@ -83,7 +83,7 @@ class DocType(BuyingController):
|
|||||||
|
|
||||||
|
|
||||||
def update_bin(self, is_submit, is_stopped = 0):
|
def update_bin(self, is_submit, is_stopped = 0):
|
||||||
from stock.utils import update_bin
|
from erpnext.stock.utils import update_bin
|
||||||
pc_obj = get_obj('Purchase Common')
|
pc_obj = get_obj('Purchase Common')
|
||||||
for d in getlist(self.doclist, 'po_details'):
|
for d in getlist(self.doclist, 'po_details'):
|
||||||
#1. Check if is_stock_item == 'Yes'
|
#1. Check if is_stock_item == 'Yes'
|
||||||
|
@ -10,7 +10,7 @@ from webnotes.utils import flt
|
|||||||
|
|
||||||
class TestPurchaseOrder(unittest.TestCase):
|
class TestPurchaseOrder(unittest.TestCase):
|
||||||
def test_make_purchase_receipt(self):
|
def test_make_purchase_receipt(self):
|
||||||
from buying.doctype.purchase_order.purchase_order import make_purchase_receipt
|
from erpnext.buying.doctype.purchase_order.purchase_order import make_purchase_receipt
|
||||||
|
|
||||||
po = webnotes.bean(copy=test_records[0]).insert()
|
po = webnotes.bean(copy=test_records[0]).insert()
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ class TestPurchaseOrder(unittest.TestCase):
|
|||||||
def test_ordered_qty(self):
|
def test_ordered_qty(self):
|
||||||
webnotes.conn.sql("delete from tabBin")
|
webnotes.conn.sql("delete from tabBin")
|
||||||
|
|
||||||
from buying.doctype.purchase_order.purchase_order import make_purchase_receipt
|
from erpnext.buying.doctype.purchase_order.purchase_order import make_purchase_receipt
|
||||||
|
|
||||||
po = webnotes.bean(copy=test_records[0]).insert()
|
po = webnotes.bean(copy=test_records[0]).insert()
|
||||||
|
|
||||||
@ -75,7 +75,7 @@ class TestPurchaseOrder(unittest.TestCase):
|
|||||||
"warehouse": "_Test Warehouse - _TC"}, "ordered_qty")), 0.0)
|
"warehouse": "_Test Warehouse - _TC"}, "ordered_qty")), 0.0)
|
||||||
|
|
||||||
def test_make_purchase_invocie(self):
|
def test_make_purchase_invocie(self):
|
||||||
from buying.doctype.purchase_order.purchase_order import make_purchase_invoice
|
from erpnext.buying.doctype.purchase_order.purchase_order import make_purchase_invoice
|
||||||
|
|
||||||
po = webnotes.bean(copy=test_records[0]).insert()
|
po = webnotes.bean(copy=test_records[0]).insert()
|
||||||
|
|
||||||
@ -98,14 +98,14 @@ class TestPurchaseOrder(unittest.TestCase):
|
|||||||
self.assertEquals(len(po.doclist.get({"parentfield": "po_raw_material_details"})), 2)
|
self.assertEquals(len(po.doclist.get({"parentfield": "po_raw_material_details"})), 2)
|
||||||
|
|
||||||
def test_warehouse_company_validation(self):
|
def test_warehouse_company_validation(self):
|
||||||
from stock.utils import InvalidWarehouseCompany
|
from erpnext.stock.utils import InvalidWarehouseCompany
|
||||||
po = webnotes.bean(copy=test_records[0])
|
po = webnotes.bean(copy=test_records[0])
|
||||||
po.doc.company = "_Test Company 1"
|
po.doc.company = "_Test Company 1"
|
||||||
po.doc.conversion_rate = 0.0167
|
po.doc.conversion_rate = 0.0167
|
||||||
self.assertRaises(InvalidWarehouseCompany, po.insert)
|
self.assertRaises(InvalidWarehouseCompany, po.insert)
|
||||||
|
|
||||||
def test_uom_integer_validation(self):
|
def test_uom_integer_validation(self):
|
||||||
from utilities.transaction_base import UOMMustBeIntegerError
|
from erpnext.utilities.transaction_base import UOMMustBeIntegerError
|
||||||
po = webnotes.bean(copy=test_records[0])
|
po = webnotes.bean(copy=test_records[0])
|
||||||
po.doclist[1].qty = 3.4
|
po.doclist[1].qty = 3.4
|
||||||
self.assertRaises(UOMMustBeIntegerError, po.insert)
|
self.assertRaises(UOMMustBeIntegerError, po.insert)
|
||||||
|
@ -38,7 +38,7 @@ cur_frm.cscript.make_dashboard = function(doc) {
|
|||||||
|
|
||||||
return wn.call({
|
return wn.call({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
method:"buying.doctype.supplier.supplier.get_dashboard_info",
|
method: "erpnext.buying.doctype.supplier.supplier.get_dashboard_info",
|
||||||
args: {
|
args: {
|
||||||
supplier: cur_frm.doc.name
|
supplier: cur_frm.doc.name
|
||||||
},
|
},
|
||||||
|
@ -10,7 +10,7 @@ from webnotes import msgprint, _
|
|||||||
from webnotes.model.doc import make_autoname
|
from webnotes.model.doc import make_autoname
|
||||||
|
|
||||||
|
|
||||||
from utilities.transaction_base import TransactionBase
|
from erpnext.utilities.transaction_base import TransactionBase
|
||||||
|
|
||||||
class DocType(TransactionBase):
|
class DocType(TransactionBase):
|
||||||
def __init__(self, doc, doclist=[]):
|
def __init__(self, doc, doclist=[]):
|
||||||
@ -149,7 +149,7 @@ class DocType(TransactionBase):
|
|||||||
self.delete_supplier_account()
|
self.delete_supplier_account()
|
||||||
|
|
||||||
def before_rename(self, olddn, newdn, merge=False):
|
def before_rename(self, olddn, newdn, merge=False):
|
||||||
from accounts.utils import rename_account_for
|
from erpnext.accounts.utils import rename_account_for
|
||||||
rename_account_for("Supplier", olddn, newdn, merge)
|
rename_account_for("Supplier", olddn, newdn, merge)
|
||||||
|
|
||||||
def after_rename(self, olddn, newdn, merge=False):
|
def after_rename(self, olddn, newdn, merge=False):
|
||||||
|
@ -22,7 +22,7 @@ erpnext.buying.SupplierQuotationController = erpnext.buying.BuyingController.ext
|
|||||||
cur_frm.add_custom_button(wn._('From Material Request'),
|
cur_frm.add_custom_button(wn._('From Material Request'),
|
||||||
function() {
|
function() {
|
||||||
wn.model.map_current_doc({
|
wn.model.map_current_doc({
|
||||||
method: "stock.doctype.material_request.material_request.make_supplier_quotation",
|
method: "erpnext.stock.doctype.material_request.material_request.make_supplier_quotation",
|
||||||
source_doctype: "Material Request",
|
source_doctype: "Material Request",
|
||||||
get_query_filters: {
|
get_query_filters: {
|
||||||
material_request_type: "Purchase",
|
material_request_type: "Purchase",
|
||||||
@ -38,7 +38,7 @@ erpnext.buying.SupplierQuotationController = erpnext.buying.BuyingController.ext
|
|||||||
|
|
||||||
make_purchase_order: function() {
|
make_purchase_order: function() {
|
||||||
wn.model.open_mapped_doc({
|
wn.model.open_mapped_doc({
|
||||||
method: "buying.doctype.supplier_quotation.supplier_quotation.make_purchase_order",
|
method: "erpnext.buying.doctype.supplier_quotation.supplier_quotation.make_purchase_order",
|
||||||
source_name: cur_frm.doc.name
|
source_name: cur_frm.doc.name
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ from __future__ import unicode_literals
|
|||||||
import webnotes
|
import webnotes
|
||||||
from webnotes.model.code import get_obj
|
from webnotes.model.code import get_obj
|
||||||
|
|
||||||
from controllers.buying_controller import BuyingController
|
from erpnext.controllers.buying_controller import BuyingController
|
||||||
class DocType(BuyingController):
|
class DocType(BuyingController):
|
||||||
def __init__(self, doc, doclist=None):
|
def __init__(self, doc, doclist=None):
|
||||||
self.doc, self.doclist = doc, doclist or []
|
self.doc, self.doclist = doc, doclist or []
|
||||||
@ -17,8 +17,8 @@ class DocType(BuyingController):
|
|||||||
if not self.doc.status:
|
if not self.doc.status:
|
||||||
self.doc.status = "Draft"
|
self.doc.status = "Draft"
|
||||||
|
|
||||||
import utilities
|
from erpnext.utilities import validate_status
|
||||||
utilities.validate_status(self.doc.status, ["Draft", "Submitted", "Stopped",
|
validate_status(self.doc.status, ["Draft", "Submitted", "Stopped",
|
||||||
"Cancelled"])
|
"Cancelled"])
|
||||||
|
|
||||||
self.validate_common()
|
self.validate_common()
|
||||||
|
@ -9,7 +9,7 @@ import webnotes.defaults
|
|||||||
|
|
||||||
class TestPurchaseOrder(unittest.TestCase):
|
class TestPurchaseOrder(unittest.TestCase):
|
||||||
def test_make_purchase_order(self):
|
def test_make_purchase_order(self):
|
||||||
from buying.doctype.supplier_quotation.supplier_quotation import make_purchase_order
|
from erpnext.buying.doctype.supplier_quotation.supplier_quotation import make_purchase_order
|
||||||
|
|
||||||
sq = webnotes.bean(copy=test_records[0]).insert()
|
sq = webnotes.bean(copy=test_records[0]).insert()
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import webnotes
|
import webnotes
|
||||||
from controllers.trends import get_columns,get_data
|
from erpnext.controllers.trends import get_columns,get_data
|
||||||
|
|
||||||
def execute(filters=None):
|
def execute(filters=None):
|
||||||
if not filters: filters ={}
|
if not filters: filters ={}
|
||||||
|
@ -83,7 +83,7 @@ def _get_basic_details(args, item_bean):
|
|||||||
return out
|
return out
|
||||||
|
|
||||||
def _get_price_list_rate(args, item_bean, meta):
|
def _get_price_list_rate(args, item_bean, meta):
|
||||||
from utilities.transaction_base import validate_currency
|
from erpnext.utilities.transaction_base import validate_currency
|
||||||
item = item_bean.doc
|
item = item_bean.doc
|
||||||
out = webnotes._dict()
|
out = webnotes._dict()
|
||||||
|
|
||||||
@ -117,7 +117,7 @@ def _get_supplier_part_no(args, item_bean):
|
|||||||
return item_supplier and item_supplier[0].supplier_part_no or None
|
return item_supplier and item_supplier[0].supplier_part_no or None
|
||||||
|
|
||||||
def _validate_item_details(args, item):
|
def _validate_item_details(args, item):
|
||||||
from utilities.transaction_base import validate_item_fetch
|
from erpnext.utilities.transaction_base import validate_item_fetch
|
||||||
validate_item_fetch(args, item)
|
validate_item_fetch(args, item)
|
||||||
|
|
||||||
# validate if purchase item or subcontracted item
|
# validate if purchase item or subcontracted item
|
||||||
|
@ -6,9 +6,9 @@ import webnotes
|
|||||||
from webnotes import _, msgprint
|
from webnotes import _, msgprint
|
||||||
from webnotes.utils import flt, cint, today, cstr
|
from webnotes.utils import flt, cint, today, cstr
|
||||||
from webnotes.model.code import get_obj
|
from webnotes.model.code import get_obj
|
||||||
from setup.utils import get_company_currency
|
from erpnext.setup.utils import get_company_currency
|
||||||
from accounts.utils import get_fiscal_year, validate_fiscal_year
|
from erpnext.accounts.utils import get_fiscal_year, validate_fiscal_year
|
||||||
from utilities.transaction_base import TransactionBase, validate_conversion_rate
|
from erpnext.utilities.transaction_base import TransactionBase, validate_conversion_rate
|
||||||
import json
|
import json
|
||||||
|
|
||||||
class AccountsController(TransactionBase):
|
class AccountsController(TransactionBase):
|
||||||
@ -403,7 +403,7 @@ class AccountsController(TransactionBase):
|
|||||||
raise_exception=1)
|
raise_exception=1)
|
||||||
|
|
||||||
def get_company_default(self, fieldname):
|
def get_company_default(self, fieldname):
|
||||||
from accounts.utils import get_company_default
|
from erpnext.accounts.utils import get_company_default
|
||||||
return get_company_default(self.doc.company, fieldname)
|
return get_company_default(self.doc.company, fieldname)
|
||||||
|
|
||||||
def get_stock_items(self):
|
def get_stock_items(self):
|
||||||
|
@ -6,10 +6,10 @@ import webnotes
|
|||||||
from webnotes import _, msgprint
|
from webnotes import _, msgprint
|
||||||
from webnotes.utils import flt, _round
|
from webnotes.utils import flt, _round
|
||||||
|
|
||||||
from buying.utils import get_item_details
|
from erpnext.buying.utils import get_item_details
|
||||||
from setup.utils import get_company_currency
|
from erpnext.setup.utils import get_company_currency
|
||||||
|
|
||||||
from controllers.stock_controller import StockController
|
from erpnext.controllers.stock_controller import StockController
|
||||||
|
|
||||||
class BuyingController(StockController):
|
class BuyingController(StockController):
|
||||||
def onload_post_render(self):
|
def onload_post_render(self):
|
||||||
@ -50,7 +50,7 @@ class BuyingController(StockController):
|
|||||||
break
|
break
|
||||||
|
|
||||||
def validate_warehouse(self):
|
def validate_warehouse(self):
|
||||||
from stock.utils import validate_warehouse_user, validate_warehouse_company
|
from erpnext.stock.utils import validate_warehouse_user, validate_warehouse_company
|
||||||
|
|
||||||
warehouses = list(set([d.warehouse for d in
|
warehouses = list(set([d.warehouse for d in
|
||||||
self.doclist.get({"doctype": self.tname}) if d.warehouse]))
|
self.doclist.get({"doctype": self.tname}) if d.warehouse]))
|
||||||
|
@ -186,7 +186,7 @@ def get_delivery_notes_to_be_billed(doctype, txt, searchfield, start, page_len,
|
|||||||
}, { "start": start, "page_len": page_len, "txt": ("%%%s%%" % txt) })
|
}, { "start": start, "page_len": page_len, "txt": ("%%%s%%" % txt) })
|
||||||
|
|
||||||
def get_batch_no(doctype, txt, searchfield, start, page_len, filters):
|
def get_batch_no(doctype, txt, searchfield, start, page_len, filters):
|
||||||
from controllers.queries import get_match_cond
|
from erpnext.controllers.queries import get_match_cond
|
||||||
|
|
||||||
if filters.has_key('warehouse'):
|
if filters.has_key('warehouse'):
|
||||||
return webnotes.conn.sql("""select batch_no from `tabStock Ledger Entry` sle
|
return webnotes.conn.sql("""select batch_no from `tabStock Ledger Entry` sle
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import webnotes
|
import webnotes
|
||||||
from webnotes.utils import cint, flt, comma_or, _round, cstr
|
from webnotes.utils import cint, flt, comma_or, _round, cstr
|
||||||
from setup.utils import get_company_currency
|
from erpnext.setup.utils import get_company_currency
|
||||||
from selling.utils import get_item_details
|
from erpnext.selling.utils import get_item_details
|
||||||
from webnotes import msgprint, _
|
from webnotes import msgprint, _
|
||||||
|
|
||||||
from controllers.stock_controller import StockController
|
from erpnext.controllers.stock_controller import StockController
|
||||||
|
|
||||||
class SellingController(StockController):
|
class SellingController(StockController):
|
||||||
def onload_post_render(self):
|
def onload_post_render(self):
|
||||||
|
@ -7,8 +7,8 @@ from webnotes.utils import cint, flt, cstr
|
|||||||
from webnotes import msgprint, _
|
from webnotes import msgprint, _
|
||||||
import webnotes.defaults
|
import webnotes.defaults
|
||||||
|
|
||||||
from controllers.accounts_controller import AccountsController
|
from erpnext.controllers.accounts_controller import AccountsController
|
||||||
from accounts.general_ledger import make_gl_entries, delete_gl_entries
|
from erpnext.accounts.general_ledger import make_gl_entries, delete_gl_entries
|
||||||
|
|
||||||
class StockController(AccountsController):
|
class StockController(AccountsController):
|
||||||
def make_gl_entries(self, update_gl_entries_after=True):
|
def make_gl_entries(self, update_gl_entries_after=True):
|
||||||
@ -27,7 +27,7 @@ class StockController(AccountsController):
|
|||||||
|
|
||||||
def get_gl_entries(self, warehouse_account=None, default_expense_account=None,
|
def get_gl_entries(self, warehouse_account=None, default_expense_account=None,
|
||||||
default_cost_center=None):
|
default_cost_center=None):
|
||||||
from accounts.general_ledger import process_gl_map
|
from erpnext.accounts.general_ledger import process_gl_map
|
||||||
if not warehouse_account:
|
if not warehouse_account:
|
||||||
warehouse_account = self.get_warehouse_account()
|
warehouse_account = self.get_warehouse_account()
|
||||||
|
|
||||||
@ -160,7 +160,7 @@ class StockController(AccountsController):
|
|||||||
where voucher_type=%s and voucher_no=%s""", (voucher_type, voucher_no))
|
where voucher_type=%s and voucher_no=%s""", (voucher_type, voucher_no))
|
||||||
|
|
||||||
def make_adjustment_entry(self, expected_gle, voucher_obj):
|
def make_adjustment_entry(self, expected_gle, voucher_obj):
|
||||||
from accounts.utils import get_stock_and_account_difference
|
from erpnext.accounts.utils import get_stock_and_account_difference
|
||||||
account_list = [d.account for d in expected_gle]
|
account_list = [d.account for d in expected_gle]
|
||||||
acc_diff = get_stock_and_account_difference(account_list, expected_gle[0].posting_date)
|
acc_diff = get_stock_and_account_difference(account_list, expected_gle[0].posting_date)
|
||||||
|
|
||||||
@ -190,7 +190,7 @@ class StockController(AccountsController):
|
|||||||
])
|
])
|
||||||
|
|
||||||
if gl_entries:
|
if gl_entries:
|
||||||
from accounts.general_ledger import make_gl_entries
|
from erpnext.accounts.general_ledger import make_gl_entries
|
||||||
make_gl_entries(gl_entries)
|
make_gl_entries(gl_entries)
|
||||||
|
|
||||||
def check_expense_account(self, item):
|
def check_expense_account(self, item):
|
||||||
@ -226,7 +226,7 @@ class StockController(AccountsController):
|
|||||||
return sl_dict
|
return sl_dict
|
||||||
|
|
||||||
def make_sl_entries(self, sl_entries, is_amended=None):
|
def make_sl_entries(self, sl_entries, is_amended=None):
|
||||||
from stock.stock_ledger import make_sl_entries
|
from erpnext.stock.stock_ledger import make_sl_entries
|
||||||
make_sl_entries(sl_entries, is_amended)
|
make_sl_entries(sl_entries, is_amended)
|
||||||
|
|
||||||
def get_stock_ledger_entries(self, item_list=None, warehouse_list=None):
|
def get_stock_ledger_entries(self, item_list=None, warehouse_list=None):
|
||||||
|
@ -12,7 +12,7 @@ wn.pages['activity'].onload = function(wrapper) {
|
|||||||
var list = new wn.ui.Listing({
|
var list = new wn.ui.Listing({
|
||||||
hide_refresh: true,
|
hide_refresh: true,
|
||||||
appframe: wrapper.appframe,
|
appframe: wrapper.appframe,
|
||||||
method: 'home.page.activity.activity.get_feed',
|
method: 'erpnext.home.page.activity.activity.get_feed',
|
||||||
parent: $(wrapper).find(".layout-main"),
|
parent: $(wrapper).find(".layout-main"),
|
||||||
render_row: function(row, data) {
|
render_row: function(row, data) {
|
||||||
new erpnext.ActivityFeed(row, data);
|
new erpnext.ActivityFeed(row, data);
|
||||||
|
@ -13,7 +13,7 @@ wn.pages['latest-updates'].onload = function(wrapper) {
|
|||||||
<div class="progress-bar" style="width: 100%;"></div></div>')
|
<div class="progress-bar" style="width: 100%;"></div></div>')
|
||||||
|
|
||||||
return wn.call({
|
return wn.call({
|
||||||
method:"home.page.latest_updates.latest_updates.get",
|
method: "erpnext.home.page.latest_updates.latest_updates.get",
|
||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
parent.empty();
|
parent.empty();
|
||||||
$("<p class='help'>"+wn._("Report issues at")+
|
$("<p class='help'>"+wn._("Report issues at")+
|
||||||
|
@ -25,7 +25,7 @@ cur_frm.cscript.refresh = function(doc,cdt,cdn){
|
|||||||
|
|
||||||
cur_frm.cscript.kra_template = function(doc, dt, dn) {
|
cur_frm.cscript.kra_template = function(doc, dt, dn) {
|
||||||
wn.model.map_current_doc({
|
wn.model.map_current_doc({
|
||||||
method: "hr.doctype.appraisal.appraisal.fetch_appraisal_template",
|
method: "erpnext.hr.doctype.appraisal.appraisal.fetch_appraisal_template",
|
||||||
source_name: cur_frm.doc.kra_template,
|
source_name: cur_frm.doc.kra_template,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ class DocType:
|
|||||||
raise_exception=1)
|
raise_exception=1)
|
||||||
|
|
||||||
def validate_fiscal_year(self):
|
def validate_fiscal_year(self):
|
||||||
from accounts.utils import validate_fiscal_year
|
from erpnext.accounts.utils import validate_fiscal_year
|
||||||
validate_fiscal_year(self.doc.att_date, self.doc.fiscal_year)
|
validate_fiscal_year(self.doc.att_date, self.doc.fiscal_year)
|
||||||
|
|
||||||
def validate_att_date(self):
|
def validate_att_date(self):
|
||||||
@ -48,8 +48,8 @@ class DocType:
|
|||||||
_(" not active or does not exists in the system"), raise_exception=1)
|
_(" not active or does not exists in the system"), raise_exception=1)
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
import utilities
|
from erpnext.utilities import validate_status
|
||||||
utilities.validate_status(self.doc.status, ["Present", "Absent", "Half Day"])
|
validate_status(self.doc.status, ["Present", "Absent", "Half Day"])
|
||||||
self.validate_fiscal_year()
|
self.validate_fiscal_year()
|
||||||
self.validate_att_date()
|
self.validate_att_date()
|
||||||
self.validate_duplicate_record()
|
self.validate_duplicate_record()
|
||||||
|
@ -29,7 +29,7 @@ erpnext.hr.EmployeeController = wn.ui.form.Controller.extend({
|
|||||||
setup_leave_approver_select: function() {
|
setup_leave_approver_select: function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
return this.frm.call({
|
return this.frm.call({
|
||||||
method:"hr.utils.get_leave_approver_list",
|
method: "erpnext.hr.utils.get_leave_approver_list",
|
||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
var df = wn.meta.get_docfield("Employee Leave Approver", "leave_approver",
|
var df = wn.meta.get_docfield("Employee Leave Approver", "leave_approver",
|
||||||
me.frm.doc.name);
|
me.frm.doc.name);
|
||||||
|
@ -27,8 +27,8 @@ class DocType:
|
|||||||
self.doc.employee = self.doc.name
|
self.doc.employee = self.doc.name
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
import utilities
|
from erpnext.utilities import validate_status
|
||||||
utilities.validate_status(self.doc.status, ["Active", "Left"])
|
validate_status(self.doc.status, ["Active", "Left"])
|
||||||
|
|
||||||
self.doc.employee = self.doc.name
|
self.doc.employee = self.doc.name
|
||||||
self.validate_date()
|
self.validate_date()
|
||||||
@ -143,7 +143,7 @@ class DocType:
|
|||||||
|
|
||||||
def validate_employee_leave_approver(self):
|
def validate_employee_leave_approver(self):
|
||||||
from webnotes.profile import Profile
|
from webnotes.profile import Profile
|
||||||
from hr.doctype.leave_application.leave_application import InvalidLeaveApproverError
|
from erpnext.hr.doctype.leave_application.leave_application import InvalidLeaveApproverError
|
||||||
|
|
||||||
for l in self.doclist.get({"parentfield": "employee_leave_approvers"}):
|
for l in self.doclist.get({"parentfield": "employee_leave_approvers"}):
|
||||||
if "Leave Approver" not in Profile(l.leave_approver).get_roles():
|
if "Leave Approver" not in Profile(l.leave_approver).get_roles():
|
||||||
|
@ -7,7 +7,7 @@ erpnext.hr.ExpenseClaimController = wn.ui.form.Controller.extend({
|
|||||||
make_bank_voucher: function() {
|
make_bank_voucher: function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
return wn.call({
|
return wn.call({
|
||||||
method: "accounts.doctype.journal_voucher.journal_voucher.get_default_bank_cash_account",
|
method: "erpnext.accounts.doctype.journal_voucher.journal_voucher.get_default_bank_cash_account",
|
||||||
args: {
|
args: {
|
||||||
"company": cur_frm.doc.company,
|
"company": cur_frm.doc.company,
|
||||||
"voucher_type": "Bank Voucher"
|
"voucher_type": "Bank Voucher"
|
||||||
@ -60,7 +60,7 @@ cur_frm.cscript.onload = function(doc,cdt,cdn) {
|
|||||||
}
|
}
|
||||||
var exp_approver = doc.exp_approver;
|
var exp_approver = doc.exp_approver;
|
||||||
return cur_frm.call({
|
return cur_frm.call({
|
||||||
method:"hr.utils.get_expense_approver_list",
|
method: "erpnext.hr.utils.get_expense_approver_list",
|
||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
cur_frm.set_df_property("exp_approver", "options", r.message);
|
cur_frm.set_df_property("exp_approver", "options", r.message);
|
||||||
if(exp_approver) cur_frm.set_value("exp_approver", exp_approver);
|
if(exp_approver) cur_frm.set_value("exp_approver", exp_approver);
|
||||||
|
@ -22,7 +22,7 @@ class DocType:
|
|||||||
'Rejected' before submitting""", raise_exception=1)
|
'Rejected' before submitting""", raise_exception=1)
|
||||||
|
|
||||||
def validate_fiscal_year(self):
|
def validate_fiscal_year(self):
|
||||||
from accounts.utils import validate_fiscal_year
|
from erpnext.accounts.utils import validate_fiscal_year
|
||||||
validate_fiscal_year(self.doc.posting_date, self.doc.fiscal_year, "Posting Date")
|
validate_fiscal_year(self.doc.posting_date, self.doc.fiscal_year, "Posting Date")
|
||||||
|
|
||||||
def validate_exp_details(self):
|
def validate_exp_details(self):
|
||||||
|
@ -15,7 +15,7 @@ class DocType:
|
|||||||
def validate(self):
|
def validate(self):
|
||||||
self.update_birthday_reminders()
|
self.update_birthday_reminders()
|
||||||
|
|
||||||
from setup.doctype.naming_series.naming_series import set_by_naming_series
|
from erpnext.setup.doctype.naming_series.naming_series import set_by_naming_series
|
||||||
set_by_naming_series("Employee", "employee_number",
|
set_by_naming_series("Employee", "employee_number",
|
||||||
self.doc.get("emp_created_by")=="Naming Series", hide_name_field=True)
|
self.doc.get("emp_created_by")=="Naming Series", hide_name_field=True)
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import webnotes
|
import webnotes
|
||||||
from utilities.transaction_base import TransactionBase
|
from erpnext.utilities.transaction_base import TransactionBase
|
||||||
from webnotes.utils import extract_email_id
|
from webnotes.utils import extract_email_id
|
||||||
|
|
||||||
class DocType(TransactionBase):
|
class DocType(TransactionBase):
|
||||||
|
@ -13,7 +13,7 @@ cur_frm.cscript.onload = function(doc, dt, dn) {
|
|||||||
|
|
||||||
var leave_approver = doc.leave_approver;
|
var leave_approver = doc.leave_approver;
|
||||||
return cur_frm.call({
|
return cur_frm.call({
|
||||||
method:"hr.utils.get_leave_approver_list",
|
method: "erpnext.hr.utils.get_leave_approver_list",
|
||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
cur_frm.set_df_property("leave_approver", "options", $.map(r.message,
|
cur_frm.set_df_property("leave_approver", "options", $.map(r.message,
|
||||||
function(profile) {
|
function(profile) {
|
||||||
|
@ -53,7 +53,7 @@ class DocType(DocListController):
|
|||||||
self.notify_employee("cancelled")
|
self.notify_employee("cancelled")
|
||||||
|
|
||||||
def show_block_day_warning(self):
|
def show_block_day_warning(self):
|
||||||
from hr.doctype.leave_block_list.leave_block_list import get_applicable_block_dates
|
from erpnext.hr.doctype.leave_block_list.leave_block_list import get_applicable_block_dates
|
||||||
|
|
||||||
block_dates = get_applicable_block_dates(self.doc.from_date, self.doc.to_date,
|
block_dates = get_applicable_block_dates(self.doc.from_date, self.doc.to_date,
|
||||||
self.doc.employee, self.doc.company, all_lists=True)
|
self.doc.employee, self.doc.company, all_lists=True)
|
||||||
@ -64,7 +64,7 @@ class DocType(DocListController):
|
|||||||
webnotes.msgprint(formatdate(d.block_date) + ": " + d.reason)
|
webnotes.msgprint(formatdate(d.block_date) + ": " + d.reason)
|
||||||
|
|
||||||
def validate_block_days(self):
|
def validate_block_days(self):
|
||||||
from hr.doctype.leave_block_list.leave_block_list import get_applicable_block_dates
|
from erpnext.hr.doctype.leave_block_list.leave_block_list import get_applicable_block_dates
|
||||||
|
|
||||||
block_dates = get_applicable_block_dates(self.doc.from_date, self.doc.to_date,
|
block_dates = get_applicable_block_dates(self.doc.from_date, self.doc.to_date,
|
||||||
self.doc.employee, self.doc.company)
|
self.doc.employee, self.doc.company)
|
||||||
@ -290,7 +290,7 @@ def add_leaves(events, start, end, employee, company, match_conditions=None):
|
|||||||
|
|
||||||
def add_block_dates(events, start, end, employee, company):
|
def add_block_dates(events, start, end, employee, company):
|
||||||
# block days
|
# block days
|
||||||
from hr.doctype.leave_block_list.leave_block_list import get_applicable_block_dates
|
from erpnext.hr.doctype.leave_block_list.leave_block_list import get_applicable_block_dates
|
||||||
|
|
||||||
cnt = 0
|
cnt = 0
|
||||||
block_dates = get_applicable_block_dates(start, end, employee, company, all_lists=True)
|
block_dates = get_applicable_block_dates(start, end, employee, company, all_lists=True)
|
||||||
|
@ -16,5 +16,5 @@ wn.views.calendar["Leave Application"] = {
|
|||||||
right: 'month'
|
right: 'month'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
get_events_method: "hr.doctype.leave_application.leave_application.get_events"
|
get_events_method: "erpnext.hr.doctype.leave_application.leave_application.get_events"
|
||||||
}
|
}
|
@ -4,7 +4,7 @@
|
|||||||
import webnotes
|
import webnotes
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from hr.doctype.leave_application.leave_application import LeaveDayBlockedError, OverlapError
|
from erpnext.hr.doctype.leave_application.leave_application import LeaveDayBlockedError, OverlapError
|
||||||
|
|
||||||
class TestLeaveApplication(unittest.TestCase):
|
class TestLeaveApplication(unittest.TestCase):
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
@ -129,7 +129,7 @@ class TestLeaveApplication(unittest.TestCase):
|
|||||||
"docstatus"), 1)
|
"docstatus"), 1)
|
||||||
|
|
||||||
def _test_leave_approval_invalid_leave_approver_insert(self):
|
def _test_leave_approval_invalid_leave_approver_insert(self):
|
||||||
from hr.doctype.leave_application.leave_application import InvalidLeaveApproverError
|
from erpnext.hr.doctype.leave_application.leave_application import InvalidLeaveApproverError
|
||||||
|
|
||||||
self._clear_applications()
|
self._clear_applications()
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import webnotes
|
import webnotes
|
||||||
from accounts.utils import validate_fiscal_year
|
from erpnext.accounts.utils import validate_fiscal_year
|
||||||
from webnotes import _
|
from webnotes import _
|
||||||
|
|
||||||
class DocType:
|
class DocType:
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
import webnotes
|
import webnotes
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from hr.doctype.leave_block_list.leave_block_list import get_applicable_block_dates
|
from erpnext.hr.doctype.leave_block_list.leave_block_list import get_applicable_block_dates
|
||||||
|
|
||||||
class TestLeaveBlockList(unittest.TestCase):
|
class TestLeaveBlockList(unittest.TestCase):
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
|
@ -9,10 +9,10 @@ from webnotes.model.doc import make_autoname
|
|||||||
from webnotes.model.bean import getlist
|
from webnotes.model.bean import getlist
|
||||||
from webnotes.model.code import get_obj
|
from webnotes.model.code import get_obj
|
||||||
from webnotes import msgprint, _
|
from webnotes import msgprint, _
|
||||||
from setup.utils import get_company_currency
|
from erpnext.setup.utils import get_company_currency
|
||||||
|
|
||||||
|
|
||||||
from utilities.transaction_base import TransactionBase
|
from erpnext.utilities.transaction_base import TransactionBase
|
||||||
|
|
||||||
class DocType(TransactionBase):
|
class DocType(TransactionBase):
|
||||||
def __init__(self,doc,doclist=[]):
|
def __init__(self,doc,doclist=[]):
|
||||||
@ -39,7 +39,7 @@ class DocType(TransactionBase):
|
|||||||
|
|
||||||
|
|
||||||
def pull_sal_struct(self, struct):
|
def pull_sal_struct(self, struct):
|
||||||
from hr.doctype.salary_structure.salary_structure import make_salary_slip
|
from erpnext.hr.doctype.salary_structure.salary_structure import make_salary_slip
|
||||||
self.doclist = make_salary_slip(struct, self.doclist)
|
self.doclist = make_salary_slip(struct, self.doclist)
|
||||||
|
|
||||||
def pull_emp_details(self):
|
def pull_emp_details(self):
|
||||||
|
@ -8,7 +8,7 @@ class TestSalarySlip(unittest.TestCase):
|
|||||||
def setUp(self):
|
def setUp(self):
|
||||||
webnotes.conn.sql("""delete from `tabLeave Application`""")
|
webnotes.conn.sql("""delete from `tabLeave Application`""")
|
||||||
webnotes.conn.sql("""delete from `tabSalary Slip`""")
|
webnotes.conn.sql("""delete from `tabSalary Slip`""")
|
||||||
from hr.doctype.leave_application.test_leave_application import test_records as leave_applications
|
from erpnext.hr.doctype.leave_application.test_leave_application import test_records as leave_applications
|
||||||
la = webnotes.bean(copy=leave_applications[4])
|
la = webnotes.bean(copy=leave_applications[4])
|
||||||
la.insert()
|
la.insert()
|
||||||
la.doc.status = "Approved"
|
la.doc.status = "Approved"
|
||||||
|
@ -20,7 +20,7 @@ cur_frm.cscript.refresh = function(doc, dt, dn){
|
|||||||
|
|
||||||
cur_frm.cscript['Make Salary Slip'] = function() {
|
cur_frm.cscript['Make Salary Slip'] = function() {
|
||||||
wn.model.open_mapped_doc({
|
wn.model.open_mapped_doc({
|
||||||
method: "hr.doctype.salary_structure.salary_structure.make_salary_slip",
|
method: "erpnext.hr.doctype.salary_structure.salary_structure.make_salary_slip",
|
||||||
source_name: cur_frm.doc.name
|
source_name: cur_frm.doc.name
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ erpnext.hr.AttendanceControlPanel = wn.ui.form.Controller.extend({
|
|||||||
}
|
}
|
||||||
window.location.href = repl(wn.request.url +
|
window.location.href = repl(wn.request.url +
|
||||||
'?cmd=%(cmd)s&from_date=%(from_date)s&to_date=%(to_date)s', {
|
'?cmd=%(cmd)s&from_date=%(from_date)s&to_date=%(to_date)s', {
|
||||||
cmd: "hr.doctype.upload_attendance.upload_attendance.get_template",
|
cmd: "erpnext.hr.doctype.upload_attendance.upload_attendance.get_template",
|
||||||
from_date: this.frm.doc.att_fr_date,
|
from_date: this.frm.doc.att_fr_date,
|
||||||
to_date: this.frm.doc.att_to_date,
|
to_date: this.frm.doc.att_to_date,
|
||||||
});
|
});
|
||||||
@ -36,7 +36,7 @@ erpnext.hr.AttendanceControlPanel = wn.ui.form.Controller.extend({
|
|||||||
wn.upload.make({
|
wn.upload.make({
|
||||||
parent: $wrapper,
|
parent: $wrapper,
|
||||||
args: {
|
args: {
|
||||||
method: 'hr.doctype.upload_attendance.upload_attendance.upload'
|
method: 'erpnext.hr.doctype.upload_attendance.upload_attendance.upload'
|
||||||
},
|
},
|
||||||
sample_url: "e.g. http://example.com/somefile.csv",
|
sample_url: "e.g. http://example.com/somefile.csv",
|
||||||
callback: function(fid, filename, r) {
|
callback: function(fid, filename, r) {
|
||||||
|
@ -51,7 +51,7 @@ def add_header(w):
|
|||||||
return w
|
return w
|
||||||
|
|
||||||
def add_data(w, args):
|
def add_data(w, args):
|
||||||
from accounts.utils import get_fiscal_year
|
from erpnext.accounts.utils import get_fiscal_year
|
||||||
|
|
||||||
dates = get_dates(args)
|
dates = get_dates(args)
|
||||||
employees = get_active_employees()
|
employees = get_active_employees()
|
||||||
|
@ -5,41 +5,23 @@ from __future__ import unicode_literals
|
|||||||
|
|
||||||
import webnotes
|
import webnotes
|
||||||
|
|
||||||
def post_import():
|
def get_hooks():
|
||||||
webnotes.conn.begin()
|
return {
|
||||||
|
"app_include_js": ["assets/js/erpnext.min.js"],
|
||||||
|
"app_include_css": ["assets/css/erpnext.css"],
|
||||||
|
"desktop_icons": get_desktop_icons(),
|
||||||
|
"boot_session": ["erpnext.startup.boot.boot_session"]
|
||||||
|
}
|
||||||
|
|
||||||
# feature setup
|
def after_install():
|
||||||
import_defaults()
|
import_defaults()
|
||||||
import_country_and_currency()
|
import_country_and_currency()
|
||||||
|
|
||||||
# home page
|
|
||||||
webnotes.conn.set_value('Control Panel', None, 'home_page', 'setup-wizard')
|
webnotes.conn.set_value('Control Panel', None, 'home_page', 'setup-wizard')
|
||||||
|
|
||||||
# features
|
|
||||||
feature_setup()
|
feature_setup()
|
||||||
|
from erpnext.setup.page.setup_wizard.setup_wizard import add_all_roles_to
|
||||||
# all roles to Administrator
|
|
||||||
from setup.page.setup_wizard.setup_wizard import add_all_roles_to
|
|
||||||
add_all_roles_to("Administrator")
|
add_all_roles_to("Administrator")
|
||||||
|
|
||||||
webnotes.conn.commit()
|
webnotes.conn.commit()
|
||||||
|
|
||||||
def feature_setup():
|
|
||||||
"""save global defaults and features setup"""
|
|
||||||
bean = webnotes.bean("Features Setup", "Features Setup")
|
|
||||||
bean.ignore_permissions = True
|
|
||||||
|
|
||||||
# store value as 1 for all these fields
|
|
||||||
flds = ['fs_item_serial_nos', 'fs_item_batch_nos', 'fs_brands', 'fs_item_barcode',
|
|
||||||
'fs_item_advanced', 'fs_packing_details', 'fs_item_group_in_details',
|
|
||||||
'fs_exports', 'fs_imports', 'fs_discounts', 'fs_purchase_discounts',
|
|
||||||
'fs_after_sales_installations', 'fs_projects', 'fs_sales_extras',
|
|
||||||
'fs_recurring_invoice', 'fs_pos', 'fs_manufacturing', 'fs_quality',
|
|
||||||
'fs_page_break', 'fs_more_info', 'fs_pos_view'
|
|
||||||
]
|
|
||||||
bean.doc.fields.update(dict(zip(flds, [1]*len(flds))))
|
|
||||||
bean.save()
|
|
||||||
|
|
||||||
def import_country_and_currency():
|
def import_country_and_currency():
|
||||||
from webnotes.country_info import get_all
|
from webnotes.country_info import get_all
|
||||||
data = get_all()
|
data = get_all()
|
||||||
@ -138,4 +120,94 @@ def import_defaults():
|
|||||||
if parent_link_field in bean.doc.fields and not bean.doc.fields.get(parent_link_field):
|
if parent_link_field in bean.doc.fields and not bean.doc.fields.get(parent_link_field):
|
||||||
bean.ignore_mandatory = True
|
bean.ignore_mandatory = True
|
||||||
|
|
||||||
bean.insert()
|
bean.insert()
|
||||||
|
|
||||||
|
def feature_setup():
|
||||||
|
"""save global defaults and features setup"""
|
||||||
|
bean = webnotes.bean("Features Setup", "Features Setup")
|
||||||
|
bean.ignore_permissions = True
|
||||||
|
|
||||||
|
# store value as 1 for all these fields
|
||||||
|
flds = ['fs_item_serial_nos', 'fs_item_batch_nos', 'fs_brands', 'fs_item_barcode',
|
||||||
|
'fs_item_advanced', 'fs_packing_details', 'fs_item_group_in_details',
|
||||||
|
'fs_exports', 'fs_imports', 'fs_discounts', 'fs_purchase_discounts',
|
||||||
|
'fs_after_sales_installations', 'fs_projects', 'fs_sales_extras',
|
||||||
|
'fs_recurring_invoice', 'fs_pos', 'fs_manufacturing', 'fs_quality',
|
||||||
|
'fs_page_break', 'fs_more_info', 'fs_pos_view'
|
||||||
|
]
|
||||||
|
bean.doc.fields.update(dict(zip(flds, [1]*len(flds))))
|
||||||
|
bean.save()
|
||||||
|
|
||||||
|
def get_desktop_icons():
|
||||||
|
return {
|
||||||
|
"Accounts": {
|
||||||
|
"color": "#3498db",
|
||||||
|
"icon": "icon-money",
|
||||||
|
"link": "accounts-home",
|
||||||
|
"type": "module"
|
||||||
|
},
|
||||||
|
"Activity": {
|
||||||
|
"color": "#e67e22",
|
||||||
|
"icon": "icon-play",
|
||||||
|
"label": "Activity",
|
||||||
|
"link": "activity",
|
||||||
|
"type": "page"
|
||||||
|
},
|
||||||
|
"Buying": {
|
||||||
|
"color": "#c0392b",
|
||||||
|
"icon": "icon-shopping-cart",
|
||||||
|
"link": "buying-home",
|
||||||
|
"type": "module"
|
||||||
|
},
|
||||||
|
"HR": {
|
||||||
|
"color": "#2ecc71",
|
||||||
|
"icon": "icon-group",
|
||||||
|
"label": "Human Resources",
|
||||||
|
"link": "hr-home",
|
||||||
|
"type": "module"
|
||||||
|
},
|
||||||
|
"Manufacturing": {
|
||||||
|
"color": "#7f8c8d",
|
||||||
|
"icon": "icon-cogs",
|
||||||
|
"link": "manufacturing-home",
|
||||||
|
"type": "module"
|
||||||
|
},
|
||||||
|
"Notes": {
|
||||||
|
"color": "#95a5a6",
|
||||||
|
"doctype": "Note",
|
||||||
|
"icon": "icon-file-alt",
|
||||||
|
"label": "Notes",
|
||||||
|
"link": "List/Note",
|
||||||
|
"type": "list"
|
||||||
|
},
|
||||||
|
"Projects": {
|
||||||
|
"color": "#8e44ad",
|
||||||
|
"icon": "icon-puzzle-piece",
|
||||||
|
"link": "projects-home",
|
||||||
|
"type": "module"
|
||||||
|
},
|
||||||
|
"Selling": {
|
||||||
|
"color": "#1abc9c",
|
||||||
|
"icon": "icon-tag",
|
||||||
|
"link": "selling-home",
|
||||||
|
"type": "module"
|
||||||
|
},
|
||||||
|
"Setup": {
|
||||||
|
"color": "#bdc3c7",
|
||||||
|
"icon": "icon-wrench",
|
||||||
|
"link": "Setup",
|
||||||
|
"type": "setup"
|
||||||
|
},
|
||||||
|
"Stock": {
|
||||||
|
"color": "#f39c12",
|
||||||
|
"icon": "icon-truck",
|
||||||
|
"link": "stock-home",
|
||||||
|
"type": "module"
|
||||||
|
},
|
||||||
|
"Support": {
|
||||||
|
"color": "#2c3e50",
|
||||||
|
"icon": "icon-phone",
|
||||||
|
"link": "support-home",
|
||||||
|
"type": "module"
|
||||||
|
}
|
||||||
|
}
|
@ -30,7 +30,7 @@ class DocType:
|
|||||||
self.clear_operations()
|
self.clear_operations()
|
||||||
self.validate_main_item()
|
self.validate_main_item()
|
||||||
|
|
||||||
from utilities.transaction_base import validate_uom_is_integer
|
from erpnext.utilities.transaction_base import validate_uom_is_integer
|
||||||
validate_uom_is_integer(self.doclist, "stock_uom", "qty")
|
validate_uom_is_integer(self.doclist, "stock_uom", "qty")
|
||||||
|
|
||||||
self.validate_operations()
|
self.validate_operations()
|
||||||
@ -152,7 +152,7 @@ class DocType:
|
|||||||
as per valuation method (MAR/FIFO)
|
as per valuation method (MAR/FIFO)
|
||||||
as on costing date
|
as on costing date
|
||||||
"""
|
"""
|
||||||
from stock.utils import get_incoming_rate
|
from erpnext.stock.utils import get_incoming_rate
|
||||||
dt = self.doc.costing_date or nowdate()
|
dt = self.doc.costing_date or nowdate()
|
||||||
time = self.doc.costing_date == nowdate() and now().split()[1] or '23:59'
|
time = self.doc.costing_date == nowdate() and now().split()[1] or '23:59'
|
||||||
warehouse = webnotes.conn.sql("select warehouse from `tabBin` where item_code = %s", args['item_code'])
|
warehouse = webnotes.conn.sql("select warehouse from `tabBin` where item_code = %s", args['item_code'])
|
||||||
|
@ -98,14 +98,14 @@ test_records = [
|
|||||||
|
|
||||||
class TestBOM(unittest.TestCase):
|
class TestBOM(unittest.TestCase):
|
||||||
def test_get_items(self):
|
def test_get_items(self):
|
||||||
from manufacturing.doctype.bom.bom import get_bom_items_as_dict
|
from erpnext.manufacturing.doctype.bom.bom import get_bom_items_as_dict
|
||||||
items_dict = get_bom_items_as_dict(bom="BOM/_Test FG Item 2/001", qty=1, fetch_exploded=0)
|
items_dict = get_bom_items_as_dict(bom="BOM/_Test FG Item 2/001", qty=1, fetch_exploded=0)
|
||||||
self.assertTrue(test_records[2][1]["item_code"] in items_dict)
|
self.assertTrue(test_records[2][1]["item_code"] in items_dict)
|
||||||
self.assertTrue(test_records[2][2]["item_code"] in items_dict)
|
self.assertTrue(test_records[2][2]["item_code"] in items_dict)
|
||||||
self.assertEquals(len(items_dict.values()), 2)
|
self.assertEquals(len(items_dict.values()), 2)
|
||||||
|
|
||||||
def test_get_items_exploded(self):
|
def test_get_items_exploded(self):
|
||||||
from manufacturing.doctype.bom.bom import get_bom_items_as_dict
|
from erpnext.manufacturing.doctype.bom.bom import get_bom_items_as_dict
|
||||||
items_dict = get_bom_items_as_dict(bom="BOM/_Test FG Item 2/001", qty=1, fetch_exploded=1)
|
items_dict = get_bom_items_as_dict(bom="BOM/_Test FG Item 2/001", qty=1, fetch_exploded=1)
|
||||||
self.assertTrue(test_records[2][1]["item_code"] in items_dict)
|
self.assertTrue(test_records[2][1]["item_code"] in items_dict)
|
||||||
self.assertFalse(test_records[2][2]["item_code"] in items_dict)
|
self.assertFalse(test_records[2][2]["item_code"] in items_dict)
|
||||||
@ -114,6 +114,6 @@ class TestBOM(unittest.TestCase):
|
|||||||
self.assertEquals(len(items_dict.values()), 3)
|
self.assertEquals(len(items_dict.values()), 3)
|
||||||
|
|
||||||
def test_get_items_list(self):
|
def test_get_items_list(self):
|
||||||
from manufacturing.doctype.bom.bom import get_bom_items
|
from erpnext.manufacturing.doctype.bom.bom import get_bom_items
|
||||||
self.assertEquals(len(get_bom_items(bom="BOM/_Test FG Item 2/001", qty=1, fetch_exploded=1)), 3)
|
self.assertEquals(len(get_bom_items(bom="BOM/_Test FG Item 2/001", qty=1, fetch_exploded=1)), 3)
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ cur_frm.cscript['Update Finished Goods'] = function() {
|
|||||||
|
|
||||||
cur_frm.cscript.make_se = function(purpose) {
|
cur_frm.cscript.make_se = function(purpose) {
|
||||||
wn.call({
|
wn.call({
|
||||||
method:"manufacturing.doctype.production_order.production_order.make_stock_entry",
|
method: "erpnext.manufacturing.doctype.production_order.production_order.make_stock_entry",
|
||||||
args: {
|
args: {
|
||||||
"production_order_id": cur_frm.doc.name,
|
"production_order_id": cur_frm.doc.name,
|
||||||
"purpose": purpose
|
"purpose": purpose
|
||||||
|
@ -20,15 +20,15 @@ class DocType:
|
|||||||
if self.doc.docstatus == 0:
|
if self.doc.docstatus == 0:
|
||||||
self.doc.status = "Draft"
|
self.doc.status = "Draft"
|
||||||
|
|
||||||
import utilities
|
from erpnext.utilities import validate_status
|
||||||
utilities.validate_status(self.doc.status, ["Draft", "Submitted", "Stopped",
|
validate_status(self.doc.status, ["Draft", "Submitted", "Stopped",
|
||||||
"In Process", "Completed", "Cancelled"])
|
"In Process", "Completed", "Cancelled"])
|
||||||
|
|
||||||
self.validate_bom_no()
|
self.validate_bom_no()
|
||||||
self.validate_sales_order()
|
self.validate_sales_order()
|
||||||
self.validate_warehouse()
|
self.validate_warehouse()
|
||||||
|
|
||||||
from utilities.transaction_base import validate_uom_is_integer
|
from erpnext.utilities.transaction_base import validate_uom_is_integer
|
||||||
validate_uom_is_integer(self.doclist, "stock_uom", ["qty", "produced_qty"])
|
validate_uom_is_integer(self.doclist, "stock_uom", ["qty", "produced_qty"])
|
||||||
|
|
||||||
def validate_bom_no(self):
|
def validate_bom_no(self):
|
||||||
@ -50,7 +50,7 @@ class DocType:
|
|||||||
self.validate_production_order_against_so()
|
self.validate_production_order_against_so()
|
||||||
|
|
||||||
def validate_warehouse(self):
|
def validate_warehouse(self):
|
||||||
from stock.utils import validate_warehouse_user, validate_warehouse_company
|
from erpnext.stock.utils import validate_warehouse_user, validate_warehouse_company
|
||||||
|
|
||||||
for w in [self.doc.fg_warehouse, self.doc.wip_warehouse]:
|
for w in [self.doc.fg_warehouse, self.doc.wip_warehouse]:
|
||||||
validate_warehouse_user(w)
|
validate_warehouse_user(w)
|
||||||
@ -128,7 +128,7 @@ class DocType:
|
|||||||
"posting_date": nowdate(),
|
"posting_date": nowdate(),
|
||||||
"planned_qty": flt(qty)
|
"planned_qty": flt(qty)
|
||||||
}
|
}
|
||||||
from stock.utils import update_bin
|
from erpnext.stock.utils import update_bin
|
||||||
update_bin(args)
|
update_bin(args)
|
||||||
|
|
||||||
@webnotes.whitelist()
|
@webnotes.whitelist()
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import unittest
|
import unittest
|
||||||
import webnotes
|
import webnotes
|
||||||
from stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory
|
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory
|
||||||
from manufacturing.doctype.production_order.production_order import make_stock_entry
|
from erpnext.manufacturing.doctype.production_order.production_order import make_stock_entry
|
||||||
|
|
||||||
|
|
||||||
class TestProductionOrder(unittest.TestCase):
|
class TestProductionOrder(unittest.TestCase):
|
||||||
@ -20,7 +20,7 @@ class TestProductionOrder(unittest.TestCase):
|
|||||||
pro_bean.insert()
|
pro_bean.insert()
|
||||||
pro_bean.submit()
|
pro_bean.submit()
|
||||||
|
|
||||||
from stock.doctype.stock_entry.test_stock_entry import test_records as se_test_records
|
from erpnext.stock.doctype.stock_entry.test_stock_entry import test_records as se_test_records
|
||||||
mr1 = webnotes.bean(copy = se_test_records[0])
|
mr1 = webnotes.bean(copy = se_test_records[0])
|
||||||
mr1.insert()
|
mr1.insert()
|
||||||
mr1.submit()
|
mr1.submit()
|
||||||
@ -45,7 +45,7 @@ class TestProductionOrder(unittest.TestCase):
|
|||||||
return pro_bean.doc.name
|
return pro_bean.doc.name
|
||||||
|
|
||||||
def test_over_production(self):
|
def test_over_production(self):
|
||||||
from stock.doctype.stock_entry.stock_entry import StockOverProductionError
|
from erpnext.stock.doctype.stock_entry.stock_entry import StockOverProductionError
|
||||||
pro_order = self.test_planned_qty()
|
pro_order = self.test_planned_qty()
|
||||||
|
|
||||||
stock_entry = make_stock_entry(pro_order, "Manufacture/Repack")
|
stock_entry = make_stock_entry(pro_order, "Manufacture/Repack")
|
||||||
|
@ -173,7 +173,7 @@ class DocType:
|
|||||||
"""It will raise production order (Draft) for all distinct FG items"""
|
"""It will raise production order (Draft) for all distinct FG items"""
|
||||||
self.validate_data()
|
self.validate_data()
|
||||||
|
|
||||||
from utilities.transaction_base import validate_uom_is_integer
|
from erpnext.utilities.transaction_base import validate_uom_is_integer
|
||||||
validate_uom_is_integer(self.doclist, "stock_uom", "planned_qty")
|
validate_uom_is_integer(self.doclist, "stock_uom", "planned_qty")
|
||||||
|
|
||||||
items = self.get_distinct_items_and_boms()[1]
|
items = self.get_distinct_items_and_boms()[1]
|
||||||
@ -208,7 +208,7 @@ class DocType:
|
|||||||
|
|
||||||
def create_production_order(self, items):
|
def create_production_order(self, items):
|
||||||
"""Create production order. Called from Production Planning Tool"""
|
"""Create production order. Called from Production Planning Tool"""
|
||||||
from manufacturing.doctype.production_order.production_order import OverProductionError
|
from erpnext.manufacturing.doctype.production_order.production_order import OverProductionError
|
||||||
|
|
||||||
pro_list = []
|
pro_list = []
|
||||||
for key in items:
|
for key in items:
|
||||||
@ -302,7 +302,7 @@ class DocType:
|
|||||||
|
|
||||||
item_projected_qty = self.get_projected_qty()
|
item_projected_qty = self.get_projected_qty()
|
||||||
|
|
||||||
from accounts.utils import get_fiscal_year
|
from erpnext.accounts.utils import get_fiscal_year
|
||||||
fiscal_year = get_fiscal_year(nowdate())[0]
|
fiscal_year = get_fiscal_year(nowdate())[0]
|
||||||
|
|
||||||
items_to_be_requested = webnotes._dict()
|
items_to_be_requested = webnotes._dict()
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
import webnotes
|
import webnotes
|
||||||
from webnotes.utils import cstr
|
from webnotes.utils import cstr
|
||||||
from stock.stock_ledger import update_entries_after
|
from erpnext.stock.stock_ledger import update_entries_after
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
webnotes.conn.auto_commit_on_many_writes = 1
|
webnotes.conn.auto_commit_on_many_writes = 1
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
import webnotes
|
import webnotes
|
||||||
from utilities.repost_stock import get_ordered_qty, update_bin
|
from erpnext.utilities.repost_stock import get_ordered_qty, update_bin
|
||||||
|
|
||||||
for d in webnotes.conn.sql("select item_code, warehouse from tabBin"):
|
for d in webnotes.conn.sql("select item_code, warehouse from tabBin"):
|
||||||
update_bin(d[0], d[1], {
|
update_bin(d[0], d[1], {
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
import webnotes
|
import webnotes
|
||||||
def execute():
|
def execute():
|
||||||
webnotes.conn.auto_commit_on_many_writes = 1
|
webnotes.conn.auto_commit_on_many_writes = 1
|
||||||
from utilities.repost_stock import get_reserved_qty, update_bin
|
from erpnext.utilities.repost_stock import get_reserved_qty, update_bin
|
||||||
|
|
||||||
for d in webnotes.conn.sql("select item_code, warehouse from tabBin"):
|
for d in webnotes.conn.sql("select item_code, warehouse from tabBin"):
|
||||||
update_bin(d[0], d[1], {
|
update_bin(d[0], d[1], {
|
||||||
|
@ -2,5 +2,5 @@
|
|||||||
# License: GNU General Public License v3. See license.txt
|
# License: GNU General Public License v3. See license.txt
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
from startup.install import import_defaults
|
from erpnext.startup.install import import_defaults
|
||||||
import_defaults()
|
import_defaults()
|
@ -4,7 +4,7 @@
|
|||||||
import webnotes
|
import webnotes
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
from utilities.transaction_base import delete_events
|
from erpnext.utilities.transaction_base import delete_events
|
||||||
|
|
||||||
# delete orphaned Event User
|
# delete orphaned Event User
|
||||||
webnotes.conn.sql("""delete from `tabEvent User`
|
webnotes.conn.sql("""delete from `tabEvent User`
|
||||||
|
@ -9,7 +9,7 @@ def execute():
|
|||||||
webnotes.reload_doc("accounts", "doctype", "sales_taxes_and_charges_master")
|
webnotes.reload_doc("accounts", "doctype", "sales_taxes_and_charges_master")
|
||||||
webnotes.reload_doc("accounts", "doctype", "shipping_rule")
|
webnotes.reload_doc("accounts", "doctype", "shipping_rule")
|
||||||
|
|
||||||
from setup.utils import get_root_of
|
from erpnext.setup.utils import get_root_of
|
||||||
root_territory = get_root_of("Territory")
|
root_territory = get_root_of("Territory")
|
||||||
|
|
||||||
for parenttype in ["Sales Taxes and Charges Master", "Price List", "Shipping Rule"]:
|
for parenttype in ["Sales Taxes and Charges Master", "Price List", "Shipping Rule"]:
|
||||||
|
@ -7,7 +7,7 @@ def execute():
|
|||||||
webnotes.reload_doc("selling", "doctype", "shopping_cart_settings")
|
webnotes.reload_doc("selling", "doctype", "shopping_cart_settings")
|
||||||
|
|
||||||
# create two default territories, one for home country and one named Rest of the World
|
# create two default territories, one for home country and one named Rest of the World
|
||||||
from setup.page.setup_wizard.setup_wizard import create_territories
|
from erpnext.setup.page.setup_wizard.setup_wizard import create_territories
|
||||||
create_territories()
|
create_territories()
|
||||||
|
|
||||||
webnotes.conn.set_value("Shopping Cart Settings", None, "default_territory", "Rest of the World")
|
webnotes.conn.set_value("Shopping Cart Settings", None, "default_territory", "Rest of the World")
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
# License: GNU General Public License v3. See license.txt
|
# License: GNU General Public License v3. See license.txt
|
||||||
|
|
||||||
import webnotes
|
import webnotes
|
||||||
from accounts.utils import get_fiscal_year, FiscalYearError
|
from erpnext.accounts.utils import get_fiscal_year, FiscalYearError
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
webnotes.reload_doc("stock", "doctype", "stock_entry")
|
webnotes.reload_doc("stock", "doctype", "stock_entry")
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import webnotes
|
import webnotes
|
||||||
def execute():
|
def execute():
|
||||||
from stock.stock_ledger import update_entries_after
|
from erpnext.stock.stock_ledger import update_entries_after
|
||||||
item_warehouse = []
|
item_warehouse = []
|
||||||
# update valuation_rate in transaction
|
# update valuation_rate in transaction
|
||||||
doctypes = {"Purchase Receipt": "purchase_receipt_details", "Purchase Invoice": "entries"}
|
doctypes = {"Purchase Receipt": "purchase_receipt_details", "Purchase Invoice": "entries"}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
def execute():
|
def execute():
|
||||||
import webnotes
|
import webnotes
|
||||||
from stock.stock_ledger import update_entries_after
|
from erpnext.stock.stock_ledger import update_entries_after
|
||||||
|
|
||||||
res = webnotes.conn.sql("""select distinct item_code, warehouse from `tabStock Ledger Entry`
|
res = webnotes.conn.sql("""select distinct item_code, warehouse from `tabStock Ledger Entry`
|
||||||
where posting_time = '00:00'""")
|
where posting_time = '00:00'""")
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import webnotes
|
import webnotes
|
||||||
from webnotes.utils import nowdate, nowtime, cstr
|
from webnotes.utils import nowdate, nowtime, cstr
|
||||||
from accounts.utils import get_fiscal_year
|
from erpnext.accounts.utils import get_fiscal_year
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
item_map = {}
|
item_map = {}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
import webnotes
|
import webnotes
|
||||||
from utilities.repost_stock import get_planned_qty, update_bin
|
from erpnext.utilities.repost_stock import get_planned_qty, update_bin
|
||||||
|
|
||||||
for d in webnotes.conn.sql("select item_code, warehouse from tabBin"):
|
for d in webnotes.conn.sql("select item_code, warehouse from tabBin"):
|
||||||
update_bin(d[0], d[1], {
|
update_bin(d[0], d[1], {
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
def execute():
|
def execute():
|
||||||
import webnotes
|
import webnotes
|
||||||
from stock.stock_ledger import update_entries_after
|
from erpnext.stock.stock_ledger import update_entries_after
|
||||||
res = webnotes.conn.sql("select distinct item_code, warehouse from `tabStock Ledger Entry`")
|
res = webnotes.conn.sql("select distinct item_code, warehouse from `tabStock Ledger Entry`")
|
||||||
i=0
|
i=0
|
||||||
for d in res:
|
for d in res:
|
||||||
|
@ -7,7 +7,7 @@ $(document).ready(function() {
|
|||||||
erpnext.cart.bind_events();
|
erpnext.cart.bind_events();
|
||||||
return wn.call({
|
return wn.call({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
method: "selling.utils.cart.get_cart_quotation",
|
method: "erpnext.selling.utils.cart.get_cart_quotation",
|
||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
$("#cart-container").removeClass("hide");
|
$("#cart-container").removeClass("hide");
|
||||||
$(".progress").remove();
|
$(".progress").remove();
|
||||||
@ -193,7 +193,7 @@ $.extend(erpnext.cart, {
|
|||||||
return wn.call({
|
return wn.call({
|
||||||
btn: btn,
|
btn: btn,
|
||||||
type: "POST",
|
type: "POST",
|
||||||
method: "selling.utils.cart.apply_shipping_rule",
|
method: "erpnext.selling.utils.cart.apply_shipping_rule",
|
||||||
args: { shipping_rule: rule },
|
args: { shipping_rule: rule },
|
||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
if(!r.exc) {
|
if(!r.exc) {
|
||||||
@ -241,7 +241,7 @@ $.extend(erpnext.cart, {
|
|||||||
|
|
||||||
return wn.call({
|
return wn.call({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
method: "selling.utils.cart.update_cart_address",
|
method: "erpnext.selling.utils.cart.update_cart_address",
|
||||||
args: {
|
args: {
|
||||||
address_fieldname: $address_wrapper.attr("data-fieldname"),
|
address_fieldname: $address_wrapper.attr("data-fieldname"),
|
||||||
address_name: $(this).attr("data-address-name")
|
address_name: $(this).attr("data-address-name")
|
||||||
@ -272,7 +272,7 @@ $.extend(erpnext.cart, {
|
|||||||
place_order: function(btn) {
|
place_order: function(btn) {
|
||||||
return wn.call({
|
return wn.call({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
method: "selling.utils.cart.place_order",
|
method: "erpnext.selling.utils.cart.place_order",
|
||||||
btn: btn,
|
btn: btn,
|
||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
if(r.exc) {
|
if(r.exc) {
|
||||||
|
@ -10,7 +10,7 @@ no_cache = True
|
|||||||
no_sitemap = True
|
no_sitemap = True
|
||||||
|
|
||||||
def get_context():
|
def get_context():
|
||||||
from selling.utils.cart import get_lead_or_customer
|
from erpnext.selling.utils.cart import get_lead_or_customer
|
||||||
party = get_lead_or_customer()
|
party = get_lead_or_customer()
|
||||||
if party.doctype == "Lead":
|
if party.doctype == "Lead":
|
||||||
mobile_no = party.mobile_no
|
mobile_no = party.mobile_no
|
||||||
@ -27,7 +27,7 @@ def get_context():
|
|||||||
|
|
||||||
@webnotes.whitelist()
|
@webnotes.whitelist()
|
||||||
def update_profile(fullname, password=None, company_name=None, mobile_no=None, phone=None):
|
def update_profile(fullname, password=None, company_name=None, mobile_no=None, phone=None):
|
||||||
from selling.utils.cart import update_party
|
from erpnext.selling.utils.cart import update_party
|
||||||
update_party(fullname, company_name, mobile_no, phone)
|
update_party(fullname, company_name, mobile_no, phone)
|
||||||
|
|
||||||
if not fullname:
|
if not fullname:
|
||||||
|
@ -67,11 +67,11 @@ def send_message(subject="Website Query", message="", sender="", status="Open"):
|
|||||||
|
|
||||||
if subject=="Support":
|
if subject=="Support":
|
||||||
# create support ticket
|
# create support ticket
|
||||||
from support.doctype.support_ticket.get_support_mails import add_support_communication
|
from erpnext.support.doctype.support_ticket.get_support_mails import add_support_communication
|
||||||
add_support_communication(subject, message, sender, mail=None)
|
add_support_communication(subject, message, sender, mail=None)
|
||||||
else:
|
else:
|
||||||
# make lead / communication
|
# make lead / communication
|
||||||
from selling.doctype.lead.get_leads import add_sales_communication
|
from erpnext.selling.doctype.lead.get_leads import add_sales_communication
|
||||||
add_sales_communication(subject or "Website Query", message, sender, sender,
|
add_sales_communication(subject or "Website Query", message, sender, sender,
|
||||||
mail=None, status=status)
|
mail=None, status=status)
|
||||||
|
|
@ -6,7 +6,7 @@ import webnotes
|
|||||||
|
|
||||||
from webnotes.utils import flt, getdate
|
from webnotes.utils import flt, getdate
|
||||||
from webnotes import msgprint
|
from webnotes import msgprint
|
||||||
from utilities.transaction_base import delete_events
|
from erpnext.utilities.transaction_base import delete_events
|
||||||
|
|
||||||
class DocType:
|
class DocType:
|
||||||
def __init__(self, doc, doclist=None):
|
def __init__(self, doc, doclist=None):
|
||||||
|
@ -80,7 +80,7 @@ def get_events(start, end, filters=None):
|
|||||||
return data
|
return data
|
||||||
|
|
||||||
def get_project(doctype, txt, searchfield, start, page_len, filters):
|
def get_project(doctype, txt, searchfield, start, page_len, filters):
|
||||||
from controllers.queries import get_match_cond
|
from erpnext.controllers.queries import get_match_cond
|
||||||
return webnotes.conn.sql(""" select name from `tabProject`
|
return webnotes.conn.sql(""" select name from `tabProject`
|
||||||
where %(key)s like "%(txt)s"
|
where %(key)s like "%(txt)s"
|
||||||
%(mcond)s
|
%(mcond)s
|
||||||
|
@ -18,5 +18,5 @@ wn.views.calendar["Task"] = {
|
|||||||
"label": wn._("Project")
|
"label": wn._("Project")
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
get_events_method: "projects.doctype.task.task.get_events"
|
get_events_method: "erpnext.projects.doctype.task.task.get_events"
|
||||||
}
|
}
|
@ -4,7 +4,7 @@
|
|||||||
import webnotes
|
import webnotes
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from projects.doctype.time_log.time_log import OverlapError
|
from erpnext.projects.doctype.time_log.time_log import OverlapError
|
||||||
|
|
||||||
class TestTimeLog(unittest.TestCase):
|
class TestTimeLog(unittest.TestCase):
|
||||||
def test_duplication(self):
|
def test_duplication(self):
|
||||||
|
@ -9,5 +9,5 @@ wn.views.calendar["Time Log"] = {
|
|||||||
"title": "title",
|
"title": "title",
|
||||||
"allDay": "allDay"
|
"allDay": "allDay"
|
||||||
},
|
},
|
||||||
get_events_method: "projects.doctype.time_log.time_log.get_events"
|
get_events_method: "erpnext.projects.doctype.time_log.time_log.get_events"
|
||||||
}
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user