Esempio n. 1
0
    def get_workflow_definition(cls):

        return {
            'draft': {
                'default': True,
                'allowed_to': ['quotation', 'cancelled']
            },
            'quotation': {
                'allowed_to': ['order', 'cancelled'],
                'validators':
                SchemaValidator(
                    cls.get_schema_definition(exclude=[
                        'customer', 'price_list', 'customer_address',
                        'delivery_address'
                    ]))
            },
            'order': {
                'validators':
                SchemaValidator(
                    cls.get_schema_definition(exclude=[
                        'customer', 'price_list', 'customer_address',
                        'delivery_address'
                    ]))
            },
            'cancelled': {},
        }
Esempio n. 2
0
            class Test(Mixin.WorkFlow):

                WORKFLOW = {
                    'draft': {
                        'default': True,
                        'allowed_to': ['done']
                    },
                    'done': {
                        'validators': SchemaValidator(MySchema())
                    },
                }
                id = Integer(primary_key=True)
                name = String()