← Back to team overview

banking-addons-drivers team mailing list archive

Re: Fields communication and communication2

 

Hi Alexis,

I just did a quick check with and without account_banking_payment.

With standard account_payment, communication2 becomes read-only when state
is structured communication, and both communication and communication2 are
available when state is free. So that looks fine to me as we want to
restrict to one communication line when it is of type structured
communication and use both otherwise.

So I don't really understand why account_banking_payment disables
communication1 for free communication.

I would remove that behaviour from account_banking_payment.

Best regards,

-sbi


On Fri, Mar 21, 2014 at 4:29 PM, Alexis de Lattre <alexis@xxxxxxxxxx> wrote:

> Dear banking-addons community friends,
>
> In the account_payment module of the addons, there are 2 "communication"
> fields on the payment line :
> - 'communication': fields.char('Communication', size=64, required=True,
> help="Used as the message between ordering customer and current company.
> Depicts 'What do you want to say to the recipient about this order ?'"),
> - 'communication2': fields.char('Communication 2', size=64, help='The
> successor message of Communication.'),
>
> There is a field "state" which gives the choice between 2 communications
> types : Free (default) or Structured :
> 'state': fields.selection([('normal','Free'),
> ('structured','Structured')], 'Communication Type', required=True),
>
> At the end of the account_payment/account_payment.py file, there is this
> piece of oce :
>
>     def fields_get(self, cr, uid, fields=None, context=None):
>         res = super(payment_line, self).fields_get(cr, uid, fields,
> context)
>         if 'communication2' in res:
>             res['communication2'].setdefault('states', {})
>             res['communication2']['states']['structured'] = [('readonly',
> True)]
>             res['communication2']['states']['normal'] = [('readonly',
> False)]
>         return res
>
> As a consequence :
> - the field "communication" is usable when the communication type is
> "structured"
> - the field "communication2" is usable when the commnication type is "free"
> By the way, this is not explained at all in the "help" message of the
> communication fields !
>
> Currently, in the code of the SEPA modules, I only use the field
> "communication" (without taking into account the communication type) and I
> ignore the field communication2. This is a problem because, when the
> communication is "Free", the user cannot modify the field "communication",
> so he can't modify the value that will be used in the SEPA XML file.
>
> I see 2 options :
>
> 1) We think that the behavior of the module account_payment is good i.e.
> "communication" is used for structured and "communication2" is used for
> "free".
> => in the banking-addons, we should :
> - update the help messages of the 2 communication fields to explain their
> respective use case (and maybe also the label of the fields)
> - modify the code of the SEPA modules to use communication2 when type =
> Free and use communication when type = Structured.
>
> 2) We think that the behavior of the module account_payment is a mess, and
> we prefer to have a single "communication" field, that is used by the 2
> types.
> => in the banking-addons, we should :
> - hide the field communication2
> - neutralize the method fields_get() to avoid the readonly switch
> - maybe also inherit the creating of the payment line from the wizard to
> have the right value in the field communication.
>
> I would love to have your opinion on this. Once we reach an agreement, I
> can take care of updating the code.
>
> Regards,
>
> --
> Alexis de Lattre
>
>
> --
> Mailing list: https://launchpad.net/~banking-addons-drivers
> Post to     : banking-addons-drivers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~banking-addons-drivers
> More help   : https://help.launchpad.net/ListHelp
>

Follow ups

References