|
@ -46,8 +46,8 @@ class ProductCategory(models.Model): |
|
|
|
|
|
|
|
|
image = fields.Binary(help='Show Image Category in Form View') |
|
|
image = fields.Binary(help='Show Image Category in Form View') |
|
|
image_medium = fields.Binary(help='Show image category button in POS', |
|
|
image_medium = fields.Binary(help='Show image category button in POS', |
|
|
compute="_get_image", |
|
|
|
|
|
inverse="_set_image", |
|
|
|
|
|
|
|
|
compute="_compute_get_image", |
|
|
|
|
|
inverse="_inverse_set_image", |
|
|
store=True) |
|
|
store=True) |
|
|
available_in_pos = fields.Boolean( |
|
|
available_in_pos = fields.Boolean( |
|
|
string="Available in the Point of Sale", |
|
|
string="Available in the Point of Sale", |
|
@ -57,13 +57,14 @@ class ProductCategory(models.Model): |
|
|
"whatever their checkbox state.") |
|
|
"whatever their checkbox state.") |
|
|
|
|
|
|
|
|
@api.multi |
|
|
@api.multi |
|
|
def _get_image(self): |
|
|
|
|
|
|
|
|
def _compute_get_image(self): |
|
|
return dict( |
|
|
return dict( |
|
|
(rec.id, tools.image_get_resized_images(rec.image)) for rec in |
|
|
(rec.id, tools.image_get_resized_images(rec.image)) for rec in |
|
|
self) |
|
|
self) |
|
|
|
|
|
|
|
|
@api.one |
|
|
|
|
|
def _set_image(self): |
|
|
|
|
|
|
|
|
@api.multi |
|
|
|
|
|
def _inverse_set_image(self): |
|
|
|
|
|
self.ensure_one() |
|
|
return self.write( |
|
|
return self.write( |
|
|
{'image': tools.image_resize_image_big(self.image_medium)}) |
|
|
{'image': tools.image_resize_image_big(self.image_medium)}) |
|
|
|
|
|
|
|
|