summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Ledoux <dle@odoo.com>2016-02-03 18:31:09 +0100
committerDenis Ledoux <dle@odoo.com>2016-02-03 18:35:43 +0100
commit9fa73d10cf503c72b12d8421193b1981abba66ff (patch)
tree904ec6101d06e0ce30365ddd5b041fb2ea11a6d8
parent93e8bf8ccfb405a79377d1abaac0043f3d7f9157 (diff)
[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
-rw-r--r--addons/account/models/account_payment.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/account/models/account_payment.py b/addons/account/models/account_payment.py
index 6da8085e961..d9202d319fe 100644
--- a/addons/account/models/account_payment.py
+++ b/addons/account/models/account_payment.py
@@ -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')