Testing sale subscription for generating invoice?

hello guys

i want to generate a maintenance invoice every 3 months . is it possible how could i test it for small amount of time like every 5 minute ?

Yes, you just have to use an invoice recurrence of three months.

Not sure to understand what you need.
But if you want to test that the subscription recurrence works you just need to use the invoice wizards with a date in the future.

can you tell me how can i run invoice wizard ? seems i can’t find the option to run it ?

image

is that the wizard option ?

You should first create the consumptions and then the invoices.

i was getting the following error

1 139944508585728 [2021-02-28 05:04:36,808] ERROR trytond.ir.cron Running cron 10
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/trytond/ir/cron.py", line 134, in run
    cron.run_once()
  File "/usr/local/lib/python3.7/dist-packages/trytond/model/descriptors.py", line 31, in newfunc
    return self.func(owner, [instance], *args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/trytond/model/modelview.py", line 740, in wrapper
    return func(cls, records, *args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/trytond/modules/company/ir.py", line 99, in run_once
    super(Cron, cls).run_once([cron])
  File "/usr/local/lib/python3.7/dist-packages/trytond/model/descriptors.py", line 33, in newfunc
    return self.func(owner, *args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/trytond/model/modelview.py", line 740, in wrapper
    return func(cls, records, *args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/trytond/ir/cron.py", line 114, in run_once
    getattr(Model, method)()
  File "/usr/local/lib/python3.7/dist-packages/trytond/modules/sale_subscription/subscription.py", line 377, in generate_invoice
    consumptions, invoice)
  File "/usr/local/lib/python3.7/dist-packages/trytond/modules/sale_subscription/subscription.py", line 885, in get_invoice_lines
    line.quantity = sum(c.quantity for c in sub_consumptions)
TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'

It seems you have a consumtion without quantity and this breaks the invoice quantity.

Could you please fill a bug with the steps to reproduce it on a fresh database? Thanks in advance

1 Like