Error when I want to get Customer Invoice POST

Was trying to make invoice line POST ed and this happend


Traceback (most recent call last):
  File "/trytond/model/modelstorage.py", line 1500, in __getattr__
    field = self._fields[name]
KeyError: 'origin_name'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/genshi/template/eval.py", line 301, in lookup_attr
    val = getattr(obj, key)
  File "/trytond/report/report.py", line 267, in __getattr__
    return getattr(record, name)
  File "/trytond/model/modelstorage.py", line 1666, in __getattr__
    read_data = http://self.read(list(index.keys()), list(ffields.keys()))
  File "/trytond/model/modelsql.py", line 870, in read
    getter_results = field.get(
  File "/trytond/model/fields/function.py", line 105, in get
    return dict((name, call(name)) for name in names)
  File "/trytond/model/fields/function.py", line 105, in <genexpr>
    return dict((name, call(name)) for name in names)
  File "/trytond/model/fields/function.py", line 100, in call
    return dict((http://r.id, method(r, name)) for r in records)
  File "/trytond/model/fields/function.py", line 100, in <genexpr>
    return dict((http://r.id, method(r, name)) for r in records)
  File "/trytond/modules/account_invoice/invoice.py", line 1198, in get_origins
    return ', '.join(set(filter(None,
  File "/trytond/modules/account_invoice/invoice.py", line 1199, in <genexpr>
    (l.origin_name for l in self.lines))))
  File "/trytond/model/modelstorage.py", line 1502, in __getattr__
    raise AttributeError('"%s" has no attribute "%s"' % (self, name))
AttributeError: "account.invoice.line,1" has no attribute "origin_name"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/genshi/template/eval.py", line 307, in lookup_attr
    val = obj[key]
TypeError: 'TranslateModel' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/trytond/wsgi.py", line 117, in dispatch_request
    return endpoint(request, **request.view_args)
  File "/trytond/protocols/dispatcher.py", line 46, in rpc
    return methods.get(request.rpc_method, _dispatch)(
  File "/trytond/wsgi.py", line 84, in auth_required
    return wrapped(*args, **kwargs)
  File "/trytond/protocols/wrappers.py", line 181, in wrapper
    return func(request, pool, *args, **kwargs)
  File "/trytond/protocols/dispatcher.py", line 180, in _dispatch
    result = rpc.result(meth(*c_args, **c_kwargs))
  File "/trytond/model/modelview.py", line 775, in wrapper
    return func(cls, records, *args, **kwargs)
  File "/trytond/model/workflow.py", line 37, in wrapper
    result = func(cls, filtered, *args, **kwargs)
  File "/trytond/modules/account_invoice/invoice.py", line 1519, in post
    cls._post(invoices)
  File "/trytond/modules/sale/invoice.py", line 19, in wrapper
    func(cls, invoices)
  File "/trytond/modules/sale/invoice.py", line 79, in _post
    super()._post(invoices)
  File "/trytond/modules/purchase/invoice.py", line 20, in wrapper
    func(cls, invoices)
  File "/trytond/modules/purchase/invoice.py", line 92, in _post
    super()._post(invoices)
  File "/trytond/modules/account_invoice_stock/account.py", line 16, in _post
    super()._post(invoices)
  File "/trytond/modules/account_invoice/invoice.py", line 1542, in _post
    invoice.print_invoice()
  File "/trytond/modules/account_invoice/invoice.py", line 1429, in print_invoice
    InvoiceReport.execute([http://self.id], {})
  File "/trytond/modules/account_invoice/invoice.py", line 2823, in execute
    return super().execute(ids, data)
  File "/trytond/report/report.py", line 215, in execute
    oext, content = cls._execute(
  File "/trytond/modules/account_invoice/invoice.py", line 2799, in _execute
    result = super()._execute(records, header, data, action)
  File "/trytond/report/report.py", line 233, in _execute
    return cls.convert(action, cls.render(action, report_context))
  File "/trytond/modules/account_invoice/invoice.py", line 2818, in render
    return super().render(*args, **kwargs)
  File "/trytond/report/report.py", line 329, in render
    data = template.generate(**report_context).render()
  File "/relatorio/templates/base.py", line 16, in render
    return self.serializer(
  File "/relatorio/templates/opendocument.py", line 1156, in __call__
    output_encode(
  File "/genshi/output.py", line 60, in encode
    for chunk in iterator:
  File "/genshi/output.py", line 243, in __call__
    for kind, data, pos in stream:
  File "/genshi/output.py", line 674, in __call__
    for kind, data, pos in stream:
  File "/genshi/output.py", line 779, in __call__
    for kind, data, pos in chain(stream, [(None, None, None)]):
  File "/genshi/output.py", line 598, in __call__
    for ev in stream:
  File "/relatorio/templates/opendocument.py", line 1053, in __call__
    for kind, data, pos in stream:
  File "/genshi/filters/i18n.py", line 789, in __call__
    for kind, data, pos in stream:
  File "/genshi/template/base.py", line 641, in _include
    for event in stream:
  File "/genshi/template/markup.py", line 329, in _match
    for event in stream:
  File "/genshi/template/base.py", line 601, in _flatten
    result = _eval_expr(data, ctxt, vars)
  File "/genshi/template/base.py", line 290, in _eval_expr
    retval = expr.evaluate(ctxt)
  File "/genshi/template/eval.py", line 160, in evaluate
    return eval(self.code, _globals, {'__data__': data})
  File "<string>", line 374, in <Expression "__relatorio_escape_invalid_chars(http://invoice.origins or '')">
  File "/genshi/template/eval.py", line 309, in lookup_attr
    val = cls.undefined(key, owner=obj)
  File "/genshi/template/eval.py", line 397, in undefined
    raise UndefinedError(key, owner=owner)
genshi.template.eval.UndefinedError: <http://trytond.report.report.Report._get_records.<locals>.TranslateModel object at 0x7f4cb0d50a00> has no member named "origins"

Indeed I think you have filled the origin of one line with just the model but no record.
Origin name from Reference field must test if id is greater than 0 (#13498) · Issues · Tryton / Tryton · GitLab should fix it.