Ejemplo n.º 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))
Ejemplo n.º 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))
Ejemplo n.º 3
0
 def on_transporter__validate(self, widget, transporter):
     return StockOperationPersonValidationEvent.emit(
         transporter.person, type(transporter))
Ejemplo n.º 4
0
 def on_client__validate(self, widget, client):
     return StockOperationPersonValidationEvent.emit(
         client.person, type(client))
Ejemplo n.º 5
0
 def on_person__validate(self, widget, person_id):
     person = self.store.get(Person, person_id)
     return StockOperationPersonValidationEvent.emit(person, type(person))
Ejemplo n.º 6
0
 def on_branch__validate(self, widget, branch):
     return StockOperationPersonValidationEvent.emit(
         branch.person, type(branch))
Ejemplo n.º 7
0
 def on_transporter_id__validate(self, widget, transporter_id):
     transporter = self.store.get(Transporter, transporter_id)
     return StockOperationPersonValidationEvent.emit(
         transporter.person, type(transporter))