def test_get_next_order(self, dbsession): from autonomie.models.accounting.income_statement_measures import ( IncomeStatementMeasureTypeCategory, ) assert IncomeStatementMeasureTypeCategory.get_next_order() == 0 self.get_them(dbsession) assert IncomeStatementMeasureTypeCategory.get_next_order() == 5
def on_enable(self): """ on enable we set order to 1 """ order = IncomeStatementMeasureTypeCategory.get_next_order() self.context.order = order self.request.dbsession.merge(self.context)
def on_enable(self): """ on enable we set order to 1 """ order = IncomeStatementMeasureTypeCategory.get_next_order() self.context.order = order self.request.dbsession.merge(self.context)
def __init__(self, *args, **kwargs): AdminCrudListView.__init__(self, *args, **kwargs) self.max_order = IncomeStatementMeasureTypeCategory.get_next_order( ) - 1
def __init__(self, *args, **kwargs): AdminCrudListView.__init__(self, *args, **kwargs) self.max_order = IncomeStatementMeasureTypeCategory.get_next_order() - 1