Exemplo n.º 1
0
 class Transitions:
     send = Transition(_("Send to Customer"), "draft", "open")
     payment = Transition(_("Customer payed"), 'open', 'payed')
     # edit = Transition( _("Edit invoice"), 'open', 'draft')
     cancel = Transition(_("Cancel"), ('draft', 'open'),
                         'cancelled',
                         validate=False)
Exemplo n.º 2
0
 class Transitions:
     trans1 = Transition('Transition 1', 'test1', 'test2')
     trans2 = Transition('Transition 2', ['test1', 'test2'],
                         'test3')
     trans3 = Transition('Transition 3', ['test2', 'test3'],
                         'test4')
     trans4 = Transition('Transition 4', 'test4', 'test5')
Exemplo n.º 3
0
 class Transitions:
     finish = Transition(
         _("Finish"),
         ["active"],
         "finished",
     )
     validate = Transition(
         _("Validate"),
         ["finished"],
         "validated",
         condition=validate_condition,
     )
Exemplo n.º 4
0
 class Transitions:
     start = Transition(
         _("Work on this task"),
         ["new", "hold", "open", "todo"],
         "started",
         condition=start_condition,
     )
     todo = Transition(
         _("Mark as todo"),
         ["new", "open", "started", "hold"],
         "todo",
     )
     hold = Transition(
         _("Set this task on hold"),
         ["new", "open", "started", "todo"],
         "hold",
     )
     stop = Transition(
         _("Stop working on this task"),
         "started",
         "open",
     )
     finish = Transition(
         _("Finish this task"),
         ["started", "open", "hold", "new", "review", "todo"],
         "finished",
         condition=finish_condition,
     )
     review = Transition(
         _("Set to review"),
         ["started", "open", "hold", "new", "todo"],
         "review",
     )
     reopen = Transition(
         _("Reopen this task"),
         ['finished', 'cancelled'],
         'open',
     )
     unreview = Transition(
         _("Reopen this task"),
         ['review'],
         'open',
     )
     cancel = Transition(
         _("Cancel this task"),
         ('new', 'hold', 'open', 'review'),
         'cancelled',
         condition=finish_condition,
     )
Exemplo n.º 5
0
    def test_transition(self):
        obj = Transition(b'name', 'from', 'to')
        self.assertEqual(obj.name, b"name")
        self.assertEqual(str(obj), "name")
        self.assertEqual(repr(obj), "<Transition: 'name'>")
        self.assertEqual(obj.sources, [
            "from",
        ])

        # may even add a object ... but why should you do it?
        obj = Transition('name', object, 'to')
        self.assertEqual(obj.sources, [
            object,
        ])

        obj = Transition('name', ['from1', 'from2'], 'to')
        self.assertEqual(obj.sources, [
            "from1",
            "from2",
        ])

        self.assertEqual(obj.affected_states(), ["from1", "from2", "to"])
Exemplo n.º 6
0
 class Transitions:
     send = Transition(_("Send to customer"), ["draft"], "send")
     accept = Transition(_("Quotation accepted by customer"), 'send',
                         'accepted')
     reopen = Transition(_("Reopen this quotation"), 'cancelled', 'draft')
     invoice = Transition(_("Generate invoice"), 'accepted', 'invoiced')
     revise = Transition(_("Revise this quotation"), ('send', 'accepted'),
                         'draft')
     cancel = Transition(_("Cancel"), ('draft', 'send', 'accepted'),
                         'cancelled',
                         validate=False)
Exemplo n.º 7
0
 class Transitions:
     go = Transition("go", "start", "end")
Exemplo n.º 8
0
 class Transitions:
     complete = Transition(_("Complete this Goal"), "open", "completed")
     cancel = Transition(_("Cancel this Goal"), "open", "cancelled", condition=cancel_condition)
     reopen = Transition(_("Reopen this Goal"), ["completed", "cancelled"], "open")
Exemplo n.º 9
0
 class Transitions:
     balance = Transition(_("Balance"), "open", "balanced")
     cancel = Transition(_("Cancel"), "open", "cancelled", validate=False)
Exemplo n.º 10
0
 class Transitions:
     user = Transition('Transition 1', 'test1', 'test2')
Exemplo n.º 11
0
 class Transitions:
     _test = Transition('Transition 1', 'test1', 'test2')
Exemplo n.º 12
0
 class Transitions:
     instance = Transition('Transition 1', 'test1', 'test2')
Exemplo n.º 13
0
 class Transitions:
     trans1 = Transition('Transition 1', 'test1', 'test3')