0
votes

I need a field which adds a counter to a specific item i add in the product section of a custom module.

Like an automatic number generated by the system, for let's say Internal Reference, so every time i save a new product this field will create a number for it in this field, like IN0001, IN0002, IN0003, etc...

I've looked into the internet, searching for some example on how to achieve this in OpenErp but no luck.

Is there any module or already made function in OpenErp which has this behavior?

Thanks in advance

1

1 Answers

1
votes

there is a model called 'ir.sequence'. You can create a sequence type and sequence for your model and then just by calling the code of the sequence you will be able to generate new sequences