In odoo 8,there is a field named Receipt Ref
(technical name pos_referance
. I want to know about how this value is created.
For eg: If pos_referance
is 27574-004-04-0003 , what does 27574
, 004
, 04
and 0003
stands for ?
Asked
Active
Viewed 368 times
1 Answers
1
This number is generated from the JavaScript file located at addons/point_of_sale/static/src/js/models.js
In this file you can find one model names "Order", inside this model one method is there which is responsible for this sequence. Please have a look below for that method.
generateUniqueId: function() {
function zero_pad(num,size){
var s = ""+num;
while (s.length < size) {
s = "0" + s;
}
return s;
}
return zero_pad(this.pos.pos_session.id,5) +'-'+
zero_pad(this.pos.pos_session.login_number,3) +'-'+
zero_pad(this.sequence_number,4);
},

Suhindra
- 355
- 2
- 10
-
`login_number` means.. ? And can you give a brief explaination on the above code.(I don't know js) @Suhindra – vbt May 23 '18 at 04:43
-
1login_number means a sequence number that is incremented each time a user resumes the pos session – Suhindra May 23 '18 at 05:05
-
`sequence_number` means .? Please help me on this also .. Thanks in Advance... @Suhindra – vbt May 23 '18 at 06:56
-
1sequence_number = a session-unique sequence number for the order – Suhindra May 23 '18 at 07:41
-
Thanks Man.. @Suhindra – vbt May 23 '18 at 09:13