Ejemplo n.º 1
0
    def onchange_bic(self, cr, uid, ids, bic, name, context=None):

        if not bic:
            return {}

        info, address = online.bank_info(bic)
        if not info:
            return {}

        if address and address.country_id:
            country_ids = self.pool.get('res.country').search(
                cr, uid, [('code', '=', address.country_id)])
            country_id = country_ids[0] if country_ids else False
        else:
            country_id = False

        return {
            'value':
            dict(
                # Only the first eight positions of BIC are used for bank
                # transfers, so ditch the rest.
                bic=info.bic[:8],
                street=address.street,
                street2=address.get('street2', False),
                zip=address.zip,
                city=address.city,
                country=country_id,
                name=name or info.name,
            )
        }
Ejemplo n.º 2
0
    def onchange_bic(
            self, cr, uid, ids, bic, name, context=None):

        if not bic:
            return {}

        info, address = online.bank_info(bic)
        if not info:
            return {}

        if address and address.country_id:
            country_ids = self.pool.get('res.country').search(
                cr, uid, [('code', '=', address.country_id)])
            country_id = country_ids[0] if country_ids else False
        else:
            country_id = False

        return {
            'value': dict(
                # Only the first eight positions of BIC are used for bank
                # transfers, so ditch the rest.
                bic=info.bic[:8],
                street=address.street,
                street2=address.get('street2', False),
                zip=address.zip,
                city=address.city,
                country=country_id,
                name=name or info.name,
            )
        }
Ejemplo n.º 3
0
 def online_bank_info(self, cr, uid, bic, context=None):
     """
     Overwrite existing API hook from account_banking
     """
     return online.bank_info(bic)
Ejemplo n.º 4
0
 def online_bank_info(self, cr, uid, bic, context=None):
     """
     Overwrite existing API hook from account_banking
     """
     return online.bank_info(bic)