summaryrefslogtreecommitdiff
path: root/addons/payment/models/payment_acquirer.py
diff options
context:
space:
mode:
authorXavier Morel <xmo@odoo.com>2018-12-06 10:46:57 +0000
committerXavier Morel <xmo@odoo.com>2018-12-07 13:37:34 +0000
commit66f0e26f6f3f2155fcfcc55e84f2e76cbfdb2c1d (patch)
tree7dbd4cbc827e8455eb4d8bd4013003b8069fc448 /addons/payment/models/payment_acquirer.py
parent299f9f1eb06f9df950df1dc02e368caa9b3a9871 (diff)
[CHG] *: make binary fields default to attachment=True
Check that it makes custom binary fields into attachment as that's the main reason for the change: when users create binary fields via Studio, they're necessarily db-stored (as the interface doesn't allow altering the attachment attribute and it's unclear how we'd handle users switching it on/off every time), which significantly bloats their database (and burns storage & backup space), especially as the primary use case for binary fields is adding images and documents to records. * check that binary fields are properly created as attachment=True * add attachment=False on fields where that seems relevant (most but not all of the fields previously using the default) * remove occurrences of attachment=True closes odoo/odoo#29308
Diffstat (limited to 'addons/payment/models/payment_acquirer.py')
-rw-r--r--addons/payment/models/payment_acquirer.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/addons/payment/models/payment_acquirer.py b/addons/payment/models/payment_acquirer.py
index 90d9177ff58..6918f80584f 100644
--- a/addons/payment/models/payment_acquirer.py
+++ b/addons/payment/models/payment_acquirer.py
@@ -150,15 +150,14 @@ class PaymentAcquirer(models.Model):
module_state = fields.Selection(selection=ir_module.STATES, string='Installation State', related='module_id.state', readonly=False)
image = fields.Binary(
- "Image", attachment=True,
- help="This field holds the image used for this provider, limited to 1024x1024px")
+ "Image", help="This field holds the image used for this provider, limited to 1024x1024px")
image_medium = fields.Binary(
- "Medium-sized image", attachment=True,
+ "Medium-sized image",
help="Medium-sized image of this provider. It is automatically "
"resized as a 128x128px image, with aspect ratio preserved. "
"Use this field in form views or some kanban views.")
image_small = fields.Binary(
- "Small-sized image", attachment=True,
+ "Small-sized image",
help="Small-sized image of this provider. It is automatically "
"resized as a 64x64px image, with aspect ratio preserved. "
"Use this field anywhere a small image is required.")
@@ -502,8 +501,7 @@ class PaymentIcon(models.Model):
name = fields.Char(string='Name')
acquirer_ids = fields.Many2many('payment.acquirer', string="Acquirers", help="List of Acquirers supporting this payment icon.")
image = fields.Binary(
- "Image", attachment=True,
- help="This field holds the image used for this payment icon, limited to 1024x1024px")
+ "Image", help="This field holds the image used for this payment icon, limited to 1024x1024px")
image_payment_form = fields.Binary(
"Image displayed on the payment form", attachment=True)