Merge remote-tracking branch 'webnotes/4.0.0-wip' into permissions
Conflicts: erpnext/accounts/page/accounts_browser/accounts_browser.css erpnext/controllers/buying_controller.py erpnext/manufacturing/doctype/production_order/production_order.py erpnext/patches/patch_list.py erpnext/selling/doctype/customer/customer.txt erpnext/selling/doctype/sales_order/sales_order.py erpnext/selling/doctype/sales_order/test_sales_order.py erpnext/setup/doctype/features_setup/features_setup.txt erpnext/stock/doctype/stock_entry/test_stock_entry.py erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py startup/query_handlers.py
This commit is contained in:
commit
8e332ffd16
2
.gitignore
vendored
2
.gitignore
vendored
@ -5,3 +5,5 @@ conf.py
|
|||||||
locale
|
locale
|
||||||
latest_updates.json
|
latest_updates.json
|
||||||
.wnf-lang-status
|
.wnf-lang-status
|
||||||
|
*.egg-info
|
||||||
|
dist/
|
||||||
|
30
.travis.yml
Normal file
30
.travis.yml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
anguage: python
|
||||||
|
|
||||||
|
python:
|
||||||
|
- "2.7"
|
||||||
|
|
||||||
|
services:
|
||||||
|
- mysql
|
||||||
|
|
||||||
|
install:
|
||||||
|
- pip install https://github.com/webnotes/wnframework/archive/4.0.0-wip.tar.gz &&
|
||||||
|
- pip install --editable .
|
||||||
|
|
||||||
|
script:
|
||||||
|
cd ./test_sites/ &&
|
||||||
|
webnotes --reinstall -v test_site &&
|
||||||
|
webnotes --install_app erpnext -v test_site &&
|
||||||
|
webnotes --run_tests -v test_site --app erpnext
|
||||||
|
|
||||||
|
branches:
|
||||||
|
except:
|
||||||
|
- develop
|
||||||
|
- master
|
||||||
|
- 3.x.x
|
||||||
|
- slow
|
||||||
|
- webshop_refactor
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
- mysql -e 'create database travis' &&
|
||||||
|
- echo "USE mysql;\nUPDATE user SET password=PASSWORD('travis') WHERE user='travis';\nFLUSH PRIVILEGES;\n" | mysql -u root
|
||||||
|
|
18
MANIFEST.in
Normal file
18
MANIFEST.in
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
include MANIFEST.in
|
||||||
|
include requirements.txt
|
||||||
|
include *.json
|
||||||
|
include *.md
|
||||||
|
include *.py
|
||||||
|
include *.txt
|
||||||
|
recursive-include erpnext *.css
|
||||||
|
recursive-include erpnext *.csv
|
||||||
|
recursive-include erpnext *.html
|
||||||
|
recursive-include erpnext *.ico
|
||||||
|
recursive-include erpnext *.js
|
||||||
|
recursive-include erpnext *.json
|
||||||
|
recursive-include erpnext *.md
|
||||||
|
recursive-include erpnext *.png
|
||||||
|
recursive-include erpnext *.py
|
||||||
|
recursive-include erpnext *.svg
|
||||||
|
recursive-include erpnext *.txt
|
||||||
|
recursive-exclude * *.pyc
|
@ -1 +0,0 @@
|
|||||||
{% extends "app/portal/templates/sales_transactions.html" %}
|
|
78
config.json
78
config.json
@ -1,78 +0,0 @@
|
|||||||
{
|
|
||||||
"app_name": "ERPNext",
|
|
||||||
"app_version": "3.3.7",
|
|
||||||
"base_template": "app/portal/templates/base.html",
|
|
||||||
"modules": {
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"requires_framework_version": "==3.3.2"
|
|
||||||
}
|
|
@ -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
|
@ -5,8 +5,7 @@
|
|||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import webnotes
|
import webnotes
|
||||||
from webnotes.utils import cint, cstr
|
from webnotes import _
|
||||||
from webnotes import msgprint, _
|
|
||||||
|
|
||||||
class DocType:
|
class DocType:
|
||||||
def __init__(self, d, dl):
|
def __init__(self, d, dl):
|
||||||
@ -16,6 +15,11 @@ class DocType:
|
|||||||
webnotes.conn.set_default("auto_accounting_for_stock", self.doc.auto_accounting_for_stock)
|
webnotes.conn.set_default("auto_accounting_for_stock", self.doc.auto_accounting_for_stock)
|
||||||
|
|
||||||
if self.doc.auto_accounting_for_stock:
|
if self.doc.auto_accounting_for_stock:
|
||||||
for wh in webnotes.conn.sql("select name from `tabWarehouse`"):
|
warehouse_list = webnotes.conn.sql("select name, company from tabWarehouse", as_dict=1)
|
||||||
wh_bean = webnotes.bean("Warehouse", wh[0])
|
warehouse_with_no_company = [d.name for d in warehouse_list if not d.company]
|
||||||
|
if warehouse_with_no_company:
|
||||||
|
webnotes.throw(_("Company is missing in following warehouses") + ": \n" +
|
||||||
|
"\n".join(warehouse_with_no_company))
|
||||||
|
for wh in warehouse_list:
|
||||||
|
wh_bean = webnotes.bean("Warehouse", wh.name)
|
||||||
wh_bean.save()
|
wh_bean.save()
|
@ -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
|
@ -26,8 +26,7 @@ class DocType:
|
|||||||
|
|
||||||
if year_start_end_dates:
|
if year_start_end_dates:
|
||||||
if getdate(self.doc.year_start_date) != year_start_end_dates[0][0] or getdate(self.doc.year_end_date) != year_start_end_dates[0][1]:
|
if getdate(self.doc.year_start_date) != year_start_end_dates[0][0] or getdate(self.doc.year_end_date) != year_start_end_dates[0][1]:
|
||||||
webnotes.throw(_("Cannot change Year Start Date and Year End Date \
|
webnotes.throw(_("Cannot change Year Start Date and Year End Date once the Fiscal Year is saved."))
|
||||||
once the Fiscal Year is saved."))
|
|
||||||
|
|
||||||
def on_update(self):
|
def on_update(self):
|
||||||
# validate year start date and year end date
|
# validate year start date and year end date
|
||||||
@ -43,5 +42,4 @@ class DocType:
|
|||||||
for fiscal_year, ysd, yed in year_start_end_dates:
|
for fiscal_year, ysd, yed in year_start_end_dates:
|
||||||
if (getdate(self.doc.year_start_date) == ysd and getdate(self.doc.year_end_date) == yed) \
|
if (getdate(self.doc.year_start_date) == ysd and getdate(self.doc.year_end_date) == yed) \
|
||||||
and (not webnotes.flags.in_test):
|
and (not webnotes.flags.in_test):
|
||||||
webnotes.throw(_("Year Start Date and Year End Date are already \
|
webnotes.throw(_("Year Start Date and Year End Date are already set in Fiscal Year: ") + fiscal_year)
|
||||||
set in Fiscal Year: ") + fiscal_year)
|
|
@ -50,7 +50,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):
|
||||||
@ -152,10 +152,7 @@ def validate_frozen_account(account, adv_adj):
|
|||||||
frozen_accounts_modifier = webnotes.conn.get_value( 'Accounts Settings', None,
|
frozen_accounts_modifier = webnotes.conn.get_value( 'Accounts Settings', None,
|
||||||
'frozen_accounts_modifier')
|
'frozen_accounts_modifier')
|
||||||
if not frozen_accounts_modifier:
|
if not frozen_accounts_modifier:
|
||||||
webnotes.throw(account + _(" is a frozen account. \
|
webnotes.throw(account + _(" is a frozen account. Either make the account active or assign role in Accounts Settings who can create / modify entries against this account"))
|
||||||
Either make the account active or assign role in Accounts Settings \
|
|
||||||
who can create / modify entries against this account"))
|
|
||||||
elif frozen_accounts_modifier not in webnotes.user.get_roles():
|
elif frozen_accounts_modifier not in webnotes.user.get_roles():
|
||||||
webnotes.throw(account + _(" is a frozen account. ") +
|
webnotes.throw(account + _(" is a frozen account. To create / edit transactions against this account, you need role") \
|
||||||
_("To create / edit transactions against this account, you need role") + ": " +
|
+ ": " + frozen_accounts_modifier)
|
||||||
frozen_accounts_modifier)
|
|
@ -166,7 +166,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;
|
||||||
@ -209,7 +209,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
|
||||||
@ -223,7 +223,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)
|
||||||
@ -236,11 +236,10 @@ class DocType(AccountsController):
|
|||||||
|
|
||||||
if d.against_voucher and webnotes.conn.get_value("Purchase Invoice",
|
if d.against_voucher and webnotes.conn.get_value("Purchase Invoice",
|
||||||
d.against_voucher, "credit_to") != d.account:
|
d.against_voucher, "credit_to") != d.account:
|
||||||
webnotes.throw(_("Debited account (Supplier) is not matching with \
|
webnotes.throw(_("Debited account (Supplier) is not matching with 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 +333,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 +344,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 +362,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 +406,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
|
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