Make some product fields readonly

This commit is contained in:
Lance Edgar 2017-02-12 20:09:25 -06:00
parent 7ad2ec48f0
commit aa13cbfa07

View file

@ -276,7 +276,8 @@ class ProductsView(MasterView):
renderer=forms.renderers.EnumFieldRenderer(self.enum.UNIT_OF_MEASURE))
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,
fs.last_sold.set(readonly=True)
fs.append(fa.Field('current_price_ends', type=fa.types.DateTime, readonly=True,
value=lambda p: p.current_price.ends if p.current_price else None))
def configure_fieldset(self, fs):