mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 19:59:12 +00:00
committed by
Nabin Hait
parent
ecc6f86c7c
commit
56b2e12af8
@@ -11,6 +11,8 @@ from erpnext.accounts.party import get_party_account
|
|||||||
from erpnext.hr.doctype.expense_claim.expense_claim import update_reimbursed_amount
|
from erpnext.hr.doctype.expense_claim.expense_claim import update_reimbursed_amount
|
||||||
from erpnext.hr.doctype.employee_loan.employee_loan import update_disbursement_status
|
from erpnext.hr.doctype.employee_loan.employee_loan import update_disbursement_status
|
||||||
|
|
||||||
|
from six import string_types
|
||||||
|
|
||||||
class JournalEntry(AccountsController):
|
class JournalEntry(AccountsController):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(JournalEntry, self).__init__(*args, **kwargs)
|
super(JournalEntry, self).__init__(*args, **kwargs)
|
||||||
@@ -763,7 +765,7 @@ def get_outstanding(args):
|
|||||||
if not frappe.has_permission("Account"):
|
if not frappe.has_permission("Account"):
|
||||||
frappe.msgprint(_("No Permission"), raise_exception=1)
|
frappe.msgprint(_("No Permission"), raise_exception=1)
|
||||||
|
|
||||||
if isinstance(args, basestring):
|
if isinstance(args, string_types):
|
||||||
args = json.loads(args)
|
args = json.loads(args)
|
||||||
|
|
||||||
company_currency = erpnext.get_company_currency(args.get("company"))
|
company_currency = erpnext.get_company_currency(args.get("company"))
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ from erpnext.accounts.general_ledger import make_gl_entries
|
|||||||
from erpnext.hr.doctype.expense_claim.expense_claim import update_reimbursed_amount
|
from erpnext.hr.doctype.expense_claim.expense_claim import update_reimbursed_amount
|
||||||
from erpnext.controllers.accounts_controller import AccountsController
|
from erpnext.controllers.accounts_controller import AccountsController
|
||||||
|
|
||||||
|
from six import string_types
|
||||||
|
|
||||||
class InvalidPaymentEntry(ValidationError):
|
class InvalidPaymentEntry(ValidationError):
|
||||||
pass
|
pass
|
||||||
@@ -500,7 +501,7 @@ class PaymentEntry(AccountsController):
|
|||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_outstanding_reference_documents(args):
|
def get_outstanding_reference_documents(args):
|
||||||
if isinstance(args, basestring):
|
if isinstance(args, string_types):
|
||||||
args = json.loads(args)
|
args = json.loads(args)
|
||||||
|
|
||||||
party_account_currency = get_account_currency(args.get("party_account"))
|
party_account_currency = get_account_currency(args.get("party_account"))
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ from frappe import throw, _
|
|||||||
from frappe.utils import flt, cint
|
from frappe.utils import flt, cint
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
|
|
||||||
|
from six import string_types
|
||||||
|
|
||||||
class MultiplePricingRuleConflict(frappe.ValidationError): pass
|
class MultiplePricingRuleConflict(frappe.ValidationError): pass
|
||||||
|
|
||||||
@@ -96,7 +97,7 @@ def apply_pricing_rule(args):
|
|||||||
"ignore_pricing_rule": "something"
|
"ignore_pricing_rule": "something"
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
if isinstance(args, basestring):
|
if isinstance(args, string_types):
|
||||||
args = json.loads(args)
|
args = json.loads(args)
|
||||||
|
|
||||||
args = frappe._dict(args)
|
args = frappe._dict(args)
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ from erpnext.exceptions import PartyFrozen, PartyDisabled, InvalidAccountCurrenc
|
|||||||
from erpnext.accounts.utils import get_fiscal_year
|
from erpnext.accounts.utils import get_fiscal_year
|
||||||
from erpnext import get_default_currency, get_company_currency
|
from erpnext import get_default_currency, get_company_currency
|
||||||
|
|
||||||
|
from six import iteritems
|
||||||
|
|
||||||
class DuplicatePartyAccountError(frappe.ValidationError): pass
|
class DuplicatePartyAccountError(frappe.ValidationError): pass
|
||||||
|
|
||||||
@@ -412,7 +413,7 @@ def get_timeline_data(doctype, name):
|
|||||||
|
|
||||||
timeline_items = dict(data)
|
timeline_items = dict(data)
|
||||||
|
|
||||||
for date, count in timeline_items.iteritems():
|
for date, count in iteritems(timeline_items):
|
||||||
timestamp = get_timestamp(date)
|
timestamp = get_timestamp(date)
|
||||||
out.update({ timestamp: count })
|
out.update({ timestamp: count })
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ from frappe import _
|
|||||||
from frappe.utils import cstr, flt
|
from frappe.utils import cstr, flt
|
||||||
import json, copy
|
import json, copy
|
||||||
|
|
||||||
|
from six import string_types
|
||||||
|
|
||||||
class ItemVariantExistsError(frappe.ValidationError): pass
|
class ItemVariantExistsError(frappe.ValidationError): pass
|
||||||
class InvalidItemAttributeValueError(frappe.ValidationError): pass
|
class InvalidItemAttributeValueError(frappe.ValidationError): pass
|
||||||
class ItemTemplateCannotHaveStock(frappe.ValidationError): pass
|
class ItemTemplateCannotHaveStock(frappe.ValidationError): pass
|
||||||
@@ -26,7 +28,7 @@ def get_variant(template, args=None, variant=None, manufacturer=None,
|
|||||||
return make_variant_based_on_manufacturer(item_template, manufacturer,
|
return make_variant_based_on_manufacturer(item_template, manufacturer,
|
||||||
manufacturer_part_no)
|
manufacturer_part_no)
|
||||||
else:
|
else:
|
||||||
if isinstance(args, basestring):
|
if isinstance(args, string_types):
|
||||||
args = json.loads(args)
|
args = json.loads(args)
|
||||||
|
|
||||||
if not args:
|
if not args:
|
||||||
@@ -150,7 +152,7 @@ def find_variant(template, args, variant_item_code=None):
|
|||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def create_variant(item, args):
|
def create_variant(item, args):
|
||||||
if isinstance(args, basestring):
|
if isinstance(args, string_types):
|
||||||
args = json.loads(args)
|
args = json.loads(args)
|
||||||
|
|
||||||
template = frappe.get_doc("Item", item)
|
template = frappe.get_doc("Item", item)
|
||||||
@@ -177,7 +179,7 @@ def enqueue_multiple_variant_creation(item, args):
|
|||||||
item=item, args=args, now=frappe.flags.in_test);
|
item=item, args=args, now=frappe.flags.in_test);
|
||||||
|
|
||||||
def create_multiple_variants(item, args):
|
def create_multiple_variants(item, args):
|
||||||
if isinstance(args, basestring):
|
if isinstance(args, string_types):
|
||||||
args = json.loads(args)
|
args = json.loads(args)
|
||||||
|
|
||||||
args_set = generate_keyed_value_combinations(args)
|
args_set = generate_keyed_value_combinations(args)
|
||||||
|
|||||||
@@ -7,19 +7,10 @@ import unittest
|
|||||||
from erpnext.stock.doctype.item.test_item import set_item_variant_settings
|
from erpnext.stock.doctype.item.test_item import set_item_variant_settings
|
||||||
from erpnext.controllers.item_variant import copy_attributes_to_variant, make_variant_item_code
|
from erpnext.controllers.item_variant import copy_attributes_to_variant, make_variant_item_code
|
||||||
|
|
||||||
# python 3 compatibility stuff
|
from six import string_types
|
||||||
try:
|
|
||||||
unicode = unicode
|
|
||||||
except NameError:
|
|
||||||
# Python 3
|
|
||||||
basestring = (str, bytes)
|
|
||||||
else:
|
|
||||||
# Python 2
|
|
||||||
basestring = basestring
|
|
||||||
|
|
||||||
|
|
||||||
def create_variant_with_tables(item, args):
|
def create_variant_with_tables(item, args):
|
||||||
if isinstance(args, basestring):
|
if isinstance(args, string_types):
|
||||||
args = json.loads(args)
|
args = json.loads(args)
|
||||||
|
|
||||||
template = frappe.get_doc("Item", item)
|
template = frappe.get_doc("Item", item)
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ from erpnext.setup.utils import get_exchange_rate
|
|||||||
from frappe.website.website_generator import WebsiteGenerator
|
from frappe.website.website_generator import WebsiteGenerator
|
||||||
from erpnext.stock.get_item_details import get_conversion_factor
|
from erpnext.stock.get_item_details import get_conversion_factor
|
||||||
|
|
||||||
|
from six import string_types
|
||||||
|
|
||||||
from operator import itemgetter
|
from operator import itemgetter
|
||||||
|
|
||||||
form_grid_templates = {
|
form_grid_templates = {
|
||||||
@@ -109,7 +111,7 @@ class BOM(WebsiteGenerator):
|
|||||||
if not args:
|
if not args:
|
||||||
args = frappe.form_dict.get('args')
|
args = frappe.form_dict.get('args')
|
||||||
|
|
||||||
if isinstance(args, basestring):
|
if isinstance(args, string_types):
|
||||||
import json
|
import json
|
||||||
args = json.loads(args)
|
args = json.loads(args)
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ from erpnext.manufacturing.doctype.bom.bom import validate_bom_no
|
|||||||
from erpnext.stock.utils import get_bin
|
from erpnext.stock.utils import get_bin
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
from six import string_types
|
||||||
|
|
||||||
class IncorrectValuationRateError(frappe.ValidationError): pass
|
class IncorrectValuationRateError(frappe.ValidationError): pass
|
||||||
class DuplicateEntryForProductionOrderError(frappe.ValidationError): pass
|
class DuplicateEntryForProductionOrderError(frappe.ValidationError): pass
|
||||||
class OperationsNotCompleteError(frappe.ValidationError): pass
|
class OperationsNotCompleteError(frappe.ValidationError): pass
|
||||||
@@ -978,7 +980,7 @@ def get_uom_details(item_code, uom, qty):
|
|||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_warehouse_details(args):
|
def get_warehouse_details(args):
|
||||||
if isinstance(args, basestring):
|
if isinstance(args, string_types):
|
||||||
args = json.loads(args)
|
args = json.loads(args)
|
||||||
|
|
||||||
args = frappe._dict(args)
|
args = frappe._dict(args)
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ from erpnext.setup.utils import get_exchange_rate
|
|||||||
from frappe.model.meta import get_field_precision
|
from frappe.model.meta import get_field_precision
|
||||||
from erpnext.stock.doctype.batch.batch import get_batch_no
|
from erpnext.stock.doctype.batch.batch import get_batch_no
|
||||||
|
|
||||||
|
from six import string_types
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_item_details(args):
|
def get_item_details(args):
|
||||||
@@ -100,7 +101,7 @@ def get_item_details(args):
|
|||||||
return out
|
return out
|
||||||
|
|
||||||
def process_args(args):
|
def process_args(args):
|
||||||
if isinstance(args, basestring):
|
if isinstance(args, string_types):
|
||||||
args = json.loads(args)
|
args = json.loads(args)
|
||||||
|
|
||||||
args = frappe._dict(args)
|
args = frappe._dict(args)
|
||||||
@@ -640,7 +641,7 @@ def get_gross_profit(out):
|
|||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_serial_no(args, serial_nos=None):
|
def get_serial_no(args, serial_nos=None):
|
||||||
serial_no = None
|
serial_no = None
|
||||||
if isinstance(args, basestring):
|
if isinstance(args, string_types):
|
||||||
args = json.loads(args)
|
args = json.loads(args)
|
||||||
args = frappe._dict(args)
|
args = frappe._dict(args)
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ from frappe import _
|
|||||||
import json
|
import json
|
||||||
from frappe.utils import flt, cstr, nowdate, nowtime
|
from frappe.utils import flt, cstr, nowdate, nowtime
|
||||||
|
|
||||||
|
from six import string_types
|
||||||
|
|
||||||
class InvalidWarehouseCompany(frappe.ValidationError): pass
|
class InvalidWarehouseCompany(frappe.ValidationError): pass
|
||||||
|
|
||||||
def get_stock_value_on(warehouse=None, posting_date=None, item_code=None):
|
def get_stock_value_on(warehouse=None, posting_date=None, item_code=None):
|
||||||
@@ -126,7 +128,7 @@ def update_bin(args, allow_negative_stock=False, via_landed_cost_voucher=False):
|
|||||||
def get_incoming_rate(args, raise_error_if_no_rate=True):
|
def get_incoming_rate(args, raise_error_if_no_rate=True):
|
||||||
"""Get Incoming Rate based on valuation method"""
|
"""Get Incoming Rate based on valuation method"""
|
||||||
from erpnext.stock.stock_ledger import get_previous_sle, get_valuation_rate
|
from erpnext.stock.stock_ledger import get_previous_sle, get_valuation_rate
|
||||||
if isinstance(args, basestring):
|
if isinstance(args, string_types):
|
||||||
args = json.loads(args)
|
args = json.loads(args)
|
||||||
|
|
||||||
in_rate = 0
|
in_rate = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user