resolved merge conflicts
This commit is contained in:
@@ -5,7 +5,7 @@ import frappe
|
|||||||
from erpnext.hooks import regional_overrides
|
from erpnext.hooks import regional_overrides
|
||||||
from frappe.utils import getdate
|
from frappe.utils import getdate
|
||||||
|
|
||||||
__version__ = '10.0.13'
|
__version__ = '10.0.14'
|
||||||
|
|
||||||
def get_default_company(user=None):
|
def get_default_company(user=None):
|
||||||
'''Get default company for user'''
|
'''Get default company for user'''
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"allow_copy": 0,
|
"allow_copy": 0,
|
||||||
"allow_guest_to_view": 0,
|
"allow_guest_to_view": 0,
|
||||||
"allow_import": 0,
|
"allow_import": 1,
|
||||||
"allow_rename": 0,
|
"allow_rename": 1,
|
||||||
"autoname": "field:payment_term_name",
|
"autoname": "field:payment_term_name",
|
||||||
"beta": 0,
|
"beta": 0,
|
||||||
"creation": "2017-08-10 15:24:54.876365",
|
"creation": "2017-08-10 15:24:54.876365",
|
||||||
@@ -265,7 +265,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2017-08-10 16:26:03.581501",
|
"modified": "2018-01-24 11:13:42.800048",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Payment Term",
|
"name": "Payment Term",
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"allow_copy": 0,
|
"allow_copy": 0,
|
||||||
"allow_guest_to_view": 0,
|
"allow_guest_to_view": 0,
|
||||||
"allow_import": 0,
|
"allow_import": 1,
|
||||||
"allow_rename": 0,
|
"allow_rename": 1,
|
||||||
"autoname": "field:template_name",
|
"autoname": "field:template_name",
|
||||||
"beta": 0,
|
"beta": 0,
|
||||||
"creation": "2017-08-10 15:34:28.058054",
|
"creation": "2017-08-10 15:34:28.058054",
|
||||||
@@ -85,7 +85,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2017-08-10 15:46:33.877884",
|
"modified": "2018-01-24 11:13:31.158613",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Payment Terms Template",
|
"name": "Payment Terms Template",
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
|
|||||||
this.frm.set_df_property("credit_to", "print_hide", 0);
|
this.frm.set_df_property("credit_to", "print_hide", 0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.frm.set_value("disable_rounded_total", frappe.sys_defaults.disable_rounded_total);
|
this.frm.set_value("disable_rounded_total", cint(frappe.sys_defaults.disable_rounded_total));
|
||||||
}
|
}
|
||||||
|
|
||||||
// formatter for material request item
|
// formatter for material request item
|
||||||
|
|||||||
@@ -484,7 +484,7 @@ class AccountsController(TransactionBase):
|
|||||||
max_allowed_amt = flt(ref_amt * (100 + tolerance) / 100)
|
max_allowed_amt = flt(ref_amt * (100 + tolerance) / 100)
|
||||||
|
|
||||||
if total_billed_amt - max_allowed_amt > 0.01:
|
if total_billed_amt - max_allowed_amt > 0.01:
|
||||||
frappe.throw(_("Cannot overbill for Item {0} in row {1} more than {2}. To allow over-billing, please set in Buying Settings").format(item.item_code, item.idx, max_allowed_amt))
|
frappe.throw(_("Cannot overbill for Item {0} in row {1} more than {2}. To allow over-billing, please set in Stock Settings").format(item.item_code, item.idx, max_allowed_amt))
|
||||||
|
|
||||||
def get_company_default(self, fieldname):
|
def get_company_default(self, fieldname):
|
||||||
from erpnext.accounts.utils import get_company_default
|
from erpnext.accounts.utils import get_company_default
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"allow_copy": 0,
|
"allow_copy": 0,
|
||||||
"allow_guest_to_view": 0,
|
"allow_guest_to_view": 0,
|
||||||
"allow_import": 0,
|
"allow_import": 0,
|
||||||
"allow_rename": 0,
|
"allow_rename": 1,
|
||||||
"autoname": "field:email",
|
"autoname": "field:email",
|
||||||
"beta": 0,
|
"beta": 0,
|
||||||
"creation": "2017-09-19 16:20:27.510196",
|
"creation": "2017-09-19 16:20:27.510196",
|
||||||
@@ -295,7 +295,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2018-01-15 09:40:41.153561",
|
"modified": "2018-01-22 15:53:35.059946",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Non Profit",
|
"module": "Non Profit",
|
||||||
"name": "Donor",
|
"name": "Donor",
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"allow_copy": 0,
|
"allow_copy": 0,
|
||||||
"allow_guest_to_view": 0,
|
"allow_guest_to_view": 0,
|
||||||
"allow_import": 0,
|
"allow_import": 0,
|
||||||
"allow_rename": 0,
|
"allow_rename": 1,
|
||||||
"autoname": "field:email",
|
"autoname": "field:email",
|
||||||
"beta": 0,
|
"beta": 0,
|
||||||
"creation": "2017-09-11 09:24:52.898356",
|
"creation": "2017-09-11 09:24:52.898356",
|
||||||
@@ -140,7 +140,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"fieldname": "email",
|
"fieldname": "email",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
@@ -151,6 +151,7 @@
|
|||||||
"label": "Email",
|
"label": "Email",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
|
"options": "User",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"precision": "",
|
"precision": "",
|
||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
@@ -325,7 +326,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2018-01-15 09:38:41.878167",
|
"modified": "2018-01-22 15:58:46.507509",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Non Profit",
|
"module": "Non Profit",
|
||||||
"name": "Member",
|
"name": "Member",
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"allow_copy": 0,
|
"allow_copy": 0,
|
||||||
"allow_guest_to_view": 0,
|
"allow_guest_to_view": 0,
|
||||||
"allow_import": 0,
|
"allow_import": 0,
|
||||||
"allow_rename": 0,
|
"allow_rename": 1,
|
||||||
"autoname": "field:email",
|
"autoname": "field:email",
|
||||||
"beta": 0,
|
"beta": 0,
|
||||||
"creation": "2017-09-19 16:16:45.676019",
|
"creation": "2017-09-19 16:16:45.676019",
|
||||||
@@ -506,7 +506,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2018-01-15 09:40:25.229551",
|
"modified": "2018-01-22 15:53:46.480182",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Non Profit",
|
"module": "Non Profit",
|
||||||
"name": "Volunteer",
|
"name": "Volunteer",
|
||||||
|
|||||||
@@ -539,7 +539,8 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
|||||||
// due_date is to be changed, payment terms template and/or payment schedule must
|
// due_date is to be changed, payment terms template and/or payment schedule must
|
||||||
// be removed as due_date is automatically changed based on payment terms
|
// be removed as due_date is automatically changed based on payment terms
|
||||||
if (this.frm.doc.due_date) {
|
if (this.frm.doc.due_date) {
|
||||||
if (this.frm.doc.payment_terms_template || this.frm.doc.payment_schedule.length) {
|
if (this.frm.doc.payment_terms_template ||
|
||||||
|
(this.frm.doc.payment_schedule && this.frm.doc.payment_schedule.length)) {
|
||||||
var message1 = "";
|
var message1 = "";
|
||||||
var message2 = "";
|
var message2 = "";
|
||||||
var final_message = "Please clear the ";
|
var final_message = "Please clear the ";
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ class Company(Document):
|
|||||||
self.validate_currency()
|
self.validate_currency()
|
||||||
self.validate_coa_input()
|
self.validate_coa_input()
|
||||||
self.validate_perpetual_inventory()
|
self.validate_perpetual_inventory()
|
||||||
|
self.check_country_change()
|
||||||
|
|
||||||
def validate_abbr(self):
|
def validate_abbr(self):
|
||||||
if not self.abbr:
|
if not self.abbr:
|
||||||
@@ -80,8 +81,11 @@ class Company(Document):
|
|||||||
if not frappe.db.sql("""select name from tabAccount
|
if not frappe.db.sql("""select name from tabAccount
|
||||||
where company=%s and docstatus<2 limit 1""", self.name):
|
where company=%s and docstatus<2 limit 1""", self.name):
|
||||||
if not frappe.local.flags.ignore_chart_of_accounts:
|
if not frappe.local.flags.ignore_chart_of_accounts:
|
||||||
|
frappe.flags.country_change = True
|
||||||
self.create_default_accounts()
|
self.create_default_accounts()
|
||||||
self.create_default_warehouses()
|
self.create_default_warehouses()
|
||||||
|
|
||||||
|
if frappe.flags.country_change:
|
||||||
install_country_fixtures(self.name)
|
install_country_fixtures(self.name)
|
||||||
|
|
||||||
if not frappe.db.get_value("Cost Center", {"is_group": 0, "company": self.name}):
|
if not frappe.db.get_value("Cost Center", {"is_group": 0, "company": self.name}):
|
||||||
@@ -147,6 +151,13 @@ class Company(Document):
|
|||||||
frappe.msgprint(_("Set default inventory account for perpetual inventory"),
|
frappe.msgprint(_("Set default inventory account for perpetual inventory"),
|
||||||
alert=True, indicator='orange')
|
alert=True, indicator='orange')
|
||||||
|
|
||||||
|
def check_country_change(self):
|
||||||
|
frappe.flags.country_change = False
|
||||||
|
|
||||||
|
if not self.get('__islocal') and \
|
||||||
|
self.country != frappe.db.get_value('Company', self.name, 'country'):
|
||||||
|
frappe.flags.country_change = True
|
||||||
|
|
||||||
def set_default_accounts(self):
|
def set_default_accounts(self):
|
||||||
self._set_default_account("default_cash_account", "Cash")
|
self._set_default_account("default_cash_account", "Cash")
|
||||||
self._set_default_account("default_bank_account", "Bank")
|
self._set_default_account("default_bank_account", "Bank")
|
||||||
|
|||||||
@@ -106,6 +106,13 @@ frappe.ui.form.on("Item", {
|
|||||||
frappe.set_route("Form", "Item Variant Settings");
|
frappe.set_route("Form", "Item Variant Settings");
|
||||||
}, __("View"));
|
}, __("View"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const stock_exists = (frm.doc.__onload
|
||||||
|
&& frm.doc.__onload.stock_exists) ? 1 : 0;
|
||||||
|
|
||||||
|
['has_serial_no', 'has_batch_no'].forEach((fieldname) => {
|
||||||
|
frm.set_df_property(fieldname, 'read_only', stock_exists);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
validate: function(frm){
|
validate: function(frm){
|
||||||
|
|||||||
@@ -1211,7 +1211,7 @@
|
|||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
"set_only_once": 1,
|
"set_only_once": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1401,7 +1401,7 @@
|
|||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
"set_only_once": 1,
|
"set_only_once": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -3484,7 +3484,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 1,
|
"max_attachments": 1,
|
||||||
"modified": "2018-01-08 21:53:55.895525",
|
"modified": "2018-01-23 12:21:16.641517",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Item",
|
"name": "Item",
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ frappe.ui.form.on('Stock Entry', {
|
|||||||
mr_item.item_code = item.item_code;
|
mr_item.item_code = item.item_code;
|
||||||
mr_item.item_name = item.item_name;
|
mr_item.item_name = item.item_name;
|
||||||
mr_item.uom = item.uom;
|
mr_item.uom = item.uom;
|
||||||
|
mr_item.conversion_factor = item.conversion_factor;
|
||||||
mr_item.item_group = item.item_group;
|
mr_item.item_group = item.item_group;
|
||||||
mr_item.description = item.description;
|
mr_item.description = item.description;
|
||||||
mr_item.image = item.image;
|
mr_item.image = item.image;
|
||||||
|
|||||||
@@ -150,7 +150,7 @@
|
|||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
"in_global_search": 0,
|
"in_global_search": 0,
|
||||||
"in_list_view": 0,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
"in_standard_filter": 0,
|
||||||
"label": "Disabled",
|
"label": "Disabled",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
@@ -699,7 +699,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2017-08-21 02:12:33.652689",
|
"modified": "2018-01-23 16:45:45.546649",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Warehouse",
|
"name": "Warehouse",
|
||||||
|
|||||||
@@ -66,7 +66,6 @@ def get_data(filters, columns):
|
|||||||
return item_price_qty_data
|
return item_price_qty_data
|
||||||
|
|
||||||
def get_item_price_qty_data(filters):
|
def get_item_price_qty_data(filters):
|
||||||
item_dicts = []
|
|
||||||
conditions = ""
|
conditions = ""
|
||||||
if filters.get("item_code"):
|
if filters.get("item_code"):
|
||||||
conditions += "where a.item_code=%(item_code)s"
|
conditions += "where a.item_code=%(item_code)s"
|
||||||
@@ -78,11 +77,10 @@ def get_item_price_qty_data(filters):
|
|||||||
{conditions}"""
|
{conditions}"""
|
||||||
.format(conditions=conditions), filters, as_dict=1)
|
.format(conditions=conditions), filters, as_dict=1)
|
||||||
|
|
||||||
price_list_names = ",".join(['"' + frappe.db.escape(item['price_list_name']) + '"'
|
price_list_names = list(set([frappe.db.escape(item.price_list_name) for item in item_results]))
|
||||||
for item in item_results])
|
|
||||||
|
|
||||||
buying_price_map = get_buying_price_map(price_list_names)
|
buying_price_map = get_price_map(price_list_names, buying=1)
|
||||||
selling_price_map = get_selling_price_map(price_list_names)
|
selling_price_map = get_price_map(price_list_names, selling=1)
|
||||||
|
|
||||||
result = []
|
result = []
|
||||||
if item_results:
|
if item_results:
|
||||||
@@ -109,40 +107,31 @@ def get_item_price_qty_data(filters):
|
|||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def get_buying_price_map(price_list_names):
|
def get_price_map(price_list_names, buying=0, selling=0):
|
||||||
buying_price = frappe.db.sql("""
|
price_map = {}
|
||||||
|
|
||||||
|
if not price_list_names:
|
||||||
|
return price_map
|
||||||
|
|
||||||
|
rate_key = "Buying Rate" if buying else "Selling Rate"
|
||||||
|
price_list_key = "Buying Price List" if buying else "Selling Price List"
|
||||||
|
price_list_condition = " and buying=1" if buying else " and selling=1"
|
||||||
|
|
||||||
|
pricing_details = frappe.db.sql("""
|
||||||
select
|
select
|
||||||
name,price_list,price_list_rate
|
name,price_list,price_list_rate
|
||||||
from
|
from
|
||||||
`tabItem Price`
|
`tabItem Price`
|
||||||
where
|
where
|
||||||
name in ({price_list_names}) and buying=1
|
name in ({price_list_names}) {price_list_condition}
|
||||||
""".format(price_list_names=price_list_names), as_dict=1)
|
""".format(price_list_names=', '.join(['%s']*len(price_list_names)),
|
||||||
|
price_list_condition=price_list_condition), price_list_names, as_dict=1)
|
||||||
|
|
||||||
buying_price_map = {}
|
for d in pricing_details:
|
||||||
for d in buying_price:
|
|
||||||
name = d["name"]
|
name = d["name"]
|
||||||
buying_price_map[name] = {
|
price_map[name] = {
|
||||||
"Buying Price List" :d["price_list"],
|
price_list_key :d["price_list"],
|
||||||
"Buying Rate" :d["price_list_rate"]
|
rate_key :d["price_list_rate"]
|
||||||
}
|
}
|
||||||
return buying_price_map
|
|
||||||
|
|
||||||
def get_selling_price_map(price_list_names):
|
return price_map
|
||||||
selling_price = frappe.db.sql("""
|
|
||||||
select
|
|
||||||
name,price_list,price_list_rate
|
|
||||||
from
|
|
||||||
`tabItem Price`
|
|
||||||
where
|
|
||||||
name in ({price_list_names}) and selling=1
|
|
||||||
""".format(price_list_names=price_list_names), as_dict=1)
|
|
||||||
|
|
||||||
selling_price_map = {}
|
|
||||||
for d in selling_price:
|
|
||||||
name = d["name"]
|
|
||||||
selling_price_map[name] = {
|
|
||||||
"Selling Price List" :d["price_list"],
|
|
||||||
"Selling Rate" :d["price_list_rate"]
|
|
||||||
}
|
|
||||||
return selling_price_map
|
|
||||||
|
|||||||
Reference in New Issue
Block a user