diff options
| author | Christophe Chauvet <christophe.chauvet@syleam.fr> | 2008-11-22 01:05:33 +0100 |
|---|---|---|
| committer | Christophe Chauvet <christophe.chauvet@syleam.fr> | 2008-11-22 01:05:33 +0100 |
| commit | 82dda1fb71a945fc5d65ce8958f5379d4ab1c067 (patch) | |
| tree | cd057cc4c965eadb62da2b21fb43106eb6476bfb /bin/addons/base/ir/ir_sequence.py | |
| parent | f71e08d649da98cb433c3939282e6a930f5626e8 (diff) | |
[base]
* Add improvement into sequence variable
* new variable available
** %(y)s : Year without century (ex 08)
** %(doy)s : day of the year
** %(woy)s : week of the year
** %(weekday)s : day of the week (ex 0 -> Monday)
** %(h24)s : Hour [00->24]
** %(h12)s : Hour [00->12]
** %(min)s : Minutes
** %(sec)s : secondes
bzr revid: christophe.chauvet@syleam.fr-20081122000533-mlbpqulfrnxylove
Diffstat (limited to 'bin/addons/base/ir/ir_sequence.py')
| -rw-r--r-- | bin/addons/base/ir/ir_sequence.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/bin/addons/base/ir/ir_sequence.py b/bin/addons/base/ir/ir_sequence.py index 9a1fb16c2d7..7c160fe98da 100644 --- a/bin/addons/base/ir/ir_sequence.py +++ b/bin/addons/base/ir/ir_sequence.py @@ -55,7 +55,19 @@ class ir_sequence(osv.osv): } def _process(self, s): - return (s or '') % {'year':time.strftime('%Y'), 'month': time.strftime('%m'), 'day':time.strftime('%d')} + return (s or '') % { + 'year':time.strftime('%Y'), + 'month': time.strftime('%m'), + 'day':time.strftime('%d'), + 'y': time.strftime('%y'), + 'doy': time.strftime('%j'), + 'woy': time.strftime('%W'), + 'weekday': time.strftime('%w'), + 'h24': time.strftime('%H'), + 'h12': time.strftime('%I'), + 'min': time.strftime('%M'), + 'sec': time.strftime('%S'), + } def get_id(self, cr, uid, sequence_id, test='id=%d'): cr.execute('select id,number_next,number_increment,prefix,suffix,padding from ir_sequence where '+test+' and active=True FOR UPDATE', (sequence_id,)) |
