mdwala
September 9, 2017, 12:57pm
1
Hi,
I have set two series in stock entry as
11-STE-.#####.-.YY
22-STE-.#####.-.YY
11-STE-.#####.-.YY is working properly and using correct serial numbers.
But with 22 I dont have any entry but when I save new stock entry it uses number above 52…
After deleting 22-STE-00052-17, when I go to naming series current value for 22-STE is still 0.
Clicking update series number with 0 doesnt change anything.
New stock entry still creates 53, I repeat same above, it creates 54!
What am I missing?
clarkej
September 9, 2017, 1:42pm
2
For clues and answers check these - inspect the database etc
Sales invoice naming series problem
mdwala
September 10, 2017, 5:43am
3
Hi Thanks clarkej,
I can see following, Please guide what to do…
| 22-STE- | 65 |
| 22-STE-00010- | 0 |
| 22-STE-00030- | 0 |
| LCV | 7 |
| 22-STE-00038- | 0 |
| 22-STE-00040- | 0 |
| 22-STE-00041- | 50 |
| 11-STE-00067- | 64 |
| 11-STE-00069- | 64 |
| 22-STE-00046- | 0 |
| 22-ST- | 2 |
| 22-STE-00050- | 0 |
| 22-STE-00054- | 0 |
| 22-STE-00055- | 0 |
±----------------------------±--------+
clarkej
September 10, 2017, 6:56am
4
You are allowed only one naming_series template and here you seem to have two.
Assuming you wish to generate a distinct series for your two STE types, 11 and 22, then define the naming_series say CODE-STE-.#####.-.YY.
Then in Stock Entry doctype add a Custom Field that contains a Select field named ‘code’ the lists Options 11 & 22. (So when a Stock Entry instance is created, you select either those option that is ‘pulled’ or substituted into the naming_series.)
Finally in the controller stock_entry.py define this
def autoname(self):
#key = “CODE-STE-.#####.-.YY.”
key = self.get(“autoname”)
name = frappe.model.naming.make_autoname(key)
self.name = name.replace(“CODE”,self.code)
mdwala
September 11, 2017, 7:36am
5
Hi Clarkej,
I think since I only posted few details you didnt get my queries, Apology. Attaching all.
+-----------------------------+---------+
| name | current |
+-----------------------------+---------+
| PATCHLOG | 610 |
| CHF-B | 1 |
| STE- | 0 |
| SLE/ | 34799 |
| BIN/ | 350 |
| GL | 116852 |
| [Select] | 0 |
| ITEM-PRICE- | 299 |
| CHF-B- | 2 |
| RGF- | 25 |
| CST- | 52 |
| CMB-AP- | 7 |
| SMSLOG/ | 810 |
| SINV- | 0 |
| CMB-FP-{{customer_name}}- | 1 |
| CMB-FP-customer_name- | 17 |
| PR | 0 |
| PE- | 12 |
| CMB-RF- | 0 |
| JV- | 0 |
| 11-SINV- | 0 |
| 12-SINV- | 4 |
| 22-SINV- | 10 |
| SINV-RET- | 0 |
| PO- | 0 |
| PREC- | 0 |
| PREC-RET- | 0 |
| PINV- | 0 |
| PINV-RET- | 0 |
| 11-APT- | 6 |
| 11-RFL- | 217 |
| 12-RFL- | 0 |
| 22-RFL- | 0 |
| 11-FWU- | 10254 |
| 12-FWU- | 0 |
| 22-FWU- | 0 |
| 12-APT- | 0 |
| 22-APT- | 0 |
| 11-REG- | 1429 |
| 12-REG- | 8 |
| 22-REG- | 0 |
| 11-PINV- | 12 |
| 12-PINV- | 0 |
| 22-PINV- | 0 |
| 11-PINV-RET- | 0 |
| 12-PINV-RET- | 0 |
| 22-PINV-RET- | 0 |
| 11-PREC- | 0 |
| 12-PREC- | 0 |
| 22-PREC- | 0 |
| 11-PREC-RET- | 0 |
| 12-PREC-RET- | 0 |
| 22-PREC-RET- | 0 |
| 11-PO- | 0 |
| 12-PO- | 0 |
| 22-PO- | 0 |
| 11-SINV-RET- | 0 |
| 12-SINV-RET- | 1 |
| 22-SINV-RET- | 1 |
| 11-DN- | 0 |
| 12-DN- | 0 |
| 22-DN- | 0 |
| 11-DN-RET- | 0 |
| 12-DN-RET- | 0 |
| 22-DN-RET- | 0 |
| 11-MREQ- | 0 |
| 12-MREQ- | 0 |
| 22-MREQ- | 0 |
| 11-PRO- | 0 |
| 12-PRO- | 0 |
| 22-PRO- | 0 |
| 11-QTN- | 0 |
| 12-QTN- | 0 |
| 22-QTN- | 0 |
| 11-SO- | 0 |
| 12-SO- | 0 |
| 22-SO- | 1 |
| 11-STE- | 70 |
| 12-STE- | 0 |
| 22-STE- | 65 |
| 11-SQTN- | 0 |
| 12-SQTN- | 0 |
| 22-SQTN- | 0 |
| 11-CUST- | 5 |
| 12-CUST- | 0 |
| 22-CUST- | 0 |
| 11-JV- | 523 |
| 22-JV- | 4 |
| I- | 101550 |
| RET- | 0 |
| OPTY- | 0 |
| INVTD | 8 |
| LEAD- | 1 |
| CS-{schedule_date}- | 1 |
| CS-schedule_date- | 2 |
| CS-{{schedule_date}}- | 2 |
| CS-13-06-17-max_occupancy- | 1 |
| CS-- | 2 |
| CS- | 11 |
| EV | 3 |
| BAT- | 0 |
| A- | 0 |
| A-RET- | 0 |
| AD- | 0 |
| 22-STE-00010- | 0 |
| 22-STE-00030- | 0 |
| LCV | 7 |
| 22-STE-00038- | 0 |
| 22-STE-00040- | 0 |
| 22-STE-00041- | 50 |
| 11-STE-00067- | 64 |
| 11-STE-00069- | 64 |
| 22-STE-00046- | 0 |
| 22-ST- | 2 |
| 22-STE-00050- | 0 |
| 22-STE-00054- | 0 |
| 22-STE-00055- | 0 |
+-----------------------------+---------+
117 rows in set (0.00 sec)
.
.
.
.
.
.
.
.
.
clarkej
September 11, 2017, 1:31pm
6
Please your feedback on my previous post…
clarkej
September 11, 2017, 2:38pm
7
This may clarify how to ‘separate’ the naming series for a given DocType.
Customizing naming series - #5 by Sangram
I am undecided which solution method is best practice…
mdwala
September 13, 2017, 3:21pm
8
Hi clarkej.
I dont get why I needs to change stock_entry.py or any other modification.
As per my attached snapshot everything is in standard way if should be.
Can you please explain why further modifications requires for new stock entry for different company using new naming series!
clarkej
September 14, 2017, 6:26am
9
"
As per my attached snapshot everything is in standard way if should be.
Can you please explain why further modifications requires for new stock entry for different company using new naming series!
"
I am not sure what you mean by standard way.
Please explain your way so we can troubleshoot why it does not work for you?
mdwala
September 14, 2017, 8:09am
10
Hi Clarkej,
Thanks for replying.
There are two naming series
11-STE-.#####.-.YY for Company A
22-STE-.#####.-.YY for Company B
Company A is having above 150 entry with 11-STE and using ##### in correct order.
I do not have any entry for 22-STE-.#####.-.YY yet.
But when doing stock entry for Company B with 22-STE-.#####.-.YY; it is using ##### as 22-STE-00055-17. I can’t understand why? It should be 22-STE-00001-17.
Naming series setup is as per instruction from user manual(Standard way).
Thanks again!
clarkej
September 14, 2017, 11:20am
11
Thanks for restating your problem mdwala
Now the big question…
Either of these two example series is possible (of course)
11-STE-00001-17
11-STE-00002-17
11-STE-00003-17
22-STE-00001-17
22-STE-00002-17
22-STE-00003-17
or this
11-STE-00001-17
11-STE-00002-17
11-STE-00003-17
22-STE-00004-17
22-STE-00005-17
22-STE-00006-17
But in your business case spec only one of them is ‘correct’ or ‘proper’
The question is which one?
My guess is you want or expect the first one but get the second one?
Of course I may be ‘wrong’
From what you tell or show me to now, I am not exactly sure
clarkej
September 14, 2017, 12:56pm
13
inspect your db for more clues where the problem may be
MariaDB [d56cb677eaab3383]> select name,current from tabSeries where name like'%STE%';
MariaDB [d56cb677eaab3383]> select name,naming_series from `tabStock Entry`;
Here’s an eg case Naming Series Current Value Is not Updating from naming series form - #5 by clarkej
mdwala
September 17, 2017, 1:22pm
14
both command gives
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘%s for update’ at line 1
mdwala
November 6, 2017, 6:32pm
15
We got wrong understanding while setting up naming series at beginning.
Series to be reset to 1 on prefix change: prefix to be requires prior “#####”
11-STE-.#####.-.YY is wrong
it should be
11-STE-.YY.-.#####
Our Submitted entries messed up because of this wrong setup, but at least found the issue.
mdwala:
Hi,
I have set two series in stock entry as
11-STE-.#####.-.YY
22-STE-.#####.-.YY
11-STE-.#####.-.YY is working properly and using correct serial numbers.
But with 22 I dont have any entry but when I save new stock entry it uses number above 52…
After deleting 22-STE-00052-17, when I go to naming series current value for 22-STE is still 0.
Clicking update series number with 0 doesnt change anything.
New stock entry still creates 53, I repeat same above, it creates 54!
What am I missing?
1 Like
clarkej
November 6, 2017, 6:58pm
16
Good problem solved - thanks for your followup learning mdwala
@mdwala
Sorry, I have not added documentation in frappe core while developing feature adding fields in naming series.
Its long overdue due to some other open issue with naming series.
Currently we can not add auto suffix like .YY.-INV-.###
Naming series need to move in frappe core from erpnext, so one can use it for custom app without having erpnext app.
Rules for naming to avoid special charter avoid from naming series as it break url
1 Like
mdwala
November 9, 2017, 5:06pm
18
@kolate_sambhaji
mdwala:
11-STE-.YY.-.#####
But as I mentioned it is working properly with above format.
Also didn’t get your 3rd point. What is special charter?
@mdwala You can not use .YY. in first place of naming series.
Also if you use slash “/” then URL will break when you share URL of document. Generally in Email we have URL for document. There are some URL encode mechanism we can do or we can avoid special charter from name
e.g for Invoice SBK/SINV/00001, url will be
erp.domain.com//desk#Form/Sales%20Invoice/SBK/SINV/00001
mdwala
November 9, 2017, 6:38pm
20
Why we can’t use .YY. as in my reply?
Is it issue with core? Or
Is it not possible? As It is already generating id for me properly at the moment.
@kolate_sambhaji