Fix(python): Stock Item page filters Form attribute error corrected.
This commit is contained in:
@@ -30,6 +30,7 @@ class Filters_Stock_Item(Form_Base):
|
|||||||
is_out_of_stock = BooleanField('Out of stock only?')
|
is_out_of_stock = BooleanField('Out of stock only?')
|
||||||
quantity_min = FloatField('Min stock')
|
quantity_min = FloatField('Min stock')
|
||||||
quantity_max = FloatField('Max stock')
|
quantity_max = FloatField('Max stock')
|
||||||
|
active = BooleanField("Active")
|
||||||
# submit = SubmitField('Submit')
|
# submit = SubmitField('Submit')
|
||||||
"""
|
"""
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
@@ -52,6 +53,7 @@ class Filters_Stock_Item(Form_Base):
|
|||||||
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.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]
|
form.quantity_min.data = json[Store_Base.FLAG_QUANTITY_MIN]
|
||||||
form.quantity_max.data = json[Store_Base.FLAG_QUANTITY_MAX]
|
form.quantity_max.data = json[Store_Base.FLAG_QUANTITY_MAX]
|
||||||
|
form.active.data = json[Store_Base.FLAG_ACTIVE]
|
||||||
return form
|
return form
|
||||||
def to_json(self):
|
def to_json(self):
|
||||||
return {
|
return {
|
||||||
@@ -59,7 +61,8 @@ class Filters_Stock_Item(Form_Base):
|
|||||||
Store_Base.ATTR_ID_PRODUCT: self.id_product.data,
|
Store_Base.ATTR_ID_PRODUCT: self.id_product.data,
|
||||||
Store_Base.FLAG_IS_OUT_OF_STOCK: self.is_out_of_stock.data,
|
Store_Base.FLAG_IS_OUT_OF_STOCK: self.is_out_of_stock.data,
|
||||||
Store_Base.FLAG_QUANTITY_MIN: self.quantity_min.data,
|
Store_Base.FLAG_QUANTITY_MIN: self.quantity_min.data,
|
||||||
Store_Base.FLAG_QUANTITY_MAX: self.quantity_max.data
|
Store_Base.FLAG_QUANTITY_MAX: self.quantity_max.data,
|
||||||
|
Store_Base.FLAG_ACTIVE: self.active.data
|
||||||
}
|
}
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_default(cls):
|
def get_default(cls):
|
||||||
|
|||||||
@@ -325,7 +325,7 @@ BEGIN
|
|||||||
)
|
)
|
||||||
SELECT
|
SELECT
|
||||||
U.id_user
|
U.id_user
|
||||||
, U.is_super_user
|
, IFNULL(U.is_super_user, 0) AS is_super_user
|
||||||
-- , IFNULL(AL_U.id_access_level, v_id_access_level_view) AS id_access_level
|
-- , IFNULL(AL_U.id_access_level, v_id_access_level_view) AS id_access_level
|
||||||
, IFNULL(MIN(AL_U.priority), v_priority_access_level_view) AS priority_access_level
|
, IFNULL(MIN(AL_U.priority), v_priority_access_level_view) AS priority_access_level
|
||||||
FROM tmp_Split t_S
|
FROM tmp_Split t_S
|
||||||
@@ -355,8 +355,8 @@ BEGIN
|
|||||||
, v_id_permission_required
|
, v_id_permission_required
|
||||||
, v_priority_access_level AS priority_access_level_required
|
, v_priority_access_level AS priority_access_level_required
|
||||||
, NULL
|
, NULL
|
||||||
, t_UCU.priority_access_level AS priority_access_level_user
|
|
||||||
, t_UCU.is_super_user AS is_super_user
|
, t_UCU.is_super_user AS is_super_user
|
||||||
|
, t_UCU.priority_access_level AS priority_access_level_user
|
||||||
FROM tmp_User_Calc_User t_UCU
|
FROM tmp_User_Calc_User t_UCU
|
||||||
;
|
;
|
||||||
|
|
||||||
@@ -507,8 +507,8 @@ BEGIN
|
|||||||
, v_id_permission_required
|
, v_id_permission_required
|
||||||
, CASE WHEN AL.priority < v_priority_access_level THEN AL.priority ELSE v_priority_access_level END AS priority_access_level_required
|
, CASE WHEN AL.priority < v_priority_access_level THEN AL.priority ELSE v_priority_access_level END AS priority_access_level_required
|
||||||
, t_P.id_product
|
, t_P.id_product
|
||||||
, t_U.priority_access_level AS priority_access_level_user
|
|
||||||
, t_U.is_super_user AS is_super_user
|
, t_U.is_super_user AS is_super_user
|
||||||
|
, t_U.priority_access_level AS priority_access_level_user
|
||||||
FROM tmp_User_Calc_User t_U
|
FROM tmp_User_Calc_User t_U
|
||||||
CROSS JOIN tmp_Product_Calc_User t_P
|
CROSS JOIN tmp_Product_Calc_User t_P
|
||||||
LEFT JOIN partsltd_prod.Shop_Access_Level AL ON t_P.id_access_level_required = AL.id_access_level
|
LEFT JOIN partsltd_prod.Shop_Access_Level AL ON t_P.id_access_level_required = AL.id_access_level
|
||||||
|
|||||||
@@ -916,7 +916,8 @@ INSERT INTO Shop_User_Role_Link (
|
|||||||
id_user, id_role
|
id_user, id_role
|
||||||
)
|
)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 1)
|
(1, 1),
|
||||||
|
(4, 1)
|
||||||
;
|
;
|
||||||
|
|
||||||
# User Addresses
|
# User Addresses
|
||||||
|
|||||||
Reference in New Issue
Block a user