Browse Source

- change self.image by record.image

in inverse _save_image_medium method

- add class css and size 100px image in product category form view
pull/52/head
cellsnake 9 years ago
parent
commit
f5318e6f20
  1. 5
      pos_remove_pos_category/product.py
  2. 2
      pos_remove_pos_category/views/pos_category.xml

5
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

2
pos_remove_pos_category/views/pos_category.xml

@ -15,7 +15,7 @@
<field name="priority">20</field>
<field name="arch" type="xml">
<xpath expr="//group[@name='parent']" position="inside">
<field name="image" widget="image"/>
<field name="image" widget="image" class="oe_left oe_avatar" options='{"size": [100, 100]}' />
<field name="available_in_pos"/>
</xpath>
</field>

Loading…
Cancel
Save