Fixed merge conflict

This commit is contained in:
Nabin Hait 2018-09-12 15:45:20 +05:30
commit 9fde97cdd2
13 changed files with 58 additions and 36 deletions

View File

@ -735,7 +735,7 @@
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
@ -752,7 +752,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2018-06-15 17:09:01.430292",
"modified": "2018-09-12 11:02:41.825923",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Budget",
@ -785,6 +785,7 @@
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 0,
"track_seen": 0
"track_changes": 1,
"track_seen": 0,
"track_views": 0
}

View File

@ -36,7 +36,7 @@ class Budget(Document):
b.name, ba.account from `tabBudget` b, `tabBudget Account` ba
where
ba.parent = b.name and b.docstatus < 2 and b.company = %s and %s=%s and
b.fiscal_year=%s and b.name != %sand ba.account in (%s) """
b.fiscal_year=%s and b.name != %s and ba.account in (%s) """
% ('%s', budget_against_field, '%s', '%s', '%s', ','.join(['%s'] * len(accounts))),
(self.company, budget_against, self.fiscal_year, self.name) + tuple(accounts), as_dict=1)

View File

@ -1585,7 +1585,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2018-05-16 22:43:37.272875",
"modified": "2018-09-05 12:43:37.272875",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Profile",

View File

@ -12,7 +12,7 @@ from erpnext.setup.utils import get_exchange_rate
from erpnext.stock.get_item_details import get_pos_profile
from frappe import _
from frappe.core.doctype.communication.email import make
from frappe.utils import nowdate
from frappe.utils import nowdate, cint
from six import string_types, iteritems
@ -514,7 +514,7 @@ def make_email_queue(email_queue):
name = frappe.db.get_value('Sales Invoice', {'offline_pos_name': key}, 'name')
data = json.loads(data)
sender = frappe.session.user
print_format = "POS Invoice"
print_format = "POS Invoice" if not cint(frappe.db.get_value('Print Format', 'POS Invoice', 'disabled')) else None
attachments = [frappe.attach_print('Sales Invoice', name, print_format=print_format)]
make(subject=data.get('subject'), content=data.get('content'), recipients=data.get('recipients'),

View File

@ -305,9 +305,13 @@ class SalesInvoice(SellingController):
super(SalesInvoice, self).set_missing_values(for_validate)
print_format = pos.get("print_format_for_online") if pos else None
if not print_format and not cint(frappe.db.get_value('Print Format', 'POS Invoice', 'disabled')):
print_format = 'POS Invoice'
if pos:
return {
"print_format": pos.get("print_format_for_online"),
"print_format": print_format,
"allow_edit_rate": pos.get("allow_user_to_edit_rate"),
"allow_edit_discount": pos.get("allow_user_to_edit_discount")
}

View File

@ -37,7 +37,6 @@ def get_columns(filters):
_("Sales and Returns") + ":Currency/currency:120",
_("Taxes") + ":Currency/currency:120",
_("Payments") + ":Currency/currency:120",
_("Warehouse") + ":Data:200"
]

View File

@ -2341,7 +2341,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2018-09-07 05:16:58.258276",
"modified": "2018-09-07 07:16:58.258276",
"modified_by": "Administrator",
"module": "Buying",
"name": "Purchase Order Item",

View File

@ -49,7 +49,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "1",
"default": "",
"fieldname": "enable_shopify",
"fieldtype": "Check",
"hidden": 0,
@ -1219,7 +1219,7 @@
"issingle": 1,
"istable": 0,
"max_attachments": 0,
"modified": "2018-04-11 19:04:53.396557",
"modified": "2018-09-07 09:11:49.403176",
"modified_by": "Administrator",
"module": "ERPNext Integrations",
"name": "Shopify Settings",
@ -1253,5 +1253,6 @@
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 0,
"track_seen": 0
"track_seen": 0,
"track_views": 0
}

View File

@ -536,7 +536,7 @@ erpnext.patches.v11_0.make_location_from_warehouse
erpnext.patches.v11_0.make_asset_finance_book_against_old_entries
erpnext.patches.v11_0.check_buying_selling_in_currency_exchange
erpnext.patches.v11_0.move_item_defaults_to_child_table_for_multicompany #02-07-2018
erpnext.patches.v11_0.refactor_erpnext_shopify
erpnext.patches.v11_0.refactor_erpnext_shopify #2018-09-07
erpnext.patches.v11_0.rename_overproduction_percent_field
erpnext.patches.v11_0.update_backflush_subcontract_rm_based_on_bom
erpnext.patches.v10_0.update_status_in_purchase_receipt

