hunk.code_window:     def _compute_statistics(self):
           """ Compute statistics of the mass mailing """
           self.env.cr.execute("""
               SELECT
                   m.id as mailing_id,
                   COUNT(s.id) AS total,
                   COUNT(CASE WHEN s.sent is not null THEN 1 ELSE null END) AS sent,
                   COUNT(CASE WHEN s.scheduled is not null AND s.sent is null AND s.exception is null THEN 1 ELSE null END) AS scheduled,
                   COUNT(CASE WHEN s.scheduled is not null AND s.sent is null AND s.exception is not null THEN 1 ELSE null END) AS failed,
  
hunk.labels: keep keep keep keep keep replace keep keep keep
hunk.after_edit:                 COUNT(s.id) AS expected,
  
hunk.file_path: addons/mass_mailing/models/mass_mailing.py
hunk.type: replace
file: id,chart_template_id:id,code,name,user_type_id:id,reconcile
  nz_11110,l10n_nz.l10n_nz_chart_template,11110,Bank Account,account.data_account_type_liquidity,FALSE
  nz_11130,l10n_nz.l10n_nz_chart_template,11130,Petty Cash,account.data_account_type_liquidity,FALSE
  nz_11140,l10n_nz.l10n_nz_chart_template,11140,Cash Drawer,account.data_account_type_liquidity,FALSE
  nz_11180,l10n_nz.l10n_nz_chart_template,11180,Undeposited Funds,account.data_account_type_current_assets,TRUE
  nz_11190,l10n_nz.l10n_nz_chart_template,11190,Electronic Clearing Account,account.data_account_type_current_assets,TRUE
  nz_11200,l10n_nz.l10n_nz_chart_template,11200,Trade Debtors,account.data_account_type_receivable,TRUE
  nz_11210,l10n_nz.l10n_nz_chart_template,11210,Less Prov'n for Doubtful Debts,account.data_account_type_current_assets,FALSE
  nz_11310,l10n_nz.l10n_nz_chart_template,11310,Raw Materials,account.data_account_type_current_assets,FALSE
  nz_11320,l10n_nz.l10n_nz_chart_template,11320,Finished Goods,account.data_account_type_current_assets,FALSE
  nz_11330,l10n_nz.l10n_nz_chart_template,11330,Trading Stock on Hand,account.data_account_type_current_assets,FALSE
  nz_12100,l10n_nz.l10n_nz_chart_template,12100,Deposits Paid,account.data_account_type_prepayments,FALSE
  nz_12200,l10n_nz.l10n_nz_chart_template,12200,Prepaid Insurance,account.data_account_type_current_assets,FALSE
  nz_13110,l10n_nz.l10n_nz_chart_template,13110,Manufacturing Plant at Cost,account.data_account_type_fixed_assets,FALSE
  nz_13120,l10n_nz.l10n_nz_chart_template,13120,Manufac. Plant Accum Dep,account.data_account_type_fixed_assets,FALSE
  nz_13130,l10n_nz.l10n_nz_chart_template,13130,Manufacturing Equipment Cost,account.data_account_type_fixed_assets,FALSE
  nz_13140,l10n_nz.l10n_nz_chart_template,13140,Manufac. Equip Accum Dep,account.data_account_type_fixed_assets,FALSE
  nz_13210,l10n_nz.l10n_nz_chart_template,13210,Furniture & Fixtures at Cost,account.data_account_type_fixed_assets,FALSE
  nz_13220,l10n_nz.l10n_nz_chart_template,13220,Furniture & Fixtures Accum Dep,account.data_account_type_fixed_assets,FALSE
  nz_13310,l10n_nz.l10n_nz_chart_template,13310,Office Equip at Cost,account.data_account_type_fixed_assets,FALSE
  nz_13320,l10n_nz.l10n_nz_chart_template,13320,Office Equip Accum Dep,account.data_account_type_fixed_assets,FALSE
  nz_13410,l10n_nz.l10n_nz_chart_template,13410,Motor Vehicles at Cost,account.data_account_type_fixed_assets,FALSE
  nz_13420,l10n_nz.l10n_nz_chart_template,13420,Motor Vehicles Accum Dep,account.data_account_type_fixed_assets,FALSE
  nz_21110,l10n_nz.l10n_nz_chart_template,21110,Credit Card,account.data_account_type_current_liabilities,FALSE
  nz_21200,l10n_nz.l10n_nz_chart_template,21200,Trade Creditors,account.data_account_type_payable,TRUE
  nz_21210,l10n_nz.l10n_nz_chart_template,21210,A/P Accrual - Inventory,account.data_account_type_current_liabilities,FALSE
  nz_21310,l10n_nz.l10n_nz_chart_template,21310,GST Collected,account.data_account_type_current_liabilities,FALSE
  nz_21330,l10n_nz.l10n_nz_chart_template,21330,GST Paid,account.data_account_type_current_assets,FALSE
  nz_21350,l10n_nz.l10n_nz_chart_template,21350,Fuel Tax Credits Accrued,account.data_account_type_current_liabilities,FALSE
  nz_21360,l10n_nz.l10n_nz_chart_template,21360,Import Duty Payable,account.data_account_type_current_liabilities,FALSE
  nz_21370,l10n_nz.l10n_nz_chart_template,21370,Voluntary Withholdings Payable,account.data_account_type_current_liabilities,FALSE
  nz_21380,l10n_nz.l10n_nz_chart_template,21380,Tax Withholdings Payable,account.data_account_type_current_liabilities,FALSE
  nz_21410,l10n_nz.l10n_nz_chart_template,21410,Payroll Accruals Payable,account.data_account_type_current_liabilities,FALSE
  nz_21420,l10n_nz.l10n_nz_chart_template,21420,PAYG Withholding Payable,account.data_account_type_current_liabilities,FALSE
  nz_21600,l10n_nz.l10n_nz_chart_template,21600,Customer Deposits,account.data_account_type_current_liabilities,FALSE
  nz_21700,l10n_nz.l10n_nz_chart_template,21700,Other Current Liabilities,account.data_account_type_current_liabilities,FALSE
  nz_22100,l10n_nz.l10n_nz_chart_template,22100,Mortgages Payable,account.data_account_type_non_current_liabilities,FALSE
  nz_22200,l10n_nz.l10n_nz_chart_template,22200,Notes Payable,account.data_account_type_non_current_liabilities,FALSE
  nz_22300,l10n_nz.l10n_nz_chart_template,22300,Other Long Term Liabilities,account.data_account_type_non_current_liabilities,FALSE
  nz_31100,l10n_nz.l10n_nz_chart_template,31100,Capital Investment,account.data_account_type_equity,FALSE
  nz_31200,l10n_nz.l10n_nz_chart_template,31200,Capital Drawings,account.data_account_type_equity,FALSE
  nz_38000,l10n_nz.l10n_nz_chart_template,38000,Retained Earnings,account.data_account_type_equity,FALSE
  nz_39000,l10n_nz.l10n_nz_chart_template,39000,Current Year Earnings,account.data_unaffected_earnings,FALSE
  nz_39999,l10n_nz.l10n_nz_chart_template,39999,Historical Balancing,account.data_account_type_equity,FALSE
  nz_41110,l10n_nz.l10n_nz_chart_template,41110,Sales Product #1,account.data_account_type_revenue,FALSE
  nz_41120,l10n_nz.l10n_nz_chart_template,41120,Sales Product #2,account.data_account_type_revenue,FALSE
  nz_41130,l10n_nz.l10n_nz_chart_template,41130,Sales Product #3,account.data_account_type_revenue,FALSE
  nz_42000,l10n_nz.l10n_nz_chart_template,42000,Wholesale Sales,account.data_account_type_revenue,FALSE
  nz_43000,l10n_nz.l10n_nz_chart_template,43000,Consignment Sales,account.data_account_type_revenue,FALSE
  nz_44000,l10n_nz.l10n_nz_chart_template,44000,Freight Income,account.data_account_type_revenue,FALSE
  nz_45000,l10n_nz.l10n_nz_chart_template,45000,Late Fees Collected,account.data_account_type_other_income,FALSE
  nz_46000,l10n_nz.l10n_nz_chart_template,46000,Miscellaneous Income,account.data_account_type_other_income,FALSE
  nz_47000,l10n_nz.l10n_nz_chart_template,47000,Fuel Tax Credits,account.data_account_type_other_income,FALSE
  nz_51110,l10n_nz.l10n_nz_chart_template,51110,Cost of Goods Sold #1,account.data_account_type_direct_costs,FALSE
  nz_51120,l10n_nz.l10n_nz_chart_template,51120,Cost of Goods Sold # 2,account.data_account_type_direct_costs,FALSE
  nz_51130,l10n_nz.l10n_nz_chart_template,51130,Cost of Goods Sold # 3,account.data_account_type_direct_costs,FALSE
  nz_52000,l10n_nz.l10n_nz_chart_template,52000,Wholesale Cost of Sales,account.data_account_type_direct_costs,FALSE
  nz_53000,l10n_nz.l10n_nz_chart_template,53000,Consignment Cost of Sales,account.data_account_type_direct_costs,FALSE
  nz_54000,l10n_nz.l10n_nz_chart_template,54000,Wages for Production Labour,account.data_account_type_direct_costs,FALSE
  nz_55000,l10n_nz.l10n_nz_chart_template,55000,Materials & Supplies,account.data_account_type_direct_costs,FALSE
  nz_56000,l10n_nz.l10n_nz_chart_template,56000,Freight,account.data_account_type_direct_costs,FALSE
  nz_57000,l10n_nz.l10n_nz_chart_template,57000,Other Costs,account.data_account_type_direct_costs,FALSE
  nz_61000,l10n_nz.l10n_nz_chart_template,61000,Advertising,account.data_account_type_expenses,FALSE
  nz_61200,l10n_nz.l10n_nz_chart_template,61200,Car & Truck Expenses,account.data_account_type_expenses,FALSE
  nz_61300,l10n_nz.l10n_nz_chart_template,61300,Commissions Paid,account.data_account_type_expenses,FALSE
  nz_61500,l10n_nz.l10n_nz_chart_template,61500,Depreciation Expense,account.data_account_type_depreciation,FALSE
  nz_61610,l10n_nz.l10n_nz_chart_template,61610,Discounts Given,account.data_account_type_expenses,FALSE
  nz_61620,l10n_nz.l10n_nz_chart_template,61620,Discounts Taken,account.data_account_type_expenses,FALSE
  nz_61630,l10n_nz.l10n_nz_chart_template,61630,Exchange Rate Losses (Gains),account.data_account_type_expenses,FALSE
  nz_61700,l10n_nz.l10n_nz_chart_template,61700,Freight Paid,account.data_account_type_expenses,FALSE
  nz_61800,l10n_nz.l10n_nz_chart_template,61800,Insurance,account.data_account_type_expenses,FALSE
  nz_61910,l10n_nz.l10n_nz_chart_template,61910,Overdraft Interest,account.data_account_type_expenses,FALSE
  nz_61920,l10n_nz.l10n_nz_chart_template,61920,Mortgage Interest,account.data_account_type_expenses,FALSE
  nz_61930,l10n_nz.l10n_nz_chart_template,61930,Other Interest,account.data_account_type_expenses,FALSE
  nz_62000,l10n_nz.l10n_nz_chart_template,62000,Late Fees Paid,account.data_account_type_expenses,FALSE
  nz_62110,l10n_nz.l10n_nz_chart_template,62110,Machinery & Equipment,account.data_account_type_expenses,FALSE
  nz_62120,l10n_nz.l10n_nz_chart_template,62120,Other Business Property,account.data_account_type_expenses,FALSE
  nz_62200,l10n_nz.l10n_nz_chart_template,62200,Legal & Professional Services,account.data_account_type_expenses,FALSE
  nz_62300,l10n_nz.l10n_nz_chart_template,62300,Office Expenses,account.data_account_type_expenses,FALSE
  nz_62410,l10n_nz.l10n_nz_chart_template,62410,Staff Amenities,account.data_account_type_expenses,FALSE
  nz_62420,l10n_nz.l10n_nz_chart_template,62420,Superannuation,account.data_account_type_expenses,FALSE
  nz_62430,l10n_nz.l10n_nz_chart_template,62430,Wages & Salaries,account.data_account_type_expenses,FALSE
  nz_62440,l10n_nz.l10n_nz_chart_template,62440,Workers' Compensation,account.data_account_type_expenses,FALSE
  nz_62450,l10n_nz.l10n_nz_chart_template,62450,Other Employer Expenses,account.data_account_type_expenses,FALSE
  nz_62500,l10n_nz.l10n_nz_chart_template,62500,Repairs,account.data_account_type_expenses,FALSE
  nz_62550,l10n_nz.l10n_nz_chart_template,62550,Shrinkage/Spoilage,account.data_account_type_expenses,FALSE
  nz_62600,l10n_nz.l10n_nz_chart_template,62600,Supplies,account.data_account_type_expenses,FALSE
  nz_62700,l10n_nz.l10n_nz_chart_template,62700,Taxes,account.data_account_type_expenses,FALSE
  nz_62800,l10n_nz.l10n_nz_chart_template,62800,Telephone,account.data_account_type_expenses,FALSE
  nz_62910,l10n_nz.l10n_nz_chart_template,62910,Gas,account.data_account_type_expenses,FALSE
  nz_62920,l10n_nz.l10n_nz_chart_template,62920,Electricity,account.data_account_type_expenses,FALSE
  nz_62930,l10n_nz.l10n_nz_chart_template,62930,Water,account.data_account_type_expenses,FALSE
  nz_63110,l10n_nz.l10n_nz_chart_template,63110,Travel,account.data_account_type_expenses,FALSE
  nz_63120,l10n_nz.l10n_nz_chart_template,63120,Meals & Entertainment,account.data_account_type_expenses,FALSE
  nz_81000,l10n_nz.l10n_nz_chart_template,81000,Interest Income,account.data_account_type_other_income,FALSE
  nz_91000,l10n_nz.l10n_nz_chart_template,91000,Interest Expense,account.data_account_type_expenses,FALSE
  nz_92000,l10n_nz.l10n_nz_chart_template,92000,Income Tax Expense,account.data_account_type_expenses,FALSE