parameters: (self)
return_statement: return move_group_by_sheet
docstring: main function that is called when trying to create the accounting entries related to an expense
docstring_summary: main function that is called when trying to create the accounting entries related to an expense
docstring_tokens: main function that is called when trying to create the accounting entries related to an expense
function: def action_move_create(self):
          '''
          main function that is called when trying to create the accounting entries related to an expense
          '''
          move_group_by_sheet = self._get_account_move_by_sheet()
  
          move_line_values_by_expense = self._get_account_move_line_values()
  
          for expense in self:
              # get the account move of the related sheet
              move = move_group_by_sheet[expense.sheet_id.id]
  
              # get move line values
              move_line_values = move_line_values_by_expense.get(expense.id)
  
              # link move lines to move, and move to expense sheet
              move.write({'line_ids': [(0, 0, line) for line in move_line_values]})
              expense.sheet_id.write({'account_move_id': move.id})
  
              if expense.payment_mode == 'company_account':
                  expense.sheet_id.paid_expense_sheets()
  
          # post the moves
          for move in move_group_by_sheet.values():
              move._post()
  
          return move_group_by_sheet
function_tokens: def action_move_create ( self ) : move_group_by_sheet = self . _get_account_move_by_sheet ( ) move_line_values_by_expense = self . _get_account_move_line_values ( ) for expense in self : # get the account move of the related sheet move = move_group_by_sheet [ expense . sheet_id . id ] # get move line values move_line_values = move_line_values_by_expense . get ( expense . id ) # link move lines to move, and move to expense sheet move . write ( { 'line_ids' : [ ( 0 , 0 , line ) for line in move_line_values ] } ) expense . sheet_id . write ( { 'account_move_id' : move . id } ) if expense . payment_mode == 'company_account' : expense . sheet_id . paid_expense_sheets ( ) # post the moves for move in move_group_by_sheet . values ( ) : move . _post ( ) return move_group_by_sheet