POS error on Sales Invoice

I’m having some problems on POS form.
When I click to confirm Sales Invoice dialog this error occurs:

Traceback (most recent call last):
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/app.py", line 62, in application
    response = frappe.handler.handle()
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/handler.py", line 22, in handle
    data = execute_cmd(cmd)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/handler.py", line 53, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/__init__.py", line 939, in call
    return fn(*args, **newargs)
  File "/home/ubuntu/frappe-bench/apps/erpnext/erpnext/selling/page/point_of_sale/point_of_sale.py", line 99, in submit_invoice
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 831, in submit
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 820, in _submit
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 256, in save
    return self._save(*args, **kwargs)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 279, in _save
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 218, in insert
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 862, in run_before_save_methods
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 755, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 1024, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 1007, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 749, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/ubuntu/frappe-bench/apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py", line 94, in validate
  File "/home/ubuntu/frappe-bench/apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py", line 406, in set_against_income_account
    self.against_income_account = ','.join(against_acc)
TypeError: sequence item 0: expected string or Unicode, NoneType found

hi ,
can you tell me how did you generate the error ,
and what’s the account name ?

Seems you have not set default income account in the company or in the item master, kindly set the default income account either in the item master or in the company and check POS again.

Hi Ahmed!
On POS page, when I tried submit the Sales Invoice.
Like @rohit_w said, the problem is my account, solve it!

I don’t have income account cause the products are imported from ecommerce API, so I forget to set it when post on Frappe API.
Follow body that I imported:

body = {                                                                                                                                                         
                "item_code": item['item_code'],                                                                                                                          
                "item_name": item['item_desc'],                                                                                                                          
                "standard_rate": item['standard_rate'],                                                                                                                  
                "item_group": "Outros",                                                                                                                                  
                "opening_stock": 50                                                                                                                                      

Now I’ll import again with income account :slight_smile:

1 Like