Example #1
0
 def on_recipient__validate(self, widget, recipient):
     if type(recipient) is Person:
         person = recipient
     else:
         person = recipient.person
     return StockOperationPersonValidationEvent.emit(
         person, type(recipient))
Example #2
0
    def on_client__validate(self, widget, client):
        if not client:
            return

        # this is used to avoid some tests from crashing
        if self.pm_slave is None:
            return

        method = self.pm_slave.get_selected_method()
        try:
            client.can_purchase(method, self.get_remaining_value())
        except SellError as e:
            return ValidationError(e)

        return StockOperationPersonValidationEvent.emit(client.person, type(client))
Example #3
0
    def on_client__validate(self, widget, client):
        if not client:
            return

        # this is used to avoid some tests from crashing
        if self.pm_slave is None:
            return

        method = self.pm_slave.get_selected_method()
        try:
            client.can_purchase(method, self.get_remaining_value())
        except SellError as e:
            return ValidationError(e)

        return StockOperationPersonValidationEvent.emit(
            client.person, type(client))
Example #4
0
 def on_client__validate(self, widget, client):
     return StockOperationPersonValidationEvent.emit(client.person, type(client))
Example #5
0
 def on_transporter_id__validate(self, widget, transporter_id):
     transporter = self.store.get(Transporter, transporter_id)
     return StockOperationPersonValidationEvent.emit(transporter.person, type(transporter))
Example #6
0
 def on_person__validate(self, widget, person_id):
     person = self.store.get(Person, person_id)
     return StockOperationPersonValidationEvent.emit(person, type(person))
Example #7
0
 def on_branch__validate(self, widget, branch):
     return StockOperationPersonValidationEvent.emit(
         branch.person, type(branch))
Example #8
0
 def on_transporter__validate(self, widget, transporter):
     return StockOperationPersonValidationEvent.emit(
         transporter.person, type(transporter))
Example #9
0
 def on_recipient__validate(self, widget, person):
     return StockOperationPersonValidationEvent.emit(person, type(person))
Example #10
0
 def on_person__validate(self, widget, person_id):
     person = self.store.get(Person, person_id)
     return StockOperationPersonValidationEvent.emit(person, type(person))
Example #11
0
 def on_branch__validate(self, widget, branch):
     return StockOperationPersonValidationEvent.emit(branch.person, type(branch))
Example #12
0
 def on_recipient__validate(self, widget, recipient):
     if type(recipient) is Person:
         person = recipient
     else:
         person = recipient.person
     return StockOperationPersonValidationEvent.emit(person, type(recipient))
Example #13
0
 def on_transporter__validate(self, widget, transporter):
     return StockOperationPersonValidationEvent.emit(transporter.person,
                                                     type(transporter))