-
+
|
${object.user_id.name}
@@ -203,7 +203,7 @@
-
+
|
${object.user_id.name}
diff --git a/addons/hr_recruitment/views/hr_recruitment_views.xml b/addons/hr_recruitment/views/hr_recruitment_views.xml
index 3b49ef198b7..2cc46130e01 100644
--- a/addons/hr_recruitment/views/hr_recruitment_views.xml
+++ b/addons/hr_recruitment/views/hr_recruitment_views.xml
@@ -339,7 +339,7 @@
-
+
diff --git a/addons/hr_timesheet/views/hr_timesheet_views.xml b/addons/hr_timesheet/views/hr_timesheet_views.xml
index 9aef1401601..131a8dbe565 100644
--- a/addons/hr_timesheet/views/hr_timesheet_views.xml
+++ b/addons/hr_timesheet/views/hr_timesheet_views.xml
@@ -148,7 +148,7 @@
- ![]()
+
diff --git a/addons/hr_work_entry/views/hr_work_entry_views.xml b/addons/hr_work_entry/views/hr_work_entry_views.xml
index d8bd3acb375..dc8209ad3e4 100644
--- a/addons/hr_work_entry/views/hr_work_entry_views.xml
+++ b/addons/hr_work_entry/views/hr_work_entry_views.xml
@@ -29,7 +29,7 @@
event_limit="5">
-
+
diff --git a/addons/im_livechat/models/im_livechat_channel.py b/addons/im_livechat/models/im_livechat_channel.py
index 920ad6ecb90..ed7a6a73252 100644
--- a/addons/im_livechat/models/im_livechat_channel.py
+++ b/addons/im_livechat/models/im_livechat_channel.py
@@ -4,7 +4,7 @@ import base64
import random
import re
-from odoo import api, fields, models, modules, tools
+from odoo import api, fields, models, modules
class ImLivechatChannel(models.Model):
@@ -21,7 +21,7 @@ class ImLivechatChannel(models.Model):
def _default_image(self):
image_path = modules.get_module_resource('im_livechat', 'static/src/img', 'default.png')
- return tools.image_process(base64.b64encode(open(image_path, 'rb').read()), size=tools.IMAGE_BIG_SIZE)
+ return base64.b64encode(open(image_path, 'rb').read())
def _default_user_ids(self):
return [(6, 0, [self._uid])]
@@ -42,17 +42,7 @@ class ImLivechatChannel(models.Model):
script_external = fields.Text('Script (external)', compute='_compute_script_external', store=False, readonly=True)
nbr_channel = fields.Integer('Number of conversation', compute='_compute_nbr_channel', store=False, readonly=True)
- # images fields
- image = fields.Binary('Image', default=_default_image,
- help="This field holds the image used as photo for the group, limited to 1024x1024px.")
- image_medium = fields.Binary('Medium',
- help="Medium-sized photo of the group. 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('Thumbnail',
- help="Small-sized photo of the group. It is automatically "\
- "resized as a 64x64px image, with aspect ratio preserved. "\
- "Use this field anywhere a small image is required.")
+ image_128 = fields.Image("Image", max_width=128, max_height=128, default=_default_image)
# relationnal fields
user_ids = fields.Many2many('res.users', 'im_livechat_channel_im_user', 'channel_id', 'user_id', string='Operators', default=_default_user_ids)
@@ -83,15 +73,6 @@ class ImLivechatChannel(models.Model):
for record in self:
record.nbr_channel = len(record.channel_ids)
- @api.model
- def create(self, vals):
- tools.image_resize_images(vals)
- return super(ImLivechatChannel, self).create(vals)
-
- def write(self, vals):
- tools.image_resize_images(vals)
- return super(ImLivechatChannel, self).write(vals)
-
# --------------------------
# Action Methods
# --------------------------
diff --git a/addons/im_livechat/views/im_livechat_channel_views.xml b/addons/im_livechat/views/im_livechat_channel_views.xml
index eb5503dca1c..807bc64a7c7 100644
--- a/addons/im_livechat/views/im_livechat_channel_views.xml
+++ b/addons/im_livechat/views/im_livechat_channel_views.xml
@@ -33,7 +33,7 @@
- ![Channel]()
+
@@ -87,7 +87,7 @@
-
+
@@ -105,7 +105,7 @@
- ![User]()
+
diff --git a/addons/im_livechat/views/mail_channel_views.xml b/addons/im_livechat/views/mail_channel_views.xml
index 15041f566c7..ac2dd35ce6d 100644
--- a/addons/im_livechat/views/mail_channel_views.xml
+++ b/addons/im_livechat/views/mail_channel_views.xml
@@ -39,7 +39,7 @@
diff --git a/addons/lunch/views/lunch_cashmove_views.xml b/addons/lunch/views/lunch_cashmove_views.xml
index dec3bbf9e50..d1cafa0e47b 100644
--- a/addons/lunch/views/lunch_cashmove_views.xml
+++ b/addons/lunch/views/lunch_cashmove_views.xml
@@ -77,7 +77,7 @@
- ![]()
+
diff --git a/addons/lunch/views/lunch_orders_views.xml b/addons/lunch/views/lunch_orders_views.xml
index 0995e6cf484..ef79c6c7b24 100644
--- a/addons/lunch/views/lunch_orders_views.xml
+++ b/addons/lunch/views/lunch_orders_views.xml
@@ -88,7 +88,7 @@
- ![]()
+
diff --git a/addons/lunch/views/lunch_product_views.xml b/addons/lunch/views/lunch_product_views.xml
index 6c69f416c68..e328753add1 100644
--- a/addons/lunch/views/lunch_product_views.xml
+++ b/addons/lunch/views/lunch_product_views.xml
@@ -46,7 +46,7 @@
-
+
@@ -89,7 +89,7 @@
+ t-attf-style="background-image:url('#{kanban_image('lunch.product', 'image_128', record.product_id.raw_value)}')"/>
@@ -137,7 +137,7 @@
+ t-attf-style="background-image:url('#{kanban_image('lunch.product', 'image_128', record.id.raw_value)}')"/>
diff --git a/addons/lunch/wizard/lunch_line_wizard.py b/addons/lunch/wizard/lunch_line_wizard.py
index 3678449a615..4bdc3b1eb7c 100644
--- a/addons/lunch/wizard/lunch_line_wizard.py
+++ b/addons/lunch/wizard/lunch_line_wizard.py
@@ -47,9 +47,8 @@ class LunchOrderWizard(models.TransientModel):
available_toppings_2 = fields.Boolean(help='Are extras available for this product', compute='_compute_available_toppings')
available_toppings_3 = fields.Boolean(help='Are extras available for this product', compute='_compute_available_toppings')
- image = fields.Binary(related='product_id.image')
- image_medium = fields.Binary(related='product_id.image_medium')
- image_small = fields.Binary(related='product_id.image_small')
+ image_1920 = fields.Image(related='product_id.image_1920')
+ image_128 = fields.Image(related='product_id.image_128')
quantity = fields.Float('Quantity', default=1)
price_total = fields.Float('Total Price', compute='_compute_price_total')
diff --git a/addons/lunch/wizard/lunch_line_wizard_views.xml b/addons/lunch/wizard/lunch_line_wizard_views.xml
index 94afac2e5f4..7c8879f452d 100644
--- a/addons/lunch/wizard/lunch_line_wizard_views.xml
+++ b/addons/lunch/wizard/lunch_line_wizard_views.xml
@@ -16,7 +16,7 @@
-
+
diff --git a/addons/mail/controllers/main.py b/addons/mail/controllers/main.py
index b540d428ba0..bc20f0caac5 100644
--- a/addons/mail/controllers/main.py
+++ b/addons/mail/controllers/main.py
@@ -241,7 +241,7 @@ class MailController(http.Controller):
request.env[res_model].browse(res_id).check_access_rule('read')
if partner_id in request.env[res_model].browse(res_id).sudo().exists().message_ids.mapped('author_id').ids:
status, headers, _content = request.env['ir.http'].sudo().binary_content(
- model='res.partner', id=partner_id, field='image_medium', default_mimetype='image/png')
+ model='res.partner', id=partner_id, field='image_128', default_mimetype='image/png')
# binary content return an empty string and not a placeholder if obj[field] is False
if _content != '':
content = _content
diff --git a/addons/mail/models/mail_channel.py b/addons/mail/models/mail_channel.py
index 2b56951fb4f..974897c3c1c 100644
--- a/addons/mail/models/mail_channel.py
+++ b/addons/mail/models/mail_channel.py
@@ -12,7 +12,6 @@ from odoo import _, api, fields, models, modules, tools
from odoo.exceptions import UserError, ValidationError
from odoo.osv import expression
from odoo.tools import ormcache
-from odoo.tools.safe_eval import safe_eval
MODERATION_FIELDS = ['moderation', 'moderator_ids', 'moderation_ids', 'moderation_notify', 'moderation_notify_msg', 'moderation_guidelines', 'moderation_guidelines_msg']
_logger = logging.getLogger(__name__)
@@ -64,7 +63,7 @@ class Channel(models.Model):
def _get_default_image(self):
image_path = modules.get_module_resource('mail', 'static/src/img', 'groupdefault.png')
- return tools.image_process(base64.b64encode(open(image_path, 'rb').read()), size=tools.IMAGE_BIG_SIZE)
+ return base64.b64encode(open(image_path, 'rb').read())
@api.model
def default_get(self, fields):
@@ -101,17 +100,7 @@ class Channel(models.Model):
help="Members of those groups will automatically added as followers. "
"Note that they will be able to manage their subscription manually "
"if necessary.")
- # image: all image fields are base64 encoded and PIL-supported
- image = fields.Binary("Photo", default=_get_default_image,
- help="This field holds the image used as photo for the group, limited to 1024x1024px.")
- image_medium = fields.Binary('Medium-sized photo',
- help="Medium-sized photo of the group. 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 photo',
- help="Small-sized photo of the group. It is automatically "
- "resized as a 64x64px image, with aspect ratio preserved. "
- "Use this field anywhere a small image is required.")
+ image_128 = fields.Image("Image", max_width=128, max_height=128, default=_get_default_image)
is_subscribed = fields.Boolean(
'Is Subscribed', compute='_compute_is_subscribed')
# moderation
@@ -209,11 +198,10 @@ class Channel(models.Model):
@api.model
def create(self, vals):
# ensure image at quick create
- if not vals.get('image'):
- defaults = self.default_get(['image'])
- vals['image'] = defaults['image']
+ if not vals.get('image_128'):
+ defaults = self.default_get(['image_128'])
+ vals['image_128'] = defaults['image_128']
- tools.image_resize_images(vals)
# Create channel and alias
channel = super(Channel, self.with_context(
alias_model_name=self._name, alias_parent_model_name=self._name, mail_create_nolog=True, mail_create_nosubscribe=True)
@@ -250,7 +238,6 @@ class Channel(models.Model):
if not self.env.user.has_group('base.group_system'):
raise UserError("You do not possess the rights to modify fields related to moderation on one of the channels you are modifying.")
- tools.image_resize_images(vals)
result = super(Channel, self).write(vals)
if vals.get('group_ids'):
diff --git a/addons/mail/models/mail_message.py b/addons/mail/models/mail_message.py
index 229fdb943eb..38426d629bd 100644
--- a/addons/mail/models/mail_message.py
+++ b/addons/mail/models/mail_message.py
@@ -79,7 +79,7 @@ class Message(models.Model):
'res.partner', 'Author', index=True,
ondelete='set null', default=_get_default_author,
help="Author of the message. If not set, email_from may hold an email address that did not match any partner.")
- author_avatar = fields.Binary("Author's avatar", related='author_id.image_small', readonly=False)
+ author_avatar = fields.Binary("Author's avatar", related='author_id.image_64', readonly=False)
# recipients: include inactive partners (they may have been archived after
# the message was sent, but they should remain visible in the relation)
partner_ids = fields.Many2many('res.partner', string='Recipients', context={'active_test': False})
diff --git a/addons/mail/static/src/js/composers/basic_composer.js b/addons/mail/static/src/js/composers/basic_composer.js
index 2a496faf86d..d79a7c93028 100644
--- a/addons/mail/static/src/js/composers/basic_composer.js
+++ b/addons/mail/static/src/js/composers/basic_composer.js
@@ -100,7 +100,7 @@ var BasicComposer = Widget.extend({
this.avatarURL = session.uid > 0 ? session.url('/web/image', {
model: 'res.users',
- field: 'image_small',
+ field: 'image_64',
id: session.uid,
}) : '/web/static/src/img/user_menu_avatar.png';
},
diff --git a/addons/mail/static/src/js/followers.js b/addons/mail/static/src/js/followers.js
index 751187608ae..b6dc5ff6996 100644
--- a/addons/mail/static/src/js/followers.js
+++ b/addons/mail/static/src/js/followers.js
@@ -36,7 +36,7 @@ var Followers = AbstractField.extend({
init: function (parent, name, record, options) {
this._super.apply(this, arguments);
- this.image = this.attrs.image || 'image_small';
+ this.image = this.attrs.image || 'image_64';
this.comment = this.attrs.help || false;
this.followers = [];
@@ -120,7 +120,7 @@ var Followers = AbstractField.extend({
}
$follower_li = $(QWeb.render('mail.Followers.partner', {
- 'record': _.extend(record, {'avatar_url': '/web/image/' + record.res_model + '/' + record.res_id + '/image_small'}),
+ 'record': _.extend(record, {'avatar_url': '/web/image/' + record.res_model + '/' + record.res_id + '/image_64'}),
'widget': self})
);
$follower_li.appendTo($followers_list);
diff --git a/addons/mail/static/src/js/models/messages/message.js b/addons/mail/static/src/js/models/messages/message.js
index f93209a913f..d22569461e5 100644
--- a/addons/mail/static/src/js/models/messages/message.js
+++ b/addons/mail/static/src/js/models/messages/message.js
@@ -94,7 +94,7 @@ var Message = AbstractMessage.extend(Mixins.EventDispatcherMixin, ServicesMixin
if (this._isOdoobotAuthor()) {
return '/mail/static/src/img/odoobot.png';
} else if (this.hasAuthor()) {
- return '/web/image/res.partner/' + this.getAuthorID() + '/image_small';
+ return '/web/image/res.partner/' + this.getAuthorID() + '/image_64';
} else if (this.getType() === 'email') {
return '/mail/static/src/img/email_icon.png';
}
diff --git a/addons/mail/static/src/js/models/threads/channel.js b/addons/mail/static/src/js/models/threads/channel.js
index 9e9f3ac6a39..83a0a259e94 100644
--- a/addons/mail/static/src/js/models/threads/channel.js
+++ b/addons/mail/static/src/js/models/threads/channel.js
@@ -220,7 +220,7 @@ var Channel = SearchableThread.extend(ThreadTypingMixin, {
getPreview: function () {
var result = this._super.apply(this, arguments);
if (!this.isTwoUserThread()) {
- result.imageSRC = '/web/image/mail.channel/' + this.getID() + '/image_small';
+ result.imageSRC = '/web/image/mail.channel/' + this.getID() + '/image_128';
}
var lastMessage = this.getLastMessage();
return _.extend(result, {
diff --git a/addons/mail/static/src/js/models/threads/dm_chat.js b/addons/mail/static/src/js/models/threads/dm_chat.js
index 78cc01a7044..b53637e614b 100644
--- a/addons/mail/static/src/js/models/threads/dm_chat.js
+++ b/addons/mail/static/src/js/models/threads/dm_chat.js
@@ -91,7 +91,7 @@ var DMChat = TwoUserChannel.extend(ChannelSeenMixin, {
*/
getPreview: function () {
var result = this._super.apply(this, arguments);
- result.imageSRC = '/web/image/res.partner/' + this.getDirectPartnerID() + '/image_small';
+ result.imageSRC = '/web/image/res.partner/' + this.getDirectPartnerID() + '/image_64';
return result;
},
/**
diff --git a/addons/mail/static/src/xml/activity.xml b/addons/mail/static/src/xml/activity.xml
index 11b4b0e9022..d399439d79e 100644
--- a/addons/mail/static/src/xml/activity.xml
+++ b/addons/mail/static/src/xml/activity.xml
@@ -17,7 +17,7 @@
@@ -660,7 +660,7 @@
- ![]()
+
diff --git a/addons/mrp/data/mrp_demo.xml b/addons/mrp/data/mrp_demo.xml
index 6f6c7db8e07..5c9311f332e 100644
--- a/addons/mrp/data/mrp_demo.xml
+++ b/addons/mrp/data/mrp_demo.xml
@@ -175,7 +175,7 @@
Solid wood table.
FURN_9666
serial
-
+
Table Top
@@ -189,7 +189,7 @@
Solid wood is a durable natural material.
FURN_8522
serial
-
+
Table Leg
@@ -203,7 +203,7 @@
18″ x 2½″ Square Leg
FURN_2333
lot
-
+
Bolt
@@ -216,7 +216,7 @@
Stainless steel screw full (dia - 5mm, Length - 10mm)
CONS_89957
-
+
Screw
@@ -229,7 +229,7 @@
Stainless steel screw
CONS_25630
-
+
@@ -243,7 +243,7 @@
Layers that are stick together to assemble wood panels.
FURN_7111
-
+
Wear Layer
@@ -256,7 +256,7 @@
Top layer of a wood panel.
FURN_8111
-
+
Ply Veneer
@@ -268,7 +268,7 @@
FURN_9111
-
+
@@ -281,7 +281,7 @@
FURN_7023
-
+
Plastic Laminate
@@ -293,7 +293,7 @@
FURN_8621
-
+
@@ -423,7 +423,7 @@
Table kit
FURN_78236
-
+
@@ -467,7 +467,7 @@
Drawer on casters for great usability.
FURN_2100
601647855646
-
+
@@ -482,7 +482,7 @@
FURN_5623
601647855647
-
+
diff --git a/addons/mrp/views/ir_attachment_view.xml b/addons/mrp/views/ir_attachment_view.xml
index 415ae3a5233..98104a35446 100644
--- a/addons/mrp/views/ir_attachment_view.xml
+++ b/addons/mrp/views/ir_attachment_view.xml
@@ -37,7 +37,7 @@
- ![]()
+
diff --git a/addons/mrp/views/mrp_workorder_views.xml b/addons/mrp/views/mrp_workorder_views.xml
index 21f08de5eda..9c7538b15cf 100644
--- a/addons/mrp/views/mrp_workorder_views.xml
+++ b/addons/mrp/views/mrp_workorder_views.xml
@@ -389,7 +389,7 @@
-
+
diff --git a/addons/note/views/note_views.xml b/addons/note/views/note_views.xml
index 72cf447c597..f27497b43d7 100644
--- a/addons/note/views/note_views.xml
+++ b/addons/note/views/note_views.xml
@@ -122,7 +122,7 @@
-
+
diff --git a/addons/partner_autocomplete/static/src/js/partner_autocomplete_fieldchar.js b/addons/partner_autocomplete/static/src/js/partner_autocomplete_fieldchar.js
index c1fab81a194..69a1332122e 100644
--- a/addons/partner_autocomplete/static/src/js/partner_autocomplete_fieldchar.js
+++ b/addons/partner_autocomplete/static/src/js/partner_autocomplete_fieldchar.js
@@ -115,7 +115,7 @@ var FieldAutocomplete = FieldChar.extend(AutocompleteMixin, {
var self = this;
this._getCreateData(company).then(function (data) {
if (data.logo) {
- var logoField = self.model === 'res.partner' ? 'image' : 'logo';
+ var logoField = self.model === 'res.partner' ? 'image_1920' : 'logo';
data.company[logoField] = data.logo;
}
diff --git a/addons/partner_autocomplete/static/tests/partner_autocomplete_tests.js b/addons/partner_autocomplete/static/tests/partner_autocomplete_tests.js
index b524dba75a6..c605c9bc33c 100644
--- a/addons/partner_autocomplete/static/tests/partner_autocomplete_tests.js
+++ b/addons/partner_autocomplete/static/tests/partner_autocomplete_tests.js
@@ -15,7 +15,7 @@ odoo.define('partner_autocomplete.tests', function (require) {
_.each(createData, function (val, key) {
if (fields[key]) {
- if (key === 'image') {
+ if (key === 'image_1920') {
if (val) val = 'data:image/png;base64,' + val;
assert.hasAttrValue(form.$(".o_field_image img"), "data-src", val, 'image value should have been updated to "' + val + '"');
} else {
@@ -123,7 +123,7 @@ odoo.define('partner_autocomplete.tests', function (require) {
name: {string: "Name", type: "char", searchable: true},
parent_id: {string: "Company", type: "many2one", relation: "res.partner"},
website: {string: "Website", type: "char", searchable: true},
- image: {string: "Image", type: "binary", searchable: true},
+ image_1920: {string: "Image", type: "binary", searchable: true},
email: {string: "Email", type: "char", searchable: true},
phone: {string: "Phone", type: "char", searchable: true},
street: {string: "Street", type: "char", searchable: true},
@@ -163,7 +163,7 @@ odoo.define('partner_autocomplete.tests', function (require) {
' ' +
' ' +
' ' +
- ' ' +
+ ' ' +
'',
}).then(function (form){
// Set company type to Individual
@@ -198,7 +198,7 @@ odoo.define('partner_autocomplete.tests', function (require) {
' ' +
' ' +
' ' +
- ' ' +
+ ' ' +
' ' +
' ' +
' ' +
@@ -272,7 +272,7 @@ odoo.define('partner_autocomplete.tests', function (require) {
' ' +
' ' +
' ' +
- ' ' +
+ ' ' +
' ' +
' ' +
' ' +
diff --git a/addons/payment/data/payment_acquirer_data.xml b/addons/payment/data/payment_acquirer_data.xml
index b9040c22757..8ff2324d2a7 100644
--- a/addons/payment/data/payment_acquirer_data.xml
+++ b/addons/payment/data/payment_acquirer_data.xml
@@ -14,7 +14,7 @@
Buckaroo
-
+
@@ -38,7 +38,7 @@
Ingenico
2
-
+
@@ -61,7 +61,7 @@
Adyen
-
+
@@ -87,7 +87,7 @@
Authorize.net
3
-
+
@@ -114,7 +114,7 @@
Wire Transfer
2
-
+
<i>Pending</i>... The order will be validated after the payment.
@@ -127,7 +127,7 @@
Sips
-
+
@@ -154,7 +154,7 @@
Paypal
1
-
+
@@ -179,7 +179,7 @@
Stripe
-
+
@@ -222,7 +222,7 @@
PayUmoney
-
+
@@ -245,7 +245,7 @@
PayU Latam
-
+
@@ -267,7 +267,7 @@
Alipay
-
+
diff --git a/addons/payment/models/payment_acquirer.py b/addons/payment/models/payment_acquirer.py
index 6595a40399f..5c3f2135590 100644
--- a/addons/payment/models/payment_acquirer.py
+++ b/addons/payment/models/payment_acquirer.py
@@ -8,7 +8,7 @@ from dateutil import relativedelta
import pprint
from odoo import api, exceptions, fields, models, _, SUPERUSER_ID
-from odoo.tools import consteq, float_round, image_resize_images, image_process, ustr
+from odoo.tools import consteq, float_round, image_process, ustr
from odoo.addons.base.models import ir_module
from odoo.exceptions import ValidationError
from odoo.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT
@@ -152,18 +152,7 @@ class PaymentAcquirer(models.Model):
module_id = fields.Many2one('ir.module.module', string='Corresponding Module')
module_state = fields.Selection(selection=ir_module.STATES, string='Installation State', related='module_id.state', readonly=False)
- image = fields.Binary(
- "Image", help="This field holds the image used for this provider, limited to 1024x1024px")
- image_medium = fields.Binary(
- "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",
- 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.")
+ image_128 = fields.Image("Image", max_width=128, max_height=128)
payment_icon_ids = fields.Many2many('payment.icon', string='Supported Payment Icons')
payment_flow = fields.Selection(selection=[('form', 'Redirection to the acquirer website'),
@@ -275,13 +264,11 @@ class PaymentAcquirer(models.Model):
@api.model
def create(self, vals):
- image_resize_images(vals)
record = super(PaymentAcquirer, self).create(vals)
record._check_required_if_provider()
return record
def write(self, vals):
- image_resize_images(vals)
result = super(PaymentAcquirer, self).write(vals)
self._check_required_if_provider()
return result
diff --git a/addons/payment/views/payment_portal_templates.xml b/addons/payment/views/payment_portal_templates.xml
index 9eea5737022..20d519599be 100644
--- a/addons/payment/views/payment_portal_templates.xml
+++ b/addons/payment/views/payment_portal_templates.xml
@@ -112,7 +112,7 @@
Back to My Account
-
+
Processed by .
diff --git a/addons/payment/views/payment_views.xml b/addons/payment/views/payment_views.xml
index ff335bc56e2..0be3849727c 100644
--- a/addons/payment/views/payment_views.xml
+++ b/addons/payment/views/payment_views.xml
@@ -61,7 +61,7 @@
-
+
@@ -157,7 +157,7 @@
- ![Acquirer]()
+
diff --git a/addons/payment_adyen/data/payment_acquirer_data.xml b/addons/payment_adyen/data/payment_acquirer_data.xml
index a0b6488663d..18e3bb8afde 100644
--- a/addons/payment_adyen/data/payment_acquirer_data.xml
+++ b/addons/payment_adyen/data/payment_acquirer_data.xml
@@ -4,7 +4,7 @@
Adyen
-
+
adyen
diff --git a/addons/payment_authorize/data/payment_acquirer_data.xml b/addons/payment_authorize/data/payment_acquirer_data.xml
index da0e438c41d..293bcbad9e0 100644
--- a/addons/payment_authorize/data/payment_acquirer_data.xml
+++ b/addons/payment_authorize/data/payment_acquirer_data.xml
@@ -4,7 +4,7 @@
Authorize.Net
-
+
authorize
diff --git a/addons/payment_buckaroo/data/payment_acquirer_data.xml b/addons/payment_buckaroo/data/payment_acquirer_data.xml
index db69ed5fa7c..7b11d688844 100644
--- a/addons/payment_buckaroo/data/payment_acquirer_data.xml
+++ b/addons/payment_buckaroo/data/payment_acquirer_data.xml
@@ -4,7 +4,7 @@
Buckaroo
-
+
buckaroo
diff --git a/addons/payment_ogone/data/payment_acquirer_data.xml b/addons/payment_ogone/data/payment_acquirer_data.xml
index 49743cc2a62..8f121d164d5 100644
--- a/addons/payment_ogone/data/payment_acquirer_data.xml
+++ b/addons/payment_ogone/data/payment_acquirer_data.xml
@@ -4,7 +4,7 @@
Ingenico
-
+
ogone
diff --git a/addons/payment_paypal/data/payment_acquirer_data.xml b/addons/payment_paypal/data/payment_acquirer_data.xml
index 62bac1466ff..893feb51b6e 100644
--- a/addons/payment_paypal/data/payment_acquirer_data.xml
+++ b/addons/payment_paypal/data/payment_acquirer_data.xml
@@ -4,7 +4,7 @@
Paypal
-
+
paypal
diff --git a/addons/payment_payumoney/data/payment_acquirer_data.xml b/addons/payment_payumoney/data/payment_acquirer_data.xml
index f8c9dd97139..dab5726f043 100644
--- a/addons/payment_payumoney/data/payment_acquirer_data.xml
+++ b/addons/payment_payumoney/data/payment_acquirer_data.xml
@@ -3,7 +3,7 @@
PayUmoney
-
+
payumoney
diff --git a/addons/payment_sips/data/payment_acquirer_data.xml b/addons/payment_sips/data/payment_acquirer_data.xml
index c6082d6f6fc..666c0271ad6 100644
--- a/addons/payment_sips/data/payment_acquirer_data.xml
+++ b/addons/payment_sips/data/payment_acquirer_data.xml
@@ -4,7 +4,7 @@
Sips
-
+
sips
diff --git a/addons/payment_stripe/data/payment_acquirer_data.xml b/addons/payment_stripe/data/payment_acquirer_data.xml
index a82caaa3704..2d30e4c6a72 100644
--- a/addons/payment_stripe/data/payment_acquirer_data.xml
+++ b/addons/payment_stripe/data/payment_acquirer_data.xml
@@ -3,7 +3,7 @@
Stripe
-
+
stripe
diff --git a/addons/payment_transfer/data/payment_acquirer_data.xml b/addons/payment_transfer/data/payment_acquirer_data.xml
index 4cd7c7811e5..ba2964e13d8 100644
--- a/addons/payment_transfer/data/payment_acquirer_data.xml
+++ b/addons/payment_transfer/data/payment_acquirer_data.xml
@@ -4,7 +4,7 @@
Wire Transfer
-
+
transfer
diff --git a/addons/point_of_sale/data/point_of_sale_data.xml b/addons/point_of_sale/data/point_of_sale_data.xml
index 0dfa33f862a..48ca0eb669b 100644
--- a/addons/point_of_sale/data/point_of_sale_data.xml
+++ b/addons/point_of_sale/data/point_of_sale_data.xml
@@ -39,7 +39,7 @@
MISC
-
+
diff --git a/addons/point_of_sale/data/point_of_sale_demo.xml b/addons/point_of_sale/data/point_of_sale_demo.xml
index 7bb512a4dd6..d564078cc29 100644
--- a/addons/point_of_sale/data/point_of_sale_demo.xml
+++ b/addons/point_of_sale/data/point_of_sale_demo.xml
@@ -54,7 +54,7 @@
-
+
True
@@ -69,7 +69,7 @@
True
-
+
@@ -84,7 +84,7 @@
-
+
True
@@ -99,7 +99,7 @@
-
+
@@ -116,7 +116,7 @@
-
+
True
@@ -130,7 +130,7 @@
-
+
True
@@ -144,7 +144,7 @@
-
+
@@ -157,7 +157,7 @@
-
+
@@ -172,7 +172,7 @@
-
+
@@ -188,7 +188,7 @@
-
+
@@ -202,7 +202,7 @@
-
+
diff --git a/addons/point_of_sale/models/pos_category.py b/addons/point_of_sale/models/pos_category.py
index a8e01c2ae4f..c3f40d94478 100644
--- a/addons/point_of_sale/models/pos_category.py
+++ b/addons/point_of_sale/models/pos_category.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
-from odoo import api, fields, models, tools, _
+from odoo import api, fields, models, _
+
class PosCategory(models.Model):
_name = "pos.category"
@@ -16,29 +17,7 @@ class PosCategory(models.Model):
parent_id = fields.Many2one('pos.category', string='Parent Category', index=True)
child_id = fields.One2many('pos.category', 'parent_id', string='Children Categories')
sequence = fields.Integer(help="Gives the sequence order when displaying a list of product categories.")
- # NOTE: there is no 'default image', because by default we don't show
- # thumbnails for categories. However if we have a thumbnail for at least one
- # category, then we display a default image on the other, so that the
- # buttons have consistent styling.
- image = fields.Binary(
- help="This field holds the image used as image for the cateogry, limited to 1024x1024px.")
- image_medium = fields.Binary(string="Medium-sized image",
- help="Medium-sized image of the category. 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(string="Small-sized image",
- help="Small-sized image of the category. It is automatically "
- "resized as a 64x64px image, with aspect ratio preserved. "
- "Use this field anywhere a small image is required.")
-
- @api.model
- def create(self, vals):
- tools.image_resize_images(vals)
- return super(PosCategory, self).create(vals)
-
- def write(self, vals):
- tools.image_resize_images(vals)
- return super(PosCategory, self).write(vals)
+ image_128 = fields.Image("Image", max_width=128, max_height=128)
def name_get(self):
def get_names(cat):
diff --git a/addons/point_of_sale/models/res_partner.py b/addons/point_of_sale/models/res_partner.py
index a1b89f004e3..7f54488c51c 100644
--- a/addons/point_of_sale/models/res_partner.py
+++ b/addons/point_of_sale/models/res_partner.py
@@ -29,8 +29,8 @@ class ResPartner(models.Model):
""" create or modify a partner from the point of sale ui.
partner contains the partner's fields. """
# image is a dataurl, get the data after the comma
- if partner.get('image'):
- partner['image'] = partner['image'].split(',')[1]
+ if partner.get('image_1920'):
+ partner['image_1920'] = partner['image_1920'].split(',')[1]
partner_id = partner.pop('id', False)
if partner_id: # Modifying existing partner
self.browse(partner_id).write(partner)
diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js
index e24a5d7841b..1cea3a6c9ce 100644
--- a/addons/point_of_sale/static/src/js/models.js
+++ b/addons/point_of_sale/static/src/js/models.js
@@ -778,7 +778,7 @@ exports.PosModel = Backbone.Model.extend({
if (order) {
order.get_orderlines().forEach(function (orderline) {
var product = orderline.product;
- var image_url = window.location.origin + '/web/image?model=product.product&field=image_medium&id=' + product.id;
+ var image_url = window.location.origin + '/web/image?model=product.product&field=image_128&id=' + product.id;
// only download and convert image if we haven't done it before
if (! product.image_base64) {
diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js
index 279d66b65ea..ae1c62a535a 100644
--- a/addons/point_of_sale/static/src/js/screens.js
+++ b/addons/point_of_sale/static/src/js/screens.js
@@ -732,7 +732,7 @@ var ProductCategoriesWidget = PosBaseWidget.extend({
},
get_image_url: function(category){
- return window.location.origin + '/web/image?model=pos.category&field=image_medium&id='+category.id;
+ return window.location.origin + '/web/image?model=pos.category&field=image_128&id='+category.id;
},
render_category: function( category, with_image ){
@@ -899,7 +899,7 @@ var ProductListWidget = PosBaseWidget.extend({
this.renderElement();
},
get_product_image_url: function(product){
- return window.location.origin + '/web/image?model=product.product&field=image_medium&id='+product.id;
+ return window.location.origin + '/web/image?model=product.product&field=image_128&id='+product.id;
},
replace: function($target){
this.renderElement();
@@ -1308,7 +1308,7 @@ var ClientListScreenWidget = ScreenWidget.extend({
}
},
partner_icon_url: function(id){
- return '/web/image?model=res.partner&id='+id+'&field=image_small';
+ return '/web/image?model=res.partner&id='+id+'&field=image_64';
},
// ui handle for the 'edit selected customer' action
diff --git a/addons/point_of_sale/views/pos_category_view.xml b/addons/point_of_sale/views/pos_category_view.xml
index 96d05ff9321..fa2b716cf5b 100644
--- a/addons/point_of_sale/views/pos_category_view.xml
+++ b/addons/point_of_sale/views/pos_category_view.xml
@@ -6,7 +6,7 @@
| |