示例#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))
示例#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))
示例#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))
示例#4
0
 def on_client__validate(self, widget, client):
     return StockOperationPersonValidationEvent.emit(client.person, type(client))
示例#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))
示例#6
0
 def on_person__validate(self, widget, person_id):
     person = self.store.get(Person, person_id)
     return StockOperationPersonValidationEvent.emit(person, type(person))
示例#7
0
 def on_branch__validate(self, widget, branch):
     return StockOperationPersonValidationEvent.emit(
         branch.person, type(branch))
示例#8
0
 def on_transporter__validate(self, widget, transporter):
     return StockOperationPersonValidationEvent.emit(
         transporter.person, type(transporter))
示例#9
0
 def on_recipient__validate(self, widget, person):
     return StockOperationPersonValidationEvent.emit(person, type(person))
示例#10
0
 def on_person__validate(self, widget, person_id):
     person = self.store.get(Person, person_id)
     return StockOperationPersonValidationEvent.emit(person, type(person))
示例#11
0
 def on_branch__validate(self, widget, branch):
     return StockOperationPersonValidationEvent.emit(branch.person, type(branch))
示例#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))
示例#13
0
 def on_transporter__validate(self, widget, transporter):
     return StockOperationPersonValidationEvent.emit(transporter.person,
                                                     type(transporter))