Tweak how regular/current price fields are handled for Product view
This commit is contained in:
parent
99776b28d7
commit
afe822dd6c
|
@ -274,8 +274,8 @@ class ProductsView(MasterView):
|
||||||
fs.category.set(renderer=forms.renderers.CategoryFieldRenderer)
|
fs.category.set(renderer=forms.renderers.CategoryFieldRenderer)
|
||||||
fs.unit_of_measure.set(label="Unit of Measure",
|
fs.unit_of_measure.set(label="Unit of Measure",
|
||||||
renderer=forms.renderers.EnumFieldRenderer(self.enum.UNIT_OF_MEASURE))
|
renderer=forms.renderers.EnumFieldRenderer(self.enum.UNIT_OF_MEASURE))
|
||||||
fs.regular_price.set(renderer=forms.renderers.PriceFieldRenderer)
|
fs.regular_price.set(renderer=forms.renderers.PriceFieldRenderer, readonly=True)
|
||||||
fs.current_price.set(renderer=forms.renderers.PriceFieldRenderer)
|
fs.current_price.set(renderer=forms.renderers.PriceFieldRenderer, readonly=True)
|
||||||
fs.append(fa.Field('current_price_ends', type=fa.types.DateTime,
|
fs.append(fa.Field('current_price_ends', type=fa.types.DateTime,
|
||||||
value=lambda p: p.current_price.ends if p.current_price else None))
|
value=lambda p: p.current_price.ends if p.current_price else None))
|
||||||
|
|
||||||
|
@ -307,9 +307,6 @@ class ProductsView(MasterView):
|
||||||
fs.deleted,
|
fs.deleted,
|
||||||
fs.last_sold,
|
fs.last_sold,
|
||||||
])
|
])
|
||||||
if not self.viewing:
|
|
||||||
del fs.regular_price
|
|
||||||
del fs.current_price
|
|
||||||
if not self.request.has_perm('products.view_deleted'):
|
if not self.request.has_perm('products.view_deleted'):
|
||||||
del fs.deleted
|
del fs.deleted
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue