Bonsoir,
Jâessaie dâimporter des abonnements mais jâai lâimpression que cette fonctionnalitĂ© nâest pas possible.
En effet, le type de document nâest pas sĂ©lectionnable dans lâoutil dâimportation.
Jâai voulu essayer en utilisant lâAPI REST en imaginant que je pourrais parser un fichier CSV et pousser dans dokos, mais jâobtiens une erreur UnboundLocalError: local variable âinvoiceâ referenced before assignment
Peut-ĂȘtre que câest pour ça que lâimport nâest pas proposĂ© ?
Est-ce que quelquâun a dĂ©jĂ rĂ©ussi une tel migration ?
Retour complet de l'API
{
"exception": "UnboundLocalError: local variable 'invoice' referenced before assignment",
"exc": "[\"Traceback (most recent call last):\\n File \\\"apps/erpnext/erpnext/accounts/doctype/subscription/subscription_transaction.py\\\", line 281, in get_simulation\\n invoice = self.create_invoice(simulate=True)\\n File \\\"apps/erpnext/erpnext/accounts/doctype/subscription/subscription_transaction.py\\\", line 232, in create_invoice\\n invoice = self.set_subscription_invoicing_details(invoice)\\n File \\\"apps/erpnext/erpnext/accounts/doctype/subscription/subscription_transaction.py\\\", line 41, in set_subscription_invoicing_details\\n document.customer_group, document.territory = frappe.db.get_value(\\nTypeError: cannot unpack non-iterable NoneType object\\n\\nDuring handling of the above exception, another exception occurred:\\n\\nTraceback (most recent call last):\\n File \\\"apps/frappe/frappe/app.py\\\", line 66, in application\\n response = frappe.api.handle()\\n File \\\"apps/frappe/frappe/api.py\\\", line 53, in handle\\n return _RESTAPIHandler(call, doctype, name).get_response()\\n File \\\"apps/frappe/frappe/api.py\\\", line 71, in get_response\\n self.handle_resource()\\n File \\\"apps/frappe/frappe/api.py\\\", line 85, in handle_resource\\n self.handle_doctype_resource()\\n File \\\"apps/frappe/frappe/api.py\\\", line 109, in handle_doctype_resource\\n self.create_doc()\\n File \\\"apps/frappe/frappe/api.py\\\", line 188, in create_doc\\n doc = frappe.get_doc(data).insert()\\n File \\\"apps/frappe/frappe/model/document.py\\\", line 262, in insert\\n self.run_before_save_methods()\\n File \\\"apps/frappe/frappe/model/document.py\\\", line 1098, in run_before_save_methods\\n self.run_method(\\\"validate\\\")\\n File \\\"apps/frappe/frappe/model/document.py\\\", line 964, in run_method\\n out = Document.hook(fn)(self, *args, **kwargs)\\n File \\\"apps/frappe/frappe/model/document.py\\\", line 1331, in composer\\n return composed(self, method, *args, **kwargs)\\n File \\\"apps/frappe/frappe/model/document.py\\\", line 1313, in runner\\n add_to_return_value(self, fn(self, *args, **kwargs))\\n File \\\"apps/frappe/frappe/model/document.py\\\", line 961, in fn\\n return method_object(*args, **kwargs)\\n File \\\"apps/erpnext/erpnext/accounts/doctype/subscription/subscription.py\\\", line 41, in validate\\n self.calculate_grand_total()\\n File \\\"apps/erpnext/erpnext/accounts/doctype/subscription/subscription.py\\\", line 76, in calculate_grand_total\\n self.grand_total = SubscriptionInvoiceGenerator(self).get_simulation()\\n File \\\"apps/erpnext/erpnext/accounts/doctype/subscription/subscription_transaction.py\\\", line 294, in get_simulation\\n invoice.log_error(_(\\\"Subscription Grand Total Simulation Error\\\"))\\nUnboundLocalError: local variable 'invoice' referenced before assignment\\n\"]"
}