Aptronics / aptronics

Other
0 stars 1 forks source link

Bulk Serial Number Generation #6

Open agritheory opened 4 years ago

agritheory commented 4 years ago

@SaiFi0102 Close this when you've pushed to the Aptronics ERPNext branch

SaiFi0102 commented 4 years ago

@agritheory Pushed to aptronics branch. Please update test server. Also I don't have the rights to close this issue.

Functionality: If total number serial numbers are greater than 100 than the Purchase Receipt/Invoice submission will be done in a background job

agritheory commented 4 years ago

@SaiFi0102 can you reference the commit? I can't find it in the current erpnext/aptroncis branch

SaiFi0102 commented 4 years ago

https://github.com/Aptronics/erpnext/commit/4ba101141aa091e96f0efea17519aeb837fde472

hpema commented 4 years ago

can we get more info on the error on the comment it loads, plus some kind of message sent back to user then background task finishes?

hpema commented 4 years ago

I just tested with different number of serials to qty entered and got this error in comment... so at least now we get an error message showing, which is great, but needs to be more gracefull then what is showing:

Traceback (most recent call last):
  File "/home/hemant/frappe-bench/apps/frappe/frappe/model/document.py", line 1254, in executeaction
    getattr(doc, action)(**kwargs)
  File "/home/hemant/frappe-bench/apps/frappe/frappe/model/document.py", line 848, in _submit
    self.save()
  File "/home/hemant/frappe-bench/apps/frappe/frappe/model/document.py", line 272, in save
    return self.save(args, *kwargs)
  File "/home/hemant/frappe-bench/apps/frappe/frappe/model/document.py", line 325, in save
    self.runpostsavemethods()
  File "/home/hemant/frappe-bench/apps/frappe/frappe/model/document.py", line 922, in runpostsavemethods
    self.runmethod("onsubmit")
  File "/home/hemant/frappe-bench/apps/frappe/frappe/model/document.py", line 787, in runmethod
    out = Document.hook(fn)(self, args, *kwargs)
  File "/home/hemant/frappe-bench/apps/frappe/frappe/model/document.py", line 1058, in composer
    return composed(self, method, args, *kwargs)
  File "/home/hemant/frappe-bench/apps/frappe/frappe/model/document.py", line 1041, in runner
    addtoreturnvalue(self, fn(self, *args, **kwargs))
  File "/home/hemant/frappe-bench/apps/frappe/frappe/model/document.py", line 781, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/hemant/frappe-bench/apps/erpnext/erpnext/stock/doctype/purchase</lambda>receipt/purchasereceipt.py", line 163, in onsubmit
    self.updatestockledger()
  File "/home/hemant/frappe-bench/apps/erpnext/erpnext/controllers/buyingcontroller.py", line 512, in updatestockledger
    vialandedcostvoucher=vialandedcostvoucher)
  File "/home/hemant/frappe-bench/apps/erpnext/erpnext/controllers/stockcontroller.py", line 250, in makeslentries
    makeslentries(slentries, isamended, allownegativestock, vialandedcostvoucher)
  File "/home/hemant/frappe-bench/apps/erpnext/erpnext/stock/stockledger.py", line 33, in makeslentries
    sleid = makeentry(sle, allownegativestock, vialandedcostvoucher)
  File "/home/hemant/frappe-bench/apps/erpnext/erpnext/stock/stockledger.py", line 58, in makeentry
    sle.submit()
  File "/home/hemant/frappe-bench/apps/frappe/frappe/model/document.py", line 859, in submit
    self.submit()
  File "/home/hemant/frappe-bench/apps/frappe/frappe/model/document.py", line 848, in submit
    self.save()
  File "/home/hemant/frappe-bench/apps/frappe/frappe/model/document.py", line 272, in save
    return self.save(args, *kwargs)
  File "/home/hemant/frappe-bench/apps/frappe/frappe/model/document.py", line 325, in save
    self.runpostsavemethods()
  File "/home/hemant/frappe-bench/apps/frappe/frappe/model/document.py", line 922, in runpostsavemethods
    self.runmethod("onsubmit")
  File "/home/hemant/frappe-bench/apps/frappe/frappe/model/document.py", line 787, in runmethod
    out = Document.hook(fn)(self, args, *kwargs)
  File "/home/hemant/frappe-bench/apps/frappe/frappe/model/document.py", line 1058, in composer
    return composed(self, method, args, *kwargs)
  File "/home/hemant/frappe-bench/apps/frappe/frappe/model/document.py", line 1041, in runner
    addtoreturnvalue(self, fn(self, *args, **kwargs))
  File "/home/hemant/frappe-bench/apps/frappe/frappe/model/document.py", line 781, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/hemant/frappe-bench/apps/erpnext/erpnext/stock/doctype/stock</lambda>ledgerentry/stockledgerentry.py", line 43, in onsubmit
    processserialno(self)
  File "/home/hemant/frappe-bench/apps/erpnext/erpnext/stock/doctype/serialno/serialno.py", line 190, in processserialno
    validateserialno(sle, itemdet)
  File "/home/hemant/frappe-bench/apps/erpnext/erpnext/stock/doctype/serialno/serialno.py", line 207, in validateserialno
    SerialNoQtyError)
  File "/home/hemant/frappe-bench/apps/frappe/frappe/init.py", line 364, in throw
    msgprint(msg, raiseexception=exc, title=title, indicator='red')
  File "/home/hemant/frappe-bench/apps/frappe/frappe/init.py", line 350, in msgprint
    raiseexception()
  File "/home/hemant/frappe-bench/apps/frappe/frappe/init.py", line 316, in raiseexception
    raise raiseexception(msg)
erpnext.stock.doctype.serialno.serial_no.SerialNoQtyError: 150.0 Serial Numbers required for Item 210AOIE. You have provided 148.
agritheory commented 4 years ago

@hpema Can you please test this again