From f5318e6f20d4dae733029dc112dedcad559cbd1b Mon Sep 17 00:00:00 2001 From: cellsnake Date: Tue, 25 Aug 2015 19:32:26 +0200 Subject: [PATCH] - change self.image by record.image in inverse _save_image_medium method - add class css and size 100px image in product category form view --- pos_remove_pos_category/product.py | 5 +++-- pos_remove_pos_category/views/pos_category.xml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pos_remove_pos_category/product.py b/pos_remove_pos_category/product.py index 5120d6e6..a5f8fee0 100644 --- a/pos_remove_pos_category/product.py +++ b/pos_remove_pos_category/product.py @@ -45,7 +45,8 @@ class ProductCategory(models.Model): _inherit = 'product.category' image = fields.Binary(help='Show Image Category in Form View') - image_medium = fields.Binary(help='Show image category button in POS', inverse='_save_image_medium') + image_medium = fields.Binary(help='Show image category button in POS', + inverse='_save_image_medium') available_in_pos = fields.Boolean( string="Available in the Point of Sale", default=True, @@ -57,7 +58,7 @@ class ProductCategory(models.Model): def _save_image_medium(self): for record in self: if record.image: - temp = tools.image_get_resized_images(self.image) + temp = tools.image_get_resized_images(record.image) record.image_medium = temp['image_medium'] else: record.image_medium = None diff --git a/pos_remove_pos_category/views/pos_category.xml b/pos_remove_pos_category/views/pos_category.xml index 063fbc54..6351a1f5 100644 --- a/pos_remove_pos_category/views/pos_category.xml +++ b/pos_remove_pos_category/views/pos_category.xml @@ -15,7 +15,7 @@ 20 - +