Exemplo n.º 1
0
    def validate_warehouse(self):
        from erpnext.stock.utils import validate_warehouse_company, validate_disabled_warehouse

        warehouses = list(
            set([
                d.warehouse for d in self.get("items")
                if getattr(d, "warehouse", None)
            ]))

        target_warehouses = list(
            set([
                d.target_warehouse for d in self.get("items")
                if getattr(d, "target_warehouse", None)
            ]))

        warehouses.extend(target_warehouses)

        from_warehouse = list(
            set([
                d.from_warehouse for d in self.get("items")
                if getattr(d, "from_warehouse", None)
            ]))

        warehouses.extend(from_warehouse)

        for w in warehouses:
            validate_disabled_warehouse(w)
            validate_warehouse_company(w, self.company)
Exemplo n.º 2
0
	def validate(self):
		self.flags.ignore_submit_comment = True
		from erpnext.stock.utils import validate_warehouse_company, validate_disabled_warehouse
		self.validate_mandatory()
		self.validate_item()
		self.validate_batch()
		validate_disabled_warehouse(self.warehouse)
		validate_warehouse_company(self.warehouse, self.company)
		self.scrub_posting_time()
		self.validate_and_set_fiscal_year()
		self.block_transactions_against_group_warehouse()