diff --git a/addons/account/project/report/analytic_balance.sxw b/addons/account/project/report/analytic_balance.sxw new file mode 100644 index 00000000000..cea80fa1105 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 00000000000..de3fa533a2b 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 00000000000..dc1c18d39e1 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 00000000000..99c4987b193 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 00000000000..18bf9af328c 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 3b000e40592..b7c26120b48 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 00000000000..bce27e551ce 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 00000000000..117c0bc386b 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 00000000000..8fd2b46e348 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 00000000000..631b2e87151 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 00000000000..35c1d0bc5cc 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 00000000000..815a5adf88a 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 00000000000..5010574eac7 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 00000000000..19a77dec18b 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 00000000000..d721a9df080 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 00000000000..f08b997f240 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 00000000000..811bffc4767 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 00000000000..ad2f7591304 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 00000000000..2faddc7606c 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 00000000000..2153eec7ef1 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 00000000000..e1c1cc9c6f3 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 753a5df79f4..78e85716bbd 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 00000000000..f248e6e33dc 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 00000000000..84ecf3c39d1 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 00000000000..8922113b2a0 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 00000000000..98dae7b4fc9 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 00000000000..baf56526dc9 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 00000000000..86e4f280fee 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 00000000000..f55159d57ee 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 00000000000..4379aa5abce 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 00000000000..ac3d65c6586 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 00000000000..a4047e151e6 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 00000000000..9db5937944e 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 00000000000..452605b57ca 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 00000000000..b169a2d7039 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 00000000000..1faeca38251 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 00000000000..ac31b2d7f2e 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 00000000000..01cef632cbb 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 00000000000..1c5b7fce54f 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 00000000000..ad84d765292 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 00000000000..dbd77e8496a 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 00000000000..45b8476b0ba 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 00000000000..69ec3882180 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 00000000000..4eb40f3edc9 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 00000000000..e1a6f012fbd 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 00000000000..46b3596ae54 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 00000000000..782297d9324 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 00000000000..c8ec7ac3d47 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 00000000000..3cf1cf10086 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 00000000000..2786a2e50d3 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 00000000000..bc251a62bbf 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 00000000000..957700631d6 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 00000000000..5f5bb4c412f 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 00000000000..5ce7a41895a 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 00000000000..01df6238300 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 00000000000..fbe04ed9d5e 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 00000000000..7baf80e1603 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 00000000000..cab80ff4f55 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 00000000000..81554e65d89 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 00000000000..ec934d807ee 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 00000000000..40d7a0d9642 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 00000000000..827bcb1efe5 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 00000000000..8c242cb1284 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 00000000000..1d6c2c69c70 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 00000000000..11ed9cd7db1 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 60fb536ca96..c442ea32549 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 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 00000000000..4ae68b6060b 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 00000000000..25f42603e5d 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 00000000000..c774f1bae9f 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 00000000000..b397c285146 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 00000000000..bb6084a9ca0 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 6061c78e813..38308209999 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):