Tweak how regular/current price fields are handled for Product view

This commit is contained in:
Lance Edgar 2017-02-10 12:47:20 -06:00
parent 99776b28d7
commit afe822dd6c

View file

@ -274,8 +274,8 @@ class ProductsView(MasterView):
fs.category.set(renderer=forms.renderers.CategoryFieldRenderer)
fs.unit_of_measure.set(label="Unit of Measure",
renderer=forms.renderers.EnumFieldRenderer(self.enum.UNIT_OF_MEASURE))
fs.regular_price.set(renderer=forms.renderers.PriceFieldRenderer)
fs.current_price.set(renderer=forms.renderers.PriceFieldRenderer)
fs.regular_price.set(renderer=forms.renderers.PriceFieldRenderer, readonly=True)
fs.current_price.set(renderer=forms.renderers.PriceFieldRenderer, readonly=True)
fs.append(fa.Field('current_price_ends', type=fa.types.DateTime,
value=lambda p: p.current_price.ends if p.current_price else None))
@ -307,9 +307,6 @@ class ProductsView(MasterView):
fs.deleted,
fs.last_sold,
])
if not self.viewing:
del fs.regular_price
del fs.current_price
if not self.request.has_perm('products.view_deleted'):
del fs.deleted