# Example on how to use sequences?

**URL:** https://discuss.tryton.org/t/example-on-how-to-use-sequences/4657
**Category:** Developer
**Created:** [September 27, 2021, 12:07pm UTC](https://discuss.tryton.org/t/example-on-how-to-use-sequences/4657 "2021-09-27T12:07:28Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![htgoebel](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/htgoebel/32/1256_2.png) [@htgoebel](https://discuss.tryton.org/u/htgoebel)
#### Post date: [September 27, 2021, 12:07pm UTC](https://discuss.tryton.org/t/example-on-how-to-use-sequences/4657/1 "2021-09-27T12:07:29Z")

</div>

My use-case is: “Booking” lines are collected in a “journal”. To allow an auditor to verify the list is complete, each line should get an unique number. AFAIU, Sequences are ment for this. (If there is a better solution, I’d be haapy to use that one.)

Is there some How-to or tutorial on Sequences? Otherwise: Which of the existing official modules is the best/simplest example for this?

More detailed requirements:

- Numbers shall be unique and consecutive per company (more precisely per “journal”, but there is only one journal per company)

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [September 27, 2021, 2:53pm UTC](https://discuss.tryton.org/t/example-on-how-to-use-sequences/4657/2 "2021-09-27T14:53:25Z")

</div>

The `post_number` of the accounting move does already that. If you need a sequence per journal, you must extend `Period.post_move_sequence_used` to work per journal. This can probably be done by adding the journal to the context of the `Move.period`.

---

<div class="post-metadata">

### Author: ![htgoebel](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/htgoebel/32/1256_2.png) [@htgoebel](https://discuss.tryton.org/u/htgoebel)
#### Post date: [September 28, 2021, 6:07am UTC](https://discuss.tryton.org/t/example-on-how-to-use-sequences/4657/3 "2021-09-28T06:07:16Z")

</div>

Thanks, I’ll have a look at this.
