[FIX] account: set payment_method_code as readonly

The payment method code is not supposed to be changed
from an `account.payment`.

Besides, this field is only used for technical reasons,
as stated:
```
Technical field used to adapt the interface to the payment type selected.
```

There is therefore no reason to not set it as readonly.

Not setting it as reandonly could lead to a `write`
operation on the `account.payment.method` with the value
of the code, even if this is already that one set, and
such an operation could be prevented by the access rights.

opw-668624
This commit is contained in:
Denis Ledoux
2016-02-03 18:35:43 +01:00
parent 93e8bf8ccf
commit 9fa73d10cf
+1 -1
View File
@@ -33,7 +33,7 @@ class account_abstract_payment(models.AbstractModel):
payment_type = fields.Selection([('outbound', 'Send Money'), ('inbound', 'Receive Money')], string='Payment Type', required=True)
payment_method_id = fields.Many2one('account.payment.method', string='Payment Type', required=True, oldname="payment_method")
payment_method_code = fields.Char(related='payment_method_id.code',
help="Technical field used to adapt the interface to the payment type selected.")
help="Technical field used to adapt the interface to the payment type selected.", readonly=True)
partner_type = fields.Selection([('customer', 'Customer'), ('supplier', 'Vendor')])
partner_id = fields.Many2one('res.partner', string='Partner')