mirror of
https://github.com/bringout/oca-technical.git
synced 2026-04-18 21:52:03 +02:00
Initial commit: OCA Technical packages (595 packages)
This commit is contained in:
commit
2cc02aac6e
24950 changed files with 2318079 additions and 0 deletions
|
|
@ -0,0 +1,2 @@
|
|||
* Tom Blauwendraat <tom@sunflowerweb.nl>
|
||||
* Francesco Apruzzese <cescoap@gmail.com>
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
This module allows to generate a sequence by a Python formula expression.
|
||||
|
||||
Besides common Python functions and operators, it provides several functions
|
||||
like 'random' and 'uuid' in the expression, as well as variables such as the
|
||||
next number in the sequence. These are also listed next to the input field
|
||||
on the sequence form view.
|
||||
|
||||
If you want to add more variables for use in the expression, you can extend
|
||||
this module.
|
||||
|
||||
Use cases for this module could be:
|
||||
|
||||
- You want to generate alphanumeric numbering
|
||||
- You want to apply some math to the number to prevent customers from knowing
|
||||
their place in the sequence
|
||||
- You want to use UUID
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
To use this module, you need to:
|
||||
|
||||
* Go to the form view of an `ir.sequence` record
|
||||
* Go to the Python tab
|
||||
* Enable the 'Use Python' checkbox
|
||||
* Change the default 'number' expression to something more fancy.
|
||||
|
||||
Examples:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
# To separate the Odoo-generated number with hyphens eg. 0-0-0-0-1
|
||||
'-'.join(number_padded)
|
||||
|
||||
# To have an UUID as the sequence value
|
||||
uuid.uuid4().hex
|
||||
|
||||
# To use an 8-digit binary number
|
||||
'{0:#010b}'.format(number + 300)[2:]
|
||||
|
||||
And so on.
|
||||
Loading…
Add table
Add a link
Reference in a new issue