Ejemplo n.º 1
0
    def validate(self):
        if not self.stock_uom:
            msgprint(_("Please enter default Unit of Measure"),
                     raise_exception=1)
        if self.image and not self.website_image:
            self.website_image = self.image

        self.check_warehouse_is_set_for_stock_item()
        self.check_stock_uom_with_bin()
        self.add_default_uom_in_conversion_factor_table()
        self.validate_conversion_factor()
        self.validate_item_type()
        self.check_for_active_boms()
        self.fill_customer_code()
        self.check_item_tax()
        self.validate_barcode()
        self.cant_change()
        self.validate_item_type_for_reorder()

        if not self.parent_website_route:
            self.parent_website_route = frappe.get_website_route(
                "Item Group", self.item_group)

        if self.name:
            self.old_page_name = frappe.db.get_value('Item', self.name,
                                                     'page_name')
Ejemplo n.º 2
0
	def validate(self):
		if not self.stock_uom:
			msgprint(_("Please enter default Unit of Measure"), raise_exception=1)
		if self.image and not self.website_image:
			self.website_image = self.image

		self.check_warehouse_is_set_for_stock_item()
		self.check_stock_uom_with_bin()
		self.add_default_uom_in_conversion_factor_table()
		self.validate_conversion_factor()
		self.validate_item_type()
		self.check_for_active_boms()
		self.fill_customer_code()
		self.check_item_tax()
		self.validate_barcode()
		self.cant_change()
		self.validate_item_type_for_reorder()

		if not self.parent_website_route:
			self.parent_website_route = frappe.get_website_route("Item Group", self.item_group)

		if self.name:
			self.old_page_name = frappe.db.get_value('Item', self.name, 'page_name')
Ejemplo n.º 3
0
 def validate(self):
     if not self.doc.parent_website_route:
         self.doc.parent_website_route = frappe.get_website_route(
             "Item Group", self.doc.parent_item_group)
Ejemplo n.º 4
0
	def validate(self):
		if not self.parent_website_route:
			if frappe.db.get_value("Item Group", self.parent_item_group, "show_in_website"):
				self.parent_website_route = frappe.get_website_route("Item Group",
					self.parent_item_group)
Ejemplo n.º 5
0
 def validate(self):
     if not self.parent_website_route:
         if frappe.db.get_value("Item Group", self.parent_item_group,
                                "show_in_website"):
             self.parent_website_route = frappe.get_website_route(
                 "Item Group", self.parent_item_group)