Tweak how some "pack item" fields are displayed when viewing product
This commit is contained in:
parent
ad5444d270
commit
9a0a280d7d
2 changed files with 17 additions and 3 deletions
|
@ -104,6 +104,7 @@ class ProductsView(MasterView):
|
|||
'size',
|
||||
'unit',
|
||||
'pack_size',
|
||||
'default_pack',
|
||||
'case_size',
|
||||
'weighed',
|
||||
'department',
|
||||
|
@ -364,6 +365,7 @@ class ProductsView(MasterView):
|
|||
|
||||
def configure_form(self, f):
|
||||
super(ProductsView, self).configure_form(f)
|
||||
product = f.model_instance
|
||||
|
||||
# upc
|
||||
f.set_type('upc', 'gpc')
|
||||
|
@ -511,12 +513,21 @@ class ProductsView(MasterView):
|
|||
# unit
|
||||
if self.creating:
|
||||
f.remove_field('unit')
|
||||
elif self.viewing and not product.is_pack_item():
|
||||
f.remove_field('unit')
|
||||
else:
|
||||
f.set_renderer('unit', self.render_unit)
|
||||
f.set_label('unit', "Unit Item")
|
||||
|
||||
# pack_size
|
||||
f.set_type('pack_size', 'quantity')
|
||||
if self.viewing and not product.is_pack_item():
|
||||
f.remove_field('pack_size')
|
||||
else:
|
||||
f.set_type('pack_size', 'quantity')
|
||||
|
||||
# default_pack
|
||||
if self.viewing and not product.is_pack_item():
|
||||
f.remove_field('default_pack')
|
||||
|
||||
# regular_price
|
||||
if self.creating:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue