[Answered ]-Django inheritance, relationship between classes who depends directly/indirectly of same class

2👍

You are making a circular import by importing from invoice.model import Invoice
in procedure/models.py and from procedure.models import Area in invoice/models.py.

Change your code like so:

# procedure/models.py:
class Procedure(CreateUpdateMixin):
    ...
    # invoices.invoice as a string:
    invoices = models.ManyToManyField('invoice.Invoice', 
                                       verbose_name=_('Facturas'), blank=True)

The main concept is to change class referencies to strings. It makes possible to have circular dependencies. You can do this in invoice/models.py as well.

Leave a comment