Merge lp:~manu-tiedra/openerp-spain/6.1 into lp:~openerp-spain-team/openerp-spain/6.1

Proposed by Manu
Status: Merged
Merged at revision: 304
Proposed branch: lp:~manu-tiedra/openerp-spain/6.1
Merge into: lp:~openerp-spain-team/openerp-spain/6.1
Diff against target: 11 lines (+1/-0)
1 file modified
l10n_es_partner/partner_es.py (+1/-0)
To merge this branch: bzr merge lp:~manu-tiedra/openerp-spain/6.1
Reviewer Review Type Date Requested Status
Omar (Pexego) Approve
Review via email: mp+90318@code.launchpad.net

Description of the change

En la 6.1RC1 no se puede introducir un banco de España correctamente puesto que el campo code de res.bank ha desaparecido en la 6.1:

Server Traceback (most recent call last):
  File "/openerp/descargas/6.1RC1/openerp-6.1rc1-20120112-173907/openerp/addons/web/common/http.py", line 560, in send
    result = openerp.netsvc.dispatch_rpc(service_name, method, args)
  File "/openerp/descargas/6.1RC1/openerp-6.1rc1-20120112-173907/openerp/netsvc.py", line 325, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/openerp/descargas/6.1RC1/openerp-6.1rc1-20120112-173907/openerp/service/web_services.py", line 580, in dispatch
    res = fn(db, uid, *params)
  File "/openerp/descargas/6.1RC1/openerp-6.1rc1-20120112-173907/openerp/osv/osv.py", line 166, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/openerp/descargas/6.1RC1/openerp-6.1rc1-20120112-173907/openerp/osv/osv.py", line 120, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/openerp/descargas/6.1RC1/openerp-6.1rc1-20120112-173907/openerp/osv/osv.py", line 175, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/openerp/descargas/6.1RC1/openerp-6.1rc1-20120112-173907/openerp/osv/osv.py", line 163, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/openerp/descargas/6.1RC1/openerp-spain/l10n_es_partner/partner_es.py", line 89, in onchange_banco
    bank_ids = self.pool.get('res.bank').search(cr, uid, [('code','=',number[:4])], context=context)
  File "/openerp/descargas/6.1RC1/openerp-6.1rc1-20120112-173907/openerp/osv/orm.py", line 2230, in search
    return self._search(cr, user, args, offset=offset, limit=limit, order=order, context=context, count=count)
  File "/openerp/descargas/6.1RC1/openerp-6.1rc1-20120112-173907/openerp/osv/orm.py", line 4539, in _search
    query = self._where_calc(cr, user, args, context=context)
  File "/openerp/descargas/6.1RC1/openerp-6.1rc1-20120112-173907/openerp/osv/orm.py", line 4388, in _where_calc
    e = expression.expression(cr, user, domain, self, context)
  File "/openerp/descargas/6.1RC1/openerp-6.1rc1-20120112-173907/openerp/osv/expression.py", line 358, in __init__
    self.parse(cr, uid, distribute_not(normalize(exp)), table, context)
  File "/openerp/descargas/6.1RC1/openerp-6.1rc1-20120112-173907/openerp/osv/expression.py", line 454, in parse
    raise ValueError("Invalid field %r in domain expression %r" % (left, exp))
ValueError: Invalid field 'code' in domain expression ['&', ('active', '=', 1), ('code', '=', '0182')]

Simplemente añado el campo a la lista de los que la localización añade a res.bank

To post a comment you must log in.
Revision history for this message
lambdasoftware (lambdasoftware) wrote :

Parece que el campo code se ha sustituido por el campo bank_bic, por lo que quizás es mas correcto modificar el código del módulo para utilizar este campo y no el code (el xml y el .py).

Un saludo

Revision history for this message
Manu (manu-tiedra) wrote :

Hola,

el bic de un banco tiene la estructura:

The Bank Identifier Code, also known as a BIC or BIC code, is a universal method of identifying financial institutions in order to facilitate the automated processing of payments. Used to route cross-border (and some domestic payments) to a branch or payments centre, a Bank Identifier Code can handle the relevant transaction.

A BIC code consists of eight or eleven continuous characters comprising:

Bank Code 4 alphabetic characters identifying an individual bank, for example “DEUT” identifying Deutsche Bank
Country Code 2 letter ISO country code such as DE for Germany
Location Code 2 alphanumerical characters (except zero) identifying the location of the institution within the specific country such as FF for Frankfurt
Branch Code 3 alphanumeric characters, (optional) identifying the specific office or branch

El campo code se utilizaba para localizar el banco a partir de los 4 primeros dígitos del número de cuenta. No parece posible hacer lo mismo con el bic.

Revision history for this message
Omar (Pexego) (omar7r) wrote :

Hola Manu,

Acabo de hacer merge que justo me encontré con este problema ahora, no pude hacer merge normal debido a que las ramas son de distinta versión de bazaar pero bueno cité tu rama de todas formas.

Gracias.

review: Approve
Revision history for this message
Manu (manu-tiedra) wrote :

Gracias Omar.

Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Buenas, con este MP no se hizo correctamente el merge, quedando la rama colgada de manera indefinida, por lo que rogaría que se borrara la rama correspondiente para hacer limpieza de ramas.

Un saludo.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'l10n_es_partner/partner_es.py'
2--- l10n_es_partner/partner_es.py 2011-08-29 15:11:11 +0000
3+++ l10n_es_partner/partner_es.py 2012-01-26 19:19:25 +0000
4@@ -98,6 +98,7 @@
5 class Bank(osv.osv):
6 _inherit = 'res.bank'
7 _columns = {
8+ 'code': fields.char('Code', size=64),
9 'lname': fields.char('Long name', size=128),
10 'vat': fields.char('VAT code',size=32 ,help="Value Added Tax number"),
11 'website': fields.char('Website',size=64),