Ejemplo n.º 1
0
	def validate_party(self):
		if self.party_type and self.party:
			frozen_accounts_modifier = frappe.db.get_value( 'Accounts Settings', None,'frozen_accounts_modifier')
			if not frozen_accounts_modifier in frappe.get_roles():
				if frappe.db.get_value(self.party_type, self.party, "is_frozen"):
					frappe.throw("{0} {1} is frozen".format(self.party_type, self.party), CustomerFrozen)
		validate_party_frozen_disabled(self.party_type, self.party)
Ejemplo n.º 2
0
	def validate_party(self):
		party_type, party = self.get_party()
		validate_party_frozen_disabled(party_type, party)

		billing_party_type, billing_party = self.get_billing_party()
		if (billing_party_type, billing_party) != (party_type, party):
			validate_party_frozen_disabled(billing_party_type, billing_party)
	def get_party(self):
		party_type = None
		if self.meta.get_field("customer"):
			party_type = 'Customer'

		elif self.meta.get_field("supplier"):
			party_type = 'Supplier'

		party_type, party = self.get_party()
		validate_party_frozen_disabled(party_type, party)
Ejemplo n.º 4
0
    def get_party(self):
        party_type = None
        if self.meta.get_field("customer"):
            party_type = 'Customer'

        elif self.meta.get_field("supplier"):
            party_type = 'Supplier'

        party_type, party = self.get_party()
        validate_party_frozen_disabled(party_type, party)
Ejemplo n.º 5
0
 def validate_party(self):
     if self.party_type and self.party:
         frozen_accounts_modifier = frappe.db.get_value(
             'Accounts Settings', None, 'frozen_accounts_modifier')
         if not frozen_accounts_modifier in frappe.get_roles():
             if frappe.db.get_value(self.party_type, self.party,
                                    "is_frozen"):
                 frappe.throw(
                     "{0} {1} is frozen".format(self.party_type,
                                                self.party), CustomerFrozen)
     validate_party_frozen_disabled(self.party_type, self.party)
Ejemplo n.º 6
0
	def validate_party(self):
		validate_party_frozen_disabled(self.party_type, self.party)
Ejemplo n.º 7
0
	def validate_party(self):
		party_type, party = self.get_party()
		validate_party_frozen_disabled(party_type, party)
Ejemplo n.º 8
0
 def validate_party(self):
     party_type, party = self.get_party()
     validate_party_frozen_disabled(party_type, party)
Ejemplo n.º 9
0
	def validate_party(self):
		validate_party_frozen_disabled(self.party_type, self.party)