parameters: (self, order_id=None, access_token=None, **kw)
return_statement: return Response(status=204)
docstring: User update scheduled date on purchase order line.
docstring_summary: User update scheduled date on purchase order line.
docstring_tokens: User update scheduled date on purchase order line .
function: def portal_my_purchase_order_update_dates(self, order_id=None, access_token=None, **kw):
          """User update scheduled date on purchase order line.
          """
          try:
              order_sudo = self._document_check_access('purchase.order', order_id, access_token=access_token)
          except (AccessError, MissingError):
              return request.redirect('/my')
  
          updated_dates = []
          for id_str, date_str in kw.items():
              try:
                  line_id = int(id_str)
              except ValueError:
                  return request.redirect(order_sudo.get_portal_url())
              line = order_sudo.order_line.filtered(lambda l: l.id == line_id)
              if not line:
                  return request.redirect(order_sudo.get_portal_url())
  
              try:
                  updated_date = line._convert_to_middle_of_day(datetime.strptime(date_str, '%Y-%m-%d'))
              except ValueError:
                  continue
  
              updated_dates.append((line, updated_date))
  
          if updated_dates:
              order_sudo._update_date_planned_for_lines(updated_dates)
          return Response(status=204)
function_tokens: def portal_my_purchase_order_update_dates ( self , order_id = None , access_token = None , * * kw ) : try : order_sudo = self . _document_check_access ( 'purchase.order' , order_id , access_token = access_token ) except ( AccessError , MissingError ) : return request . redirect ( '/my' ) updated_dates = [ ] for id_str , date_str in kw . items ( ) : try : line_id = int ( id_str ) except ValueError : return request . redirect ( order_sudo . get_portal_url ( ) ) line = order_sudo . order_line . filtered ( lambda l : l . id == line_id ) if not line : return request . redirect ( order_sudo . get_portal_url ( ) ) try : updated_date = line . _convert_to_middle_of_day ( datetime . strptime ( date_str , '%Y-%m-%d' ) ) except ValueError : continue updated_dates . append ( ( line , updated_date ) ) if updated_dates : order_sudo . _update_date_planned_for_lines ( updated_dates ) return Response ( status = 204 )