如何仅按小时和分钟添加序列?如果我在A
上写%(h24)s%(min)s
,则从配置中显示类似23461
prefix

答案 0 :(得分:0)
目前无法使用ir.sequence
的工作方式执行此操作。您需要扩展模型并添加功能以不显示实际的序列号(但这可能会破坏一起使用序列的目的,我会让您决定)。
class IrSequence(models.Model):
""" Sequence model.
The sequence model allows to define and use so-called sequence objects.
Such objects are used to generate unique identifiers in a transaction-safe
way.
"""
_inherit = 'ir.sequence'
skip = fields.Boolean('Skip Sequence Number', help='Mark to true to not display the sequence number in the sequence, only use the prefix/suffix.')
def _next(self):
"""
Override this to extend ir.sequence to not use the next
sequence number.
"""
...
def get_next_char(self, number_next):
"""
Override this to extend ir.sequence to not use the next
sequence number.
"""
...