diff --git a/addons/account/project/report/analytic_balance.sxw b/addons/account/project/report/analytic_balance.sxw new file mode 100644 index 0000000000000000000000000000000000000000..cea80fa11052c629754cbb5a248145bf73723a14 Binary files /dev/null and b/addons/account/project/report/analytic_balance.sxw differ diff --git a/addons/account/project/report/analytic_journal.sxw b/addons/account/project/report/analytic_journal.sxw new file mode 100644 index 0000000000000000000000000000000000000000..de3fa533a2b684f0e2060076403fe76226b48c85 Binary files /dev/null and b/addons/account/project/report/analytic_journal.sxw differ diff --git a/addons/account/project/report/cost_ledger.sxw b/addons/account/project/report/cost_ledger.sxw new file mode 100644 index 0000000000000000000000000000000000000000..dc1c18d39e1a291a747136faf55e0e2484fcbd6b Binary files /dev/null and b/addons/account/project/report/cost_ledger.sxw differ diff --git a/addons/account/project/report/inverted_analytic_balance.sxw b/addons/account/project/report/inverted_analytic_balance.sxw new file mode 100644 index 0000000000000000000000000000000000000000..99c4987b1930819aa5f2f45e791921991697820e Binary files /dev/null and b/addons/account/project/report/inverted_analytic_balance.sxw differ diff --git a/addons/account/project/report/quantity_cost_ledger.sxw b/addons/account/project/report/quantity_cost_ledger.sxw new file mode 100644 index 0000000000000000000000000000000000000000..18bf9af328cb4409f99398ae024cf04624f3b200 Binary files /dev/null and b/addons/account/project/report/quantity_cost_ledger.sxw differ diff --git a/addons/account/report/account_aged_partner_balance.py b/addons/account/report/account_aged_partner_balance.py index 3b000e40592e7e99e6c51ca314558541ae61769d..b7c26120b4828c51e3d3ac3d215ce46602d16a1f 100644 --- a/addons/account/report/account_aged_partner_balance.py +++ b/addons/account/report/account_aged_partner_balance.py @@ -159,7 +159,7 @@ class aged_trial_report(report_sxw.rml_parse, common_report_header): dates_query += ' < %s)' args_list += (form[str(i)]['stop'],) args_list += (self.date_from,) - self.cr.execute('''SELECT l.partner_id, SUM(l.debit-l.credit) + self.cr.execute('''SELECT l.partner_id, SUM(l.debit-l.credit), l.reconcile_partial_id FROM account_move_line AS l, account_account, account_move am WHERE (l.account_id = account_account.id) AND (l.move_id=am.id) AND (am.state IN %s) @@ -171,12 +171,24 @@ class aged_trial_report(report_sxw.rml_parse, common_report_header): AND account_account.active AND ''' + dates_query + ''' AND (l.date <= %s) - GROUP BY l.partner_id''', args_list) - t = self.cr.fetchall() - d = {} - for i in t: - d[i[0]] = i[1] - history.append(d) + GROUP BY l.partner_id, l.reconcile_partial_id''', args_list) + partners_partial = self.cr.fetchall() + partners_amount = dict((i[0],0) for i in partners_partial) + for partner_info in partners_partial: + if partner_info[2]: + # in case of partial reconciliation, we want to keep the left amount in the oldest period + self.cr.execute('''SELECT MIN(COALESCE(date_maturity,date)) FROM account_move_line WHERE reconcile_partial_id = %s''', (partner_info[2],)) + date = self.cr.fetchall() + if date and args_list[-3] <= date[0][0] <= args_list[-2]: + # partial reconcilation + self.cr.execute('''SELECT SUM(l.debit-l.credit) + FROM account_move_line AS l + WHERE l.reconcile_partial_id = %s''', (partner_info[2],)) + unreconciled_amount = self.cr.fetchall() + partners_amount[partner_info[0]] += unreconciled_amount[0][0] + else: + partners_amount[partner_info[0]] += partner_info[1] + history.append(partners_amount) for partner in partners: values = {} diff --git a/addons/account/report/account_aged_partner_balance.sxw b/addons/account/report/account_aged_partner_balance.sxw new file mode 100644 index 0000000000000000000000000000000000000000..bce27e551cef823462aeca7b895f3486af3db7fd Binary files /dev/null and b/addons/account/report/account_aged_partner_balance.sxw differ diff --git a/addons/account/report/account_balance.sxw b/addons/account/report/account_balance.sxw new file mode 100644 index 0000000000000000000000000000000000000000..117c0bc386b0c848f4ecfdd0cafecdc3ee198f6f Binary files /dev/null and b/addons/account/report/account_balance.sxw differ diff --git a/addons/account/report/account_central_journal.sxw b/addons/account/report/account_central_journal.sxw new file mode 100644 index 0000000000000000000000000000000000000000..8fd2b46e348c3a876b6d18cf87922686fedd7908 Binary files /dev/null and b/addons/account/report/account_central_journal.sxw differ diff --git a/addons/account/report/account_general_journal.sxw b/addons/account/report/account_general_journal.sxw new file mode 100644 index 0000000000000000000000000000000000000000..631b2e8715121752caa0c4ef3e6b61ee7d1d7b50 Binary files /dev/null and b/addons/account/report/account_general_journal.sxw differ diff --git a/addons/account/report/account_general_ledger.sxw b/addons/account/report/account_general_ledger.sxw new file mode 100644 index 0000000000000000000000000000000000000000..35c1d0bc5ccf0e88a6f09731856fdb1ed21012e9 Binary files /dev/null and b/addons/account/report/account_general_ledger.sxw differ diff --git a/addons/account/report/account_general_ledger_landscape.sxw b/addons/account/report/account_general_ledger_landscape.sxw new file mode 100644 index 0000000000000000000000000000000000000000..815a5adf88a65a559ec90246816b86ab61c79573 Binary files /dev/null and b/addons/account/report/account_general_ledger_landscape.sxw differ diff --git a/addons/account/report/account_journal.sxw b/addons/account/report/account_journal.sxw new file mode 100644 index 0000000000000000000000000000000000000000..5010574eac7068faf3bcda636aef6cbf9a73dd4f Binary files /dev/null and b/addons/account/report/account_journal.sxw differ diff --git a/addons/account/report/account_journal_sale_purchase.sxw b/addons/account/report/account_journal_sale_purchase.sxw new file mode 100644 index 0000000000000000000000000000000000000000..19a77dec18b836c870d6465d31cf0977c9438b02 Binary files /dev/null and b/addons/account/report/account_journal_sale_purchase.sxw differ diff --git a/addons/account/report/account_partner_balance.sxw b/addons/account/report/account_partner_balance.sxw new file mode 100644 index 0000000000000000000000000000000000000000..d721a9df080b8218fa2fb26827125d908fd51315 Binary files /dev/null and b/addons/account/report/account_partner_balance.sxw differ diff --git a/addons/account/report/account_partner_ledger.sxw b/addons/account/report/account_partner_ledger.sxw new file mode 100644 index 0000000000000000000000000000000000000000..f08b997f240e39b220bdc2033b54f345374c0293 Binary files /dev/null and b/addons/account/report/account_partner_ledger.sxw differ diff --git a/addons/account/report/account_partner_ledger_other.sxw b/addons/account/report/account_partner_ledger_other.sxw new file mode 100644 index 0000000000000000000000000000000000000000..811bffc47673bb836a473cd42ed3216679c55464 Binary files /dev/null and b/addons/account/report/account_partner_ledger_other.sxw differ diff --git a/addons/account/report/account_print_invoice.sxw b/addons/account/report/account_print_invoice.sxw new file mode 100644 index 0000000000000000000000000000000000000000..ad2f75913045ae1b0cc502771fe4b19fdd75baf8 Binary files /dev/null and b/addons/account/report/account_print_invoice.sxw differ diff --git a/addons/account/report/account_print_overdue.sxw b/addons/account/report/account_print_overdue.sxw new file mode 100644 index 0000000000000000000000000000000000000000..2faddc7606c54a4ab45deb24f85923d10355d57a Binary files /dev/null and b/addons/account/report/account_print_overdue.sxw differ diff --git a/addons/account/report/account_tax_report.sxw b/addons/account/report/account_tax_report.sxw new file mode 100644 index 0000000000000000000000000000000000000000..2153eec7ef1d3777e0d73656afc21c8739b7e94d Binary files /dev/null and b/addons/account/report/account_tax_report.sxw differ diff --git a/addons/account_analytic_plans/report/crossovered_analytic.sxw b/addons/account_analytic_plans/report/crossovered_analytic.sxw new file mode 100644 index 0000000000000000000000000000000000000000..e1c1cc9c6f374fb4b06b2806584c8e6533b63744 Binary files /dev/null and b/addons/account_analytic_plans/report/crossovered_analytic.sxw differ diff --git a/addons/account_budget/account_budget.py b/addons/account_budget/account_budget.py index 753a5df79f4642308c0f71388090edd51ed4e993..78e85716bbdc3069a210092fc153ce80d617a403 100644 --- a/addons/account_budget/account_budget.py +++ b/addons/account_budget/account_budget.py @@ -22,6 +22,7 @@ import datetime from openerp.osv import fields, osv +from openerp.tools import ustr from openerp.tools.translate import _ import openerp.addons.decimal_precision as dp @@ -114,7 +115,7 @@ class crossovered_budget_lines(osv.osv): for line in self.browse(cr, uid, ids, context=context): acc_ids = [x.id for x in line.general_budget_id.account_ids] if not acc_ids: - raise osv.except_osv(_('Error!'),_("The Budget '%s' has no accounts!") % str(line.general_budget_id.name)) + raise osv.except_osv(_('Error!'),_("The Budget '%s' has no accounts!") % ustr(line.general_budget_id.name)) date_to = line.date_to date_from = line.date_from if context.has_key('wizard_date_from'): diff --git a/addons/account_budget/report/analytic_account_budget_report.sxw b/addons/account_budget/report/analytic_account_budget_report.sxw new file mode 100644 index 0000000000000000000000000000000000000000..f248e6e33dcccf7156081496f6f0b88f2f54eac8 Binary files /dev/null and b/addons/account_budget/report/analytic_account_budget_report.sxw differ diff --git a/addons/account_budget/report/budget_report.sxw b/addons/account_budget/report/budget_report.sxw new file mode 100644 index 0000000000000000000000000000000000000000..84ecf3c39d1ae48432ca89d0041a13ddb5d89c48 Binary files /dev/null and b/addons/account_budget/report/budget_report.sxw differ diff --git a/addons/account_budget/report/crossovered_budget_report.sxw b/addons/account_budget/report/crossovered_budget_report.sxw new file mode 100644 index 0000000000000000000000000000000000000000..8922113b2a0b63e3c93951c5ee50046c5adb4f83 Binary files /dev/null and b/addons/account_budget/report/crossovered_budget_report.sxw differ diff --git a/addons/account_check_writing/report/check_print.sxw b/addons/account_check_writing/report/check_print.sxw new file mode 100644 index 0000000000000000000000000000000000000000..98dae7b4fc9f0e16c89a3505f111a7923beb3745 Binary files /dev/null and b/addons/account_check_writing/report/check_print.sxw differ diff --git a/addons/account_check_writing/report/check_print_bottom.sxw b/addons/account_check_writing/report/check_print_bottom.sxw new file mode 100644 index 0000000000000000000000000000000000000000..baf56526dc9b9abf9ca48aebbc28e7bccac3a661 Binary files /dev/null and b/addons/account_check_writing/report/check_print_bottom.sxw differ diff --git a/addons/account_check_writing/report/check_print_middle.sxw b/addons/account_check_writing/report/check_print_middle.sxw new file mode 100644 index 0000000000000000000000000000000000000000..86e4f280fee9a278b93116f4078ae4bfb1a525e7 Binary files /dev/null and b/addons/account_check_writing/report/check_print_middle.sxw differ diff --git a/addons/account_check_writing/report/check_print_top.sxw b/addons/account_check_writing/report/check_print_top.sxw new file mode 100644 index 0000000000000000000000000000000000000000..f55159d57ee6f15da5d85fefe8eccc2265fd57fc Binary files /dev/null and b/addons/account_check_writing/report/check_print_top.sxw differ diff --git a/addons/account_followup/report/account_followup_print.sxw b/addons/account_followup/report/account_followup_print.sxw new file mode 100644 index 0000000000000000000000000000000000000000..4379aa5abce3bb11c07131e22f3096877585640e Binary files /dev/null and b/addons/account_followup/report/account_followup_print.sxw differ diff --git a/addons/account_payment/report/order.sxw b/addons/account_payment/report/order.sxw new file mode 100644 index 0000000000000000000000000000000000000000..ac3d65c658653bf6fd6f29c96122934602483210 Binary files /dev/null and b/addons/account_payment/report/order.sxw differ diff --git a/addons/account_test/report/account_test.sxw b/addons/account_test/report/account_test.sxw new file mode 100644 index 0000000000000000000000000000000000000000..a4047e151e6be34a9d74b53977249dab1f8dca5d Binary files /dev/null and b/addons/account_test/report/account_test.sxw differ diff --git a/addons/account_voucher/report/account_voucher.sxw b/addons/account_voucher/report/account_voucher.sxw new file mode 100644 index 0000000000000000000000000000000000000000..9db5937944eefe5f01c78687f114f27a006f7b77 Binary files /dev/null and b/addons/account_voucher/report/account_voucher.sxw differ diff --git a/addons/account_voucher/report/account_voucher_print.sxw b/addons/account_voucher/report/account_voucher_print.sxw new file mode 100644 index 0000000000000000000000000000000000000000..452605b57ca7a00dd0841ea402df6c3a38c01649 Binary files /dev/null and b/addons/account_voucher/report/account_voucher_print.sxw differ diff --git a/addons/delivery/report/shipping.sxw b/addons/delivery/report/shipping.sxw new file mode 100644 index 0000000000000000000000000000000000000000..b169a2d7039c015de56eb788093e517765f2e753 Binary files /dev/null and b/addons/delivery/report/shipping.sxw differ diff --git a/addons/hr_attendance/report/attendance_errors.sxw b/addons/hr_attendance/report/attendance_errors.sxw new file mode 100644 index 0000000000000000000000000000000000000000..1faeca382511925edb988d060d45d84a59a04819 Binary files /dev/null and b/addons/hr_attendance/report/attendance_errors.sxw differ diff --git a/addons/hr_expense/report/expense.sxw b/addons/hr_expense/report/expense.sxw new file mode 100644 index 0000000000000000000000000000000000000000..ac31b2d7f2e018c95d7af7787e1af725e45b990f Binary files /dev/null and b/addons/hr_expense/report/expense.sxw differ diff --git a/addons/hr_payroll/report/report_contribution_register.sxw b/addons/hr_payroll/report/report_contribution_register.sxw new file mode 100644 index 0000000000000000000000000000000000000000..01cef632cbbc3894bb93a89784b343e7fb408df4 Binary files /dev/null and b/addons/hr_payroll/report/report_contribution_register.sxw differ diff --git a/addons/hr_payroll/report/report_payslip.sxw b/addons/hr_payroll/report/report_payslip.sxw new file mode 100644 index 0000000000000000000000000000000000000000..1c5b7fce54fb0a29a5640b8e3fbd34d72263b912 Binary files /dev/null and b/addons/hr_payroll/report/report_payslip.sxw differ diff --git a/addons/hr_payroll/report/report_payslip_details.sxw b/addons/hr_payroll/report/report_payslip_details.sxw new file mode 100644 index 0000000000000000000000000000000000000000..ad84d76529278218b8808efb984a3d0ee0b8c226 Binary files /dev/null and b/addons/hr_payroll/report/report_payslip_details.sxw differ diff --git a/addons/hr_timesheet_invoice/report/account_analytic_profit.sxw b/addons/hr_timesheet_invoice/report/account_analytic_profit.sxw new file mode 100644 index 0000000000000000000000000000000000000000..dbd77e8496acac92a1922778b8a2000075323cd9 Binary files /dev/null and b/addons/hr_timesheet_invoice/report/account_analytic_profit.sxw differ diff --git a/addons/l10n_fr/report/bilan_report.sxw b/addons/l10n_fr/report/bilan_report.sxw new file mode 100644 index 0000000000000000000000000000000000000000..45b8476b0bae9c3396b8266a509cdbb4cb14932b Binary files /dev/null and b/addons/l10n_fr/report/bilan_report.sxw differ diff --git a/addons/l10n_fr/report/compute_resultant_report.sxw b/addons/l10n_fr/report/compute_resultant_report.sxw new file mode 100644 index 0000000000000000000000000000000000000000..69ec388218029b4dcb66b9fac5aae425615f3750 Binary files /dev/null and b/addons/l10n_fr/report/compute_resultant_report.sxw differ diff --git a/addons/l10n_in_hr_payroll/report/report_hr_salary_employee_bymonth.sxw b/addons/l10n_in_hr_payroll/report/report_hr_salary_employee_bymonth.sxw new file mode 100644 index 0000000000000000000000000000000000000000..4eb40f3edc9cb66b25b8373738706026d5d4aaed Binary files /dev/null and b/addons/l10n_in_hr_payroll/report/report_hr_salary_employee_bymonth.sxw differ diff --git a/addons/l10n_in_hr_payroll/report/report_hr_yearly_salary_detail.sxw b/addons/l10n_in_hr_payroll/report/report_hr_yearly_salary_detail.sxw new file mode 100644 index 0000000000000000000000000000000000000000..e1a6f012fbd830570460f234f0f5009c6c59f2d9 Binary files /dev/null and b/addons/l10n_in_hr_payroll/report/report_hr_yearly_salary_detail.sxw differ diff --git a/addons/l10n_in_hr_payroll/report/report_payroll_advice.sxw b/addons/l10n_in_hr_payroll/report/report_payroll_advice.sxw new file mode 100644 index 0000000000000000000000000000000000000000..46b3596ae544b7a58b99edf5a815e345b69f6db2 Binary files /dev/null and b/addons/l10n_in_hr_payroll/report/report_payroll_advice.sxw differ diff --git a/addons/l10n_in_hr_payroll/report/report_payslip_details.sxw b/addons/l10n_in_hr_payroll/report/report_payslip_details.sxw new file mode 100644 index 0000000000000000000000000000000000000000..782297d9324cec88f5e063d0c212607acd373b37 Binary files /dev/null and b/addons/l10n_in_hr_payroll/report/report_payslip_details.sxw differ diff --git a/addons/lunch/report/order.sxw b/addons/lunch/report/order.sxw new file mode 100644 index 0000000000000000000000000000000000000000..c8ec7ac3d474f8b29cd9c23eaf99f6e7df1bf821 Binary files /dev/null and b/addons/lunch/report/order.sxw differ diff --git a/addons/mrp/report/bom_structure.sxw b/addons/mrp/report/bom_structure.sxw new file mode 100644 index 0000000000000000000000000000000000000000..3cf1cf10086be629cf45c5f0f4db13600c374471 Binary files /dev/null and b/addons/mrp/report/bom_structure.sxw differ diff --git a/addons/mrp/report/order.sxw b/addons/mrp/report/order.sxw new file mode 100644 index 0000000000000000000000000000000000000000..2786a2e50d36708159dc184eb6b32d87ecdc4805 Binary files /dev/null and b/addons/mrp/report/order.sxw differ diff --git a/addons/point_of_sale/report/account_statement.sxw b/addons/point_of_sale/report/account_statement.sxw new file mode 100644 index 0000000000000000000000000000000000000000..bc251a62bbf6412da5b6db3671e8afe56d4298d1 Binary files /dev/null and b/addons/point_of_sale/report/account_statement.sxw differ diff --git a/addons/point_of_sale/report/all_closed_cashbox_of_the_day.sxw b/addons/point_of_sale/report/all_closed_cashbox_of_the_day.sxw new file mode 100644 index 0000000000000000000000000000000000000000..957700631d6b71222597a575346af2b976c6c20e Binary files /dev/null and b/addons/point_of_sale/report/all_closed_cashbox_of_the_day.sxw differ diff --git a/addons/point_of_sale/report/pos_details.sxw b/addons/point_of_sale/report/pos_details.sxw new file mode 100644 index 0000000000000000000000000000000000000000..5f5bb4c412f5b4b508c02d37c9c089c098ce1725 Binary files /dev/null and b/addons/point_of_sale/report/pos_details.sxw differ diff --git a/addons/point_of_sale/report/pos_details_summary.sxw b/addons/point_of_sale/report/pos_details_summary.sxw new file mode 100644 index 0000000000000000000000000000000000000000..5ce7a41895a54cfa14e7112c69e5788197dcd4b8 Binary files /dev/null and b/addons/point_of_sale/report/pos_details_summary.sxw differ diff --git a/addons/point_of_sale/report/pos_lines.sxw b/addons/point_of_sale/report/pos_lines.sxw new file mode 100644 index 0000000000000000000000000000000000000000..01df62383001defc5c5518b36f0942adc7031a6b Binary files /dev/null and b/addons/point_of_sale/report/pos_lines.sxw differ diff --git a/addons/point_of_sale/report/pos_payment_report_user.sxw b/addons/point_of_sale/report/pos_payment_report_user.sxw new file mode 100644 index 0000000000000000000000000000000000000000..fbe04ed9d5e610b824330a9aabb68fc531edf147 Binary files /dev/null and b/addons/point_of_sale/report/pos_payment_report_user.sxw differ diff --git a/addons/point_of_sale/report/pos_receipt.sxw b/addons/point_of_sale/report/pos_receipt.sxw new file mode 100644 index 0000000000000000000000000000000000000000..7baf80e1603ad4f9030b4f5b94c55f29030f6367 Binary files /dev/null and b/addons/point_of_sale/report/pos_receipt.sxw differ diff --git a/addons/point_of_sale/report/pos_sales_user.sxw b/addons/point_of_sale/report/pos_sales_user.sxw new file mode 100644 index 0000000000000000000000000000000000000000..cab80ff4f556afc1e2ec07a7596c4b45dc9b2cf3 Binary files /dev/null and b/addons/point_of_sale/report/pos_sales_user.sxw differ diff --git a/addons/point_of_sale/report/pos_sales_user_today.sxw b/addons/point_of_sale/report/pos_sales_user_today.sxw new file mode 100644 index 0000000000000000000000000000000000000000..81554e65d89633be64396c27fbcd781ba905b57d Binary files /dev/null and b/addons/point_of_sale/report/pos_sales_user_today.sxw differ diff --git a/addons/point_of_sale/report/pos_users_product.sxw b/addons/point_of_sale/report/pos_users_product.sxw new file mode 100644 index 0000000000000000000000000000000000000000..ec934d807ee5b67695d81d6151d51e4ef1ea1a3a Binary files /dev/null and b/addons/point_of_sale/report/pos_users_product.sxw differ diff --git a/addons/product/report/product_pricelist.sxw b/addons/product/report/product_pricelist.sxw new file mode 100644 index 0000000000000000000000000000000000000000..40d7a0d96429700acb505f517a212267250b6943 Binary files /dev/null and b/addons/product/report/product_pricelist.sxw differ diff --git a/addons/purchase/report/order.sxw b/addons/purchase/report/order.sxw new file mode 100644 index 0000000000000000000000000000000000000000..827bcb1efe51160dae7235b434a9928d20cd675a Binary files /dev/null and b/addons/purchase/report/order.sxw differ diff --git a/addons/purchase/report/request_quotation.sxw b/addons/purchase/report/request_quotation.sxw new file mode 100644 index 0000000000000000000000000000000000000000..8c242cb12845695c9f144dc7f6061e25afdcf3dc Binary files /dev/null and b/addons/purchase/report/request_quotation.sxw differ diff --git a/addons/purchase_requisition/report/purchase_requisition.sxw b/addons/purchase_requisition/report/purchase_requisition.sxw new file mode 100644 index 0000000000000000000000000000000000000000..1d6c2c69c7020dc60820b4e907cd42a7ffc42a8e Binary files /dev/null and b/addons/purchase_requisition/report/purchase_requisition.sxw differ diff --git a/addons/report_intrastat/report/invoice.sxw b/addons/report_intrastat/report/invoice.sxw new file mode 100644 index 0000000000000000000000000000000000000000..11ed9cd7db1b868a737ca8c97388f65f81c25369 Binary files /dev/null and b/addons/report_intrastat/report/invoice.sxw differ diff --git a/addons/report_webkit/webkit_report.py b/addons/report_webkit/webkit_report.py index 60fb536ca961c3275bc9062fe5f06838d7a3c0ad..c442ea32549ae210a0b06ef5167a161e027e7862 100644 --- a/addons/report_webkit/webkit_report.py +++ b/addons/report_webkit/webkit_report.py @@ -156,8 +156,8 @@ class WebKitParser(report_sxw): """Call webkit in order to generate pdf""" if not webkit_header: webkit_header = report_xml.webkit_header - tmp_dir = tempfile.gettempdir() - out_filename = tempfile.mktemp(suffix=".pdf", prefix="webkit.tmp.") + fd, out_filename = tempfile.mkstemp(suffix=".pdf", + prefix="webkit.tmp.") file_to_del = [out_filename] if comm_path: command = [comm_path] @@ -168,25 +168,15 @@ class WebKitParser(report_sxw): # default to UTF-8 encoding. Use <meta charset="latin-1"> to override. command.extend(['--encoding', 'utf-8']) if header : - head_file = file( os.path.join( - tmp_dir, - str(time.time()) + '.head.html' - ), - 'w' - ) - head_file.write(self._sanitize_html(header.encode('utf-8'))) - head_file.close() + with tempfile.NamedTemporaryFile(suffix=".head.html", + delete=False) as head_file: + head_file.write(self._sanitize_html(header.encode('utf-8'))) file_to_del.append(head_file.name) command.extend(['--header-html', head_file.name]) if footer : - foot_file = file( os.path.join( - tmp_dir, - str(time.time()) + '.foot.html' - ), - 'w' - ) - foot_file.write(self._sanitize_html(footer.encode('utf-8'))) - foot_file.close() + with tempfile.NamedTemporaryFile(suffix=".foot.html", + delete=False) as foot_file: + foot_file.write(self._sanitize_html(footer.encode('utf-8'))) file_to_del.append(foot_file.name) command.extend(['--footer-html', foot_file.name]) @@ -204,10 +194,10 @@ class WebKitParser(report_sxw): command.extend(['--page-size', str(webkit_header.format).replace(',', '.')]) count = 0 for html in html_list : - html_file = file(os.path.join(tmp_dir, str(time.time()) + str(count) +'.body.html'), 'w') - count += 1 - html_file.write(self._sanitize_html(html.encode('utf-8'))) - html_file.close() + with tempfile.NamedTemporaryFile(suffix="%d.body.html" %count, + delete=False) as html_file: + count += 1 + html_file.write(self._sanitize_html(html.encode('utf-8'))) file_to_del.append(html_file.name) command.append(html_file.name) command.append(out_filename) @@ -227,9 +217,9 @@ class WebKitParser(report_sxw): if status : raise except_osv(_('Webkit error' ), _("The command 'wkhtmltopdf' failed with error code = %s. Message: %s") % (status, error_message)) - pdf_file = open(out_filename, 'rb') - pdf = pdf_file.read() - pdf_file.close() + with open(out_filename, 'rb') as pdf_file: + pdf = pdf_file.read() + os.close(fd) finally: if stderr_fd is not None: os.close(stderr_fd) diff --git a/addons/sale/report/sale_order.sxw b/addons/sale/report/sale_order.sxw new file mode 100644 index 0000000000000000000000000000000000000000..4ae68b6060bb47089453653729e43a7d6e773473 Binary files /dev/null and b/addons/sale/report/sale_order.sxw differ diff --git a/addons/stock/report/lot_overview.sxw b/addons/stock/report/lot_overview.sxw new file mode 100644 index 0000000000000000000000000000000000000000..25f42603e5de54a0f5966e06bd59a8741c1cd9fa Binary files /dev/null and b/addons/stock/report/lot_overview.sxw differ diff --git a/addons/stock/report/lot_overview_all.sxw b/addons/stock/report/lot_overview_all.sxw new file mode 100644 index 0000000000000000000000000000000000000000..c774f1bae9f90d9c7694110b67ff6e9d4818960d Binary files /dev/null and b/addons/stock/report/lot_overview_all.sxw differ diff --git a/addons/stock/report/picking.sxw b/addons/stock/report/picking.sxw new file mode 100644 index 0000000000000000000000000000000000000000..b397c285146072d2c5b0a52d1869ffb767cc224f Binary files /dev/null and b/addons/stock/report/picking.sxw differ diff --git a/addons/stock/report/stock_inventory_move.sxw b/addons/stock/report/stock_inventory_move.sxw new file mode 100644 index 0000000000000000000000000000000000000000..bb6084a9ca030ade1770095fcd4e1015a82fdcaf Binary files /dev/null and b/addons/stock/report/stock_inventory_move.sxw differ diff --git a/openerp/report/render/rml2pdf/trml2pdf.py b/openerp/report/render/rml2pdf/trml2pdf.py index 6061c78e8133dd91734e1d0612cc21cf82c521c1..38308209999c1b44d3cecca68f39e3f985c122e9 100644 --- a/openerp/report/render/rml2pdf/trml2pdf.py +++ b/openerp/report/render/rml2pdf/trml2pdf.py @@ -1007,6 +1007,8 @@ class _rml_template(object): if story_cnt > 0: fis.append(platypus.PageBreak()) fis += r.render(node_story) + # Reset Page Number with new story tag + fis.append(PageReset()) story_cnt += 1 try: if self.localcontext and self.localcontext.get('internal_header',False):