diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 3e467e53621..00000000000 --- a/MANIFEST.in +++ /dev/null @@ -1,20 +0,0 @@ -include MANIFEST.in -include requirements.txt -include *.json -include *.md -include *.py -include *.txt -include .travis.yml -recursive-include erpnext *.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/public * -recursive-exclude * *.pyc diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 90bf6b772ef..69019252479 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -5,7 +5,7 @@ import frappe from erpnext.hooks import regional_overrides from frappe.utils import getdate -__version__ = '11.1.34' +__version__ = '11.1.35' def get_default_company(user=None): '''Get default company for user''' diff --git a/erpnext/controllers/item_variant.py b/erpnext/controllers/item_variant.py index 31ae83a0ce2..4230d17ff0e 100644 --- a/erpnext/controllers/item_variant.py +++ b/erpnext/controllers/item_variant.py @@ -288,14 +288,18 @@ def copy_attributes_to_variant(item, variant): variant.variant_of = item.name - if not variant.description: - variant.description = "" - if 'description' not in allow_fields: - if item.variant_based_on == 'Item Attribute' and not variant.description: - variant.description = "
" + item.name + "
" - for d in variant.attributes: - variant.description += "
" + d.attribute + ": " + cstr(d.attribute_value) + "
" + if not variant.description: + variant.description = "" + + if item.variant_based_on=='Item Attribute': + if variant.attributes: + attributes_description = item.description + " " + for d in variant.attributes: + attributes_description += "
" + d.attribute + ": " + cstr(d.attribute_value) + "
" + + if attributes_description not in variant.description: + variant.description += attributes_description def make_variant_item_code(template_item_code, template_item_name, variant): """Uses template's item code and abbreviations to make variant's item code""" diff --git a/erpnext/controllers/status_updater.py b/erpnext/controllers/status_updater.py index 29bd014fc8d..2484586d041 100644 --- a/erpnext/controllers/status_updater.py +++ b/erpnext/controllers/status_updater.py @@ -316,19 +316,27 @@ class StatusUpdater(Document): .format(frappe.db.escape(frappe.session.user)) def update_billing_status_for_zero_amount_refdoc(self, ref_dt): - ref_fieldname = ref_dt.lower().replace(" ", "_") - zero_amount_refdoc = [] - all_zero_amount_refdoc = frappe.db.sql_list("""select name from `tab%s` - where docstatus=1 and base_net_total = 0""" % ref_dt) + ref_fieldname = frappe.scrub(ref_dt) - for item in self.get("items"): - if item.get(ref_fieldname) \ - and item.get(ref_fieldname) in all_zero_amount_refdoc \ - and item.get(ref_fieldname) not in zero_amount_refdoc: - zero_amount_refdoc.append(item.get(ref_fieldname)) + ref_docs = [item.get(ref_fieldname) for item in (self.get('items') or []) if item.get(ref_fieldname)] + if not ref_docs: + return - if zero_amount_refdoc: - self.update_billing_status(zero_amount_refdoc, ref_dt, ref_fieldname) + zero_amount_refdocs = frappe.db.sql_list(""" + SELECT + name + from + `tab{ref_dt}` + where + docstatus = 1 + and base_net_total = 0 + and name in %(ref_docs)s + """.format(ref_dt=ref_dt), { + 'ref_docs': ref_docs + }) + + if zero_amount_refdocs: + self.update_billing_status(zero_amount_refdocs, ref_dt, ref_fieldname) def update_billing_status(self, zero_amount_refdoc, ref_dt, ref_fieldname): for ref_dn in zero_amount_refdoc: