def formfield_for_dbfield(self, db_field, **kwargs): if db_field.name == 'company': kwargs['queryset'] = getAllCompany(self) if db_field.name == 'vendor': kwargs['queryset'] = getAllVendor(self) if db_field.name == 'user': kwargs['queryset'] = getAllUsers(self, PURCHASE_GROUP) field = super(InvoiceAdmin, self).formfield_for_dbfield(db_field, **kwargs) return field
def formfield_for_dbfield(self, db_field, **kwargs): if db_field.name == 'vendor': kwargs['queryset'] = getAllVendor(self) field = super(VendorSettingAdmin, self).formfield_for_dbfield(db_field, **kwargs) return field