Fix(python): Stock Item page filters Form attribute error corrected.

This commit is contained in:
2025-01-31 15:23:08 +00:00
parent fea029d2be
commit ec30bdf085
3 changed files with 9 additions and 5 deletions

View File

@@ -30,6 +30,7 @@ class Filters_Stock_Item(Form_Base):
is_out_of_stock = BooleanField('Out of stock only?')
quantity_min = FloatField('Min stock')
quantity_max = FloatField('Max stock')
active = BooleanField("Active")
# submit = SubmitField('Submit')
"""
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.quantity_min.data = json[Store_Base.FLAG_QUANTITY_MIN]
form.quantity_max.data = json[Store_Base.FLAG_QUANTITY_MAX]
form.active.data = json[Store_Base.FLAG_ACTIVE]
return form
def to_json(self):
return {
@@ -59,7 +61,8 @@ class Filters_Stock_Item(Form_Base):
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_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
def get_default(cls):

View File

@@ -325,7 +325,7 @@ BEGIN
)
SELECT
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(MIN(AL_U.priority), v_priority_access_level_view) AS priority_access_level
FROM tmp_Split t_S
@@ -355,8 +355,8 @@ BEGIN
, v_id_permission_required
, v_priority_access_level AS priority_access_level_required
, NULL
, t_UCU.priority_access_level AS priority_access_level_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
;
@@ -507,8 +507,8 @@ BEGIN
, 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
, 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.priority_access_level AS priority_access_level_user
FROM tmp_User_Calc_User t_U
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

View File

@@ -916,7 +916,8 @@ INSERT INTO Shop_User_Role_Link (
id_user, id_role
)
VALUES
(1, 1)
(1, 1),
(4, 1)
;
# User Addresses