[fix] Multiple minor fixes

This commit is contained in:
Nabin Hait 2015-10-10 18:10:05 +05:30
parent c03cba9d17
commit 51e980dd2c
3 changed files with 4 additions and 4 deletions

View File

@ -355,7 +355,7 @@ class calculate_taxes_and_totals(object):
item.net_amount = flt(item.net_amount + discount_amount_loss,
item.precision("net_amount"))
item.net_rate = flt(item.net_amount / item.qty, item.precision("net_rate"))
item.net_rate = flt(item.net_amount / item.qty, item.precision("net_rate")) if item.qty else 0
self._set_in_company_currency(item, ["net_rate", "net_amount"])

View File

@ -396,7 +396,7 @@ def make_sales_invoice(source_name, target_doc=None):
"parent": "sales_order",
},
"postprocess": update_item,
"condition": lambda doc: doc.base_amount==0 or doc.billed_amt < doc.amount
"condition": lambda doc: doc.qty and (doc.base_amount==0 or doc.billed_amt < doc.amount)
},
"Sales Taxes and Charges": {
"doctype": "Sales Taxes and Charges",

View File

@ -200,8 +200,8 @@ class Item(WebsiteGenerator):
self.set("reorder_levels", [])
if self.re_order_level or len(self.get("reorder_levels", {"material_request_type": "Purchase"})):
if not self.is_purchase_item:
frappe.throw(_("""To set reorder level, item must be a Purchase Item"""))
if not (self.is_purchase_item or self.is_pro_applicable):
frappe.throw(_("""To set reorder level, item must be a Purchase Item or Prodcution Item"""))
def validate_warehouse_for_reorder(self):
warehouse = []