Changes between Version 1 and Version 2 of Ticket #27311


Ignore:
Timestamp:
Oct 4, 2016, 5:40:33 AM (8 years ago)
Author:
Odero
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #27311 – Description

    v1 v2  
    33{{{
    44def generate_invoices(apps, schema_editor):
    5     Payment = apps.get_model('finance', 'Payment')
    6     Invoice = apps.get_model('finance', 'Invoice')
     5    A = apps.get_model('app1', 'A')
     6    B = apps.get_model('app1', 'B')
    77    User = apps.get_model('accounts', 'User')
    88
    9     payment = Payment.objects.last()
     9    a = A.objects.last()
    1010
    11     invoice = Invoice(
    12         client=payment.user),
     11    b = B(
     12        client=a.user),
    1313        status=5
    1414    )
     
    2121
    2222{{{
    23     invoice = Invoice(
    24         client=User.objects.get(pk=payment.user.pk),
     23    b = B(
     24        client=User.objects.get(pk=a.user.pk),
    2525        status=5
    2626    )
     
    3030In both cases I get the error:
    3131{{{
    32 Cannot assign "<User: Some Client>": "Invoice.client" must be a "User" instance.
     32Cannot assign "<User: Some User>": "B.client" must be a "User" instance.
    3333}}}
Back to Top