parameters: (self, order, next_order=False)
return_statement: return programs
docstring: Return the programs if every conditions is met
              :param bool next_order: is the reward given from a previous order
docstring_summary: Return the programs if every conditions is met
              :param bool next_order: is the reward given from a previous order
docstring_tokens: Return the programs if every conditions is met : param bool next_order : is the reward given from a previous order
function: def _filter_programs_from_common_rules(self, order, next_order=False):
          """ Return the programs if every conditions is met
              :param bool next_order: is the reward given from a previous order
          """
          programs = self
          # Minimum requirement should not be checked if the coupon got generated by a promotion program (the requirement should have only be checked to generate the coupon)
          if not next_order:
              programs = programs and programs._filter_on_mimimum_amount(order)
          if not self.env.context.get("no_outdated_coupons"):
              programs = programs and programs._filter_on_validity_dates(order)
          programs = programs and programs._filter_unexpired_programs(order)
          programs = programs and programs._filter_programs_on_partners(order)
          # Product requirement should not be checked if the coupon got generated by a promotion program (the requirement should have only be checked to generate the coupon)
          if not next_order:
              programs = programs and programs._filter_programs_on_products(order)
  
          programs_curr_order = programs.filtered(lambda p: p.promo_applicability == 'on_current_order')
          programs = programs.filtered(lambda p: p.promo_applicability == 'on_next_order')
          if programs_curr_order:
              # Checking if rewards are in the SO should not be performed for rewards on_next_order
              programs += programs_curr_order._filter_not_ordered_reward_programs(order)
          return programs
function_tokens: def _filter_programs_from_common_rules ( self , order , next_order = False ) : programs = self # Minimum requirement should not be checked if the coupon got generated by a promotion program (the requirement should have only be checked to generate the coupon) if not next_order : programs = programs and programs . _filter_on_mimimum_amount ( order ) if not self . env . context . get ( "no_outdated_coupons" ) : programs = programs and programs . _filter_on_validity_dates ( order ) programs = programs and programs . _filter_unexpired_programs ( order ) programs = programs and programs . _filter_programs_on_partners ( order ) # Product requirement should not be checked if the coupon got generated by a promotion program (the requirement should have only be checked to generate the coupon) if not next_order : programs = programs and programs . _filter_programs_on_products ( order ) programs_curr_order = programs . filtered ( lambda p : p . promo_applicability == 'on_current_order' ) programs = programs . filtered ( lambda p : p . promo_applicability == 'on_next_order' ) if programs_curr_order : # Checking if rewards are in the SO should not be performed for rewards on_next_order programs += programs_curr_order . _filter_not_ordered_reward_programs ( order ) return programs