View File

@ -19,15 +19,26 @@ def execute():
frappe.db.sql("truncate `tabShopify Log`")
setup_app_type()
else:
disable_shopify()
def setup_app_type():
try:
shopify_settings = frappe.get_doc("Shopify Settings")
shopify_settings.app_type = 'Private'
shopify_settings.update_price_in_erpnext_price_list = 0 if getattr(shopify_settings, 'push_prices_to_shopify', None) else 1
shopify_settings.update_price_in_erpnext_price_list = 0 if getattr(shopify_settings, 'push_prices_to_shopify', None) else 1
shopify_settings.flags.ignore_mandatory = True
shopify_settings.ignore_permissions = True
shopify_settings.save()
except Exception:
frappe.db.set_value("Shopify Shopify", None, "enable_shopify", 0)
frappe.log_error(frappe.get_traceback())
frappe.db.set_value("Shopify Settings", None, "enable_shopify", 0)
frappe.log_error(frappe.get_traceback())
def disable_shopify():
# due to frappe.db.set_value wrongly written and enable_shopify being default 1
# Shopify Settings isn't properly configured and leads to error
shopify = frappe.get_doc('Shopify Settings')
if shopify.app_type == "Public" or shopify.app_type == None or \
(shopify.enable_shopify and not (shopify.shopify_url or shopify.api_key)):
frappe.db.set_value("Shopify Settings", None, "enable_shopify", 0)

View File

@ -519,7 +519,7 @@ erpnext.pos.PointOfSale = class PointOfSale {
this.frm.cscript.calculate_taxes_and_totals();
if (r.message) {
this.frm.meta.default_print_format = r.message.print_format || 'POS Invoice';
this.frm.meta.default_print_format = r.message.print_format || "";
this.frm.allow_edit_rate = r.message.allow_edit_rate;
this.frm.allow_edit_discount = r.message.allow_edit_discount;
}

View File

@ -42,7 +42,14 @@ frappe.ui.form.on("Stock Reconciliation", {
},
get_items: function(frm) {
frappe.prompt({label:"Warehouse", fieldtype:"Link", options:"Warehouse", reqd: 1},
frappe.prompt({label:"Warehouse", fieldtype:"Link", options:"Warehouse", reqd: 1,
"get_query": function() {
return {
"filters": {
"company": frm.doc.company,
}
}
}},
function(data) {
frappe.call({
method:"erpnext.stock.doctype.stock_reconciliation.stock_reconciliation.get_items",

View File

@ -271,28 +271,27 @@ class StockReconciliation(StockController):
@frappe.whitelist()
def get_items(warehouse, posting_date, posting_time, company):
items = [d.item_code for d in frappe.get_list("Bin", fields=["item_code"], filters={"warehouse": warehouse})]
items = frappe.db.sql('''select i.name, i.item_name from `tabItem` i, `tabBin` bin where i.name=bin.item_code
and i.disabled=0 and bin.warehouse=%s''', (warehouse), as_dict=True)
items += frappe.db.sql_list('''select i.name from `tabItem` i, `tabItem Default` id where i.name = id.parent
items += frappe.db.sql('''select i.name, i.item_name from `tabItem` i, `tabItem Default` id where i.name = id.parent
and i.is_stock_item=1 and i.has_serial_no=0 and i.has_batch_no=0 and i.has_variants=0 and i.disabled=0
and id.default_warehouse=%s and id.company=%s''', (warehouse, company))
and id.default_warehouse=%s and id.company=%s group by i.name''', (warehouse, company), as_dict=True)
res = []
for item in set(items):
stock_bal = get_stock_balance(item[0], warehouse, posting_date, posting_time,
for item in items:
qty, rate = get_stock_balance(item.name, warehouse, posting_date, posting_time,
with_valuation_rate=True)
if frappe.db.get_value("Item",item[0],"disabled") == 0:
res.append({
"item_code": item[0],
"warehouse": warehouse,
"qty": stock_bal[0],
"item_name": frappe.db.get_value('Item', item[0], 'item_name'),
"valuation_rate": stock_bal[1],
"current_qty": stock_bal[0],
"current_valuation_rate": stock_bal[1]
})
res.append({
"item_code": item.name,
"warehouse": warehouse,
"qty": qty,
"item_name": item.item_name,
"valuation_rate": rate,
"current_qty": qty,
"current_valuation_rate": rate
})
return res