Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
10281 Vistas

Hello guys,

I did not find a reference on Google on how to change the pos_reference sequence on a pos receipt in Odoo 8?

You know this number like « Commande 00015-005-0009 ». This is not a ir.sequence.

Can you help please?


Avatar
Descartar
Mejor respuesta

Hi Pascal,

You are right this is not ir.sequence,

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.

 // Generates a public identification number for the order.
// The generated number must be unique and sequential. They are made 12 digit long
// to fit into EAN-13 barcodes, should it be needed
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);
},

You can make changes according to your need.

I am sure that it will help a lot.

Thanks.

Avatar
Descartar
Autor

Big thanks!

Hi Emipro

I am using odoo v12 with multi-company option, but I noticed that all my pos receipt order reference is simultaneous over all companies. so could you tell me how to separate this sequence, so that each pos will have it’s own sequence.?

Thanks a lot

Publicaciones relacionadas Respuestas Vistas Actividad
0
mar 15
3580
1
mar 15
8593
1
dic 24
1988
0
ago 24
1608
1
ago 24
2583