(self)
return super(L10nEsAeatMod347Report, self).button_confirm()
Different check out in report
Different check out in report
Different check out in report
def button_confirm(self):
        """Different check out in report"""
        for item in self:
            # Browse partner record lines to check if all are correct (all
            # fields filled)
            partner_errors = []
            for partner_record in item.partner_record_ids:
                if not partner_record.check_ok:
                    partner_errors.append(
                        _("- %s (%s)")
                        % (partner_record.partner_id.name, partner_record.partner_id.id)
                    )
            real_state_errors = []
            for real_estate_record in item.real_estate_record_ids:
                if not real_estate_record.check_ok:
                    real_state_errors.append(
                        _("- %s (%s)")
                        % (
                            real_estate_record.partner_id.name,
                            real_estate_record.partner_id.id,
                        )
                    )
            error = _(
                "Please review partner and real estate records, "
                "some of them are in red color:\n\n"
            )
            if partner_errors:
                error += _("Partner record errors:\n")
                error += "\n".join(partner_errors)
                error += "\n\n"
            if real_state_errors:
                error += _("Real estate record errors:\n")
                error += "\n".join(real_state_errors)
            if partner_errors or real_state_errors:
                raise exceptions.ValidationError(error)
        return super(L10nEsAeatMod347Report, self).button_confirm()
def button_confirm ( self ) : for item in self : # Browse partner record lines to check if all are correct (all # fields filled) partner_errors = [ ] for partner_record in item . partner_record_ids : if not partner_record . check_ok : partner_errors . append ( _ ( "- %s (%s)" ) % ( partner_record . partner_id . name , partner_record . partner_id . id ) ) real_state_errors = [ ] for real_estate_record in item . real_estate_record_ids : if not real_estate_record . check_ok : real_state_errors . append ( _ ( "- %s (%s)" ) % ( real_estate_record . partner_id . name , real_estate_record . partner_id . id , ) ) error = _ ( "Please review partner and real estate records, " "some of them are in red color:\n\n" ) if partner_errors : error += _ ( "Partner record errors:\n" ) error += "\n" . join ( partner_errors ) error += "\n\n" if real_state_errors : error += _ ( "Real estate record errors:\n" ) error += "\n" . join ( real_state_errors ) if partner_errors or real_state_errors : raise exceptions . ValidationError ( error ) return super ( L10nEsAeatMod347Report , self ) . button_confirm ( )