Fix: Cleanup \n 1. Remove PostgreSQL \n 2. Remove comments from Python \n 3. Remove non-demo ERP Python code \n 4. Remove deprecated Python code
This commit is contained in:
@@ -31,24 +31,11 @@ class Filters_Stock_Item(Form_Base):
|
||||
quantity_min = FloatField('Min stock')
|
||||
quantity_max = FloatField('Max stock')
|
||||
active = BooleanField("Active")
|
||||
# submit = SubmitField('Submit')
|
||||
"""
|
||||
def __repr__(self):
|
||||
return f'''
|
||||
{self.__class__.__name__}(
|
||||
id_category={self.id_category.data},
|
||||
id_product={self.id_product.data},
|
||||
is_out_of_stock={self.is_out_of_stock.data},
|
||||
quantity_min={self.quantity_min.data},
|
||||
quantity_max={self.quantity_max.data})
|
||||
'''
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json):
|
||||
form = cls()
|
||||
# form.id_category.choices = [(json[Store_Base.ATTR_ID_PRODUCT_CATEGORY], json[Store_Base.ATTR_ID_PRODUCT_CATEGORY])]
|
||||
form.id_category.data = json[Store_Base.ATTR_ID_PRODUCT_CATEGORY]
|
||||
# form.id_product.choices = [(json[Store_Base.ATTR_ID_PRODUCT], json[Store_Base.ATTR_ID_PRODUCT])]
|
||||
form.id_product.data = json[Store_Base.ATTR_ID_PRODUCT]
|
||||
form.is_out_of_stock.data = av.input_bool(json[Store_Base.FLAG_IS_OUT_OF_STOCK], Store_Base.FLAG_IS_OUT_OF_STOCK, f'{cls.__name__}.from_json')
|
||||
form.quantity_min.data = json[Store_Base.FLAG_QUANTITY_MIN]
|
||||
@@ -69,11 +56,4 @@ class Filters_Stock_Item(Form_Base):
|
||||
filters = cls()
|
||||
filters.id_category.choices = cls.get_choices_blank()
|
||||
filters.id_product.choices = cls.get_choices_blank()
|
||||
"""
|
||||
def import_values(self, form_filters):
|
||||
self.id_category.data = form_filters.id_category.data
|
||||
self.id_product.data = form_filters.id_product.data
|
||||
self.is_out_of_stock.data = form_filters.is_out_of_stock.data
|
||||
self.quantity_min.data = form_filters.quantity_min.data
|
||||
self.quantity_max.data = form_filters.quantity_max.data
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user