Ejemplo n.º 1
0
    def create_customer_ind(self):
        if not hasattr(self.cls, ' individual'):
            cmc = CommonModelCreator(self.cls)
            cmc.create_individual()

        self.cls.customer_ind = Customer.objects.create(
            individual=self.cls.individual)

        return self.cls.customer_ind
Ejemplo n.º 2
0
    def create_customer_org(self):
        if not hasattr(self.cls, ' organization'):
            cmc = CommonModelCreator(self.cls)
            cmc.create_organization()

        if hasattr(self.cls, 'customer_org'):
            return self.cls.customer_org

        self.cls.customer_org = Customer.objects.create(
            organization=self.cls.organization)

        return self.cls.customer_org
Ejemplo n.º 3
0
    def create_supplier(self):
        if not hasattr(self.cls, 'organization'):
            CommonModelCreator(self.cls).create_organization()

        self.cls.supplier = models.Supplier.objects.create(
            organization=self.cls.organization,
            )

        return self.cls.supplier
Ejemplo n.º 4
0
    def create_supplier(self):
        if not hasattr(self.cls, 'organization'):
            CommonModelCreator(self.cls).create_organization()

        if not hasattr(self.cls, 'account_c'):
            create_accounts(self.cls)

        self.cls.supplier = models.Supplier.objects.create(
            organization=self.cls.organization, account=self.cls.account_c)

        return self.cls.supplier