Compare commits

..

9 Commits

Author SHA1 Message Date
Nabin Hait
a6be7c71ed Merge branch 'hotfix' 2016-12-27 14:27:19 +05:30
Nabin Hait
89c8b4d6ae bumped to version 7.2.2 2016-12-27 14:57:19 +06:00
Nabin Hait
e5f5017973 Merge pull request #7333 from rmehta/variant-website-fix
[fix] item variants not directly shown in website due to route clash
2016-12-27 13:31:30 +05:30
Rushabh Mehta
174c3478a1 [fix] item variants not directly shown in website due to route clash 2016-12-27 12:30:30 +05:30
Nabin Hait
c2690425e3 Merge pull request #7310 from bhupennewalkar1337/hotfix
Fix #7202 unchecking pos will reflect automatically
2016-12-26 16:07:19 +05:30
Nabin Hait
3322fafdbe Merge branch 'hotfix' 2016-12-24 11:01:25 +05:30
Nabin Hait
8b3e39ed27 bumped to version 7.2.1 2016-12-24 11:31:25 +06:00
Nabin Hait
1d90b41aea [fix] Fetch serial nos on change of Warehouse 2016-12-24 10:42:23 +05:30
bhupen
bcf63a2a8f unchecking pos will reflect automatically 2016-12-23 18:00:18 +05:30
10 changed files with 2724 additions and 2682 deletions

View File

@@ -2,7 +2,7 @@
from __future__ import unicode_literals
import frappe
__version__ = '7.2.0'
__version__ = '7.2.2'
def get_default_company(user=None):
'''Get default company for user'''

View File

@@ -270,6 +270,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
});
}
}
else this.frm.trigger("refresh")
},
amount: function(){

View File

@@ -359,3 +359,4 @@ erpnext.patches.v7_1.set_currency_exchange_date
erpnext.patches.v7_1.set_sales_person_status
erpnext.patches.v7_1.repost_stock_for_deleted_bins_for_merging_items
execute:frappe.delete_doc('Desktop Icon', {'module_name': 'Profit and Loss Statment'})
erpnext.patches.v7_2.update_website_for_variant

View File

View File

@@ -0,0 +1,12 @@
import frappe
def execute():
# variant must have show_in_website = 0
frappe.reload_doctype('Item')
frappe.db.sql('''
update tabItem set
show_variant_in_website = 1,
show_in_website = 0
where
show_in_website=1
and ifnull(variant_of, "")!=""''')

View File

@@ -212,7 +212,7 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({
item_code: item.item_code,
warehouse: item.warehouse,
qty: item.qty,
serial_no:item.serial_no
serial_no: item.serial_no || ""
},
callback:function(r){
if (inList(['Delivery Note', 'Sales Invoice'], doc.doctype)) {

View File

@@ -1691,7 +1691,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2016-11-23 12:33:37.728117",
"modified": "2016-12-24 12:33:37.728117",
"modified_by": "Administrator",
"module": "Stock",
"name": "Delivery Note Item",

File diff suppressed because it is too large Load Diff

View File

@@ -5,7 +5,6 @@ from __future__ import unicode_literals
import frappe
import erpnext
import json
import urllib
import itertools
from frappe import msgprint, _
from frappe.utils import cstr, flt, cint, getdate, now_datetime, formatdate, strip
@@ -238,19 +237,12 @@ class Item(WebsiteGenerator):
def get_context(self, context):
context.show_search=True
context.search_link = '/product_search'
if self.variant_of:
# redirect to template page!
template_item = frappe.get_doc("Item", self.variant_of)
frappe.flags.redirect_location = template_item.route + "?variant=" + urllib.quote(self.name)
raise frappe.Redirect
context.parent_groups = get_parent_item_groups(self.item_group) + \
[{"name": self.name}]
self.set_variant_context(context)
self.set_attribute_context(context)
self.set_disabled_attributes(context)
context.parents = self.get_parents(context)
@@ -264,7 +256,8 @@ class Item(WebsiteGenerator):
# load variants
# also used in set_attribute_context
context.variants = frappe.get_all("Item",
filters={"variant_of": self.name, "show_in_website": 1}, order_by="name asc")
filters={"variant_of": self.name, "show_variant_in_website": 1},
order_by="name asc")
variant = frappe.form_dict.variant
if not variant and context.variants:
@@ -565,12 +558,12 @@ class Item(WebsiteGenerator):
existing_allow_negative_stock = frappe.db.get_value("Stock Settings", None, "allow_negative_stock")
frappe.db.set_value("Stock Settings", None, "allow_negative_stock", 1)
repost_stock_for_warehouses = frappe.db.sql_list("""select distinct warehouse
repost_stock_for_warehouses = frappe.db.sql_list("""select distinct warehouse
from tabBin where item_code=%s""", new_name)
# Delete all existing bins to avoid duplicate bins for the same item and warehouse
frappe.db.sql("delete from `tabBin` where item_code=%s", new_name)
for warehouse in repost_stock_for_warehouses:
repost_stock(new_name, warehouse)
@@ -597,6 +590,11 @@ class Item(WebsiteGenerator):
def update_template_item(self):
"""Set Show in Website for Template Item if True for its Variant"""
if self.variant_of and self.show_in_website:
self.show_variant_in_website = 1
self.show_in_website = 0
if self.show_variant_in_website:
# show template
template_item = frappe.get_doc("Item", self.variant_of)
if not template_item.show_in_website:

View File

@@ -384,7 +384,7 @@ def get_serial_no_details(item_code, warehouse, qty, serial_no):
return {'serial_no': serial_no}
@frappe.whitelist()
def get_bin_details_and_serial_nos(item_code, warehouse, qty, serial_no):
def get_bin_details_and_serial_nos(item_code, warehouse, qty=None, serial_no=None):
bin_details_and_serial_nos = {}
bin_details_and_serial_nos.update(get_bin_details(item_code, warehouse))
bin_details_and_serial_nos.update(get_serial_no_details(item_code, warehouse, qty, serial_no))