summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchm@openerp.com <>2014-04-09 18:21:15 +0200
committerchm@openerp.com <>2014-04-09 18:21:15 +0200
commitcb9990f48213357d9af2f8928e2b253e312cb770 (patch)
treedc7b0fec1ea3b3eb164240218add2d01b8ff78f0
parent0e062e61b26d2cdbe9016400c968ba6502e6c081 (diff)
parent35d6a6f8a8bb4b116e03d5781c89379bfa02feb2 (diff)
[MERGE] from trunk
bzr revid: chm@openerp.com-20140409162115-pelt0qn3ocvzaup5
-rw-r--r--addons/account/__openerp__.py23
-rw-r--r--addons/account/account_invoice.py14
-rw-r--r--addons/account/account_report.xml175
-rw-r--r--addons/account/project/project_report.xml65
-rw-r--r--addons/account/project/report/account_journal.py49
-rw-r--r--addons/account/project/report/analytic_balance.py15
-rw-r--r--addons/account/project/report/analytic_balance.rml234
-rw-r--r--addons/account/project/report/analytic_journal.py10
-rw-r--r--addons/account/project/report/analytic_journal.rml346
-rw-r--r--addons/account/project/report/cost_ledger.py10
-rw-r--r--addons/account/project/report/cost_ledger.rml305
-rw-r--r--addons/account/project/report/inverted_analytic_balance.py9
-rw-r--r--addons/account/project/report/inverted_analytic_balance.rml229
-rw-r--r--addons/account/project/report/quantity_cost_ledger.py13
-rw-r--r--addons/account/project/report/quantity_cost_ledger.rml281
-rw-r--r--addons/account/project/views/report_analyticbalance.xml62
-rw-r--r--addons/account/project/views/report_analyticcostledger.xml90
-rw-r--r--addons/account/project/views/report_analyticcostledgerquantity.xml87
-rw-r--r--addons/account/project/views/report_analyticjournal.xml90
-rw-r--r--addons/account/project/views/report_invertedanalyticbalance.xml91
-rw-r--r--addons/account/project/wizard/account_analytic_balance_report.py20
-rw-r--r--addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report.py19
-rw-r--r--addons/account/project/wizard/account_analytic_cost_ledger_report.py19
-rw-r--r--addons/account/project/wizard/account_analytic_inverted_balance_report.py18
-rw-r--r--addons/account/project/wizard/account_analytic_journal_report.py22
-rw-r--r--addons/account/report/__init__.py4
-rw-r--r--addons/account/report/account_aged_partner_balance.py9
-rw-r--r--addons/account/report/account_aged_partner_balance.rml285
-rw-r--r--addons/account/report/account_balance.py14
-rw-r--r--addons/account/report/account_balance.rml313
-rw-r--r--addons/account/report/account_central_journal.py10
-rw-r--r--addons/account/report/account_central_journal.rml338
-rw-r--r--addons/account/report/account_financial_report.py9
-rw-r--r--addons/account/report/account_financial_report.rml303
-rw-r--r--addons/account/report/account_general_journal.py11
-rw-r--r--addons/account/report/account_general_journal.rml387
-rw-r--r--addons/account/report/account_general_ledger.py10
-rw-r--r--addons/account/report/account_general_ledger.rml619
-rw-r--r--addons/account/report/account_general_ledger_landscape.rml658
-rw-r--r--addons/account/report/account_journal.py19
-rw-r--r--addons/account/report/account_journal.rml311
-rw-r--r--addons/account/report/account_journal_sale_purchase.rml346
-rw-r--r--addons/account/report/account_partner_balance.py10
-rw-r--r--addons/account/report/account_partner_balance.rml257
-rw-r--r--addons/account/report/account_partner_ledger.py23
-rw-r--r--addons/account/report/account_partner_ledger.rml658
-rw-r--r--addons/account/report/account_partner_ledger_other.rml665
-rw-r--r--addons/account/report/account_print_invoice.rml373
-rw-r--r--addons/account/report/account_print_overdue.py32
-rw-r--r--addons/account/report/account_print_overdue.rml290
-rw-r--r--addons/account/report/report_vat.py131
-rw-r--r--addons/account/test/account_report.yml9
-rw-r--r--addons/account/views/report_agedpartnerbalance.xml133
-rw-r--r--addons/account/views/report_centraljournal.xml93
-rw-r--r--addons/account/views/report_financial.xml128
-rw-r--r--addons/account/views/report_generaljournal.xml98
-rw-r--r--addons/account/views/report_generalledger.xml133
-rw-r--r--addons/account/views/report_invoice.xml153
-rw-r--r--addons/account/views/report_journal.xml88
-rw-r--r--addons/account/views/report_overdue.xml118
-rw-r--r--addons/account/views/report_partnerbalance.xml125
-rw-r--r--addons/account/views/report_partnerledger.xml131
-rw-r--r--addons/account/views/report_partnerledgerother.xml131
-rw-r--r--addons/account/views/report_salepurchasejournal.xml107
-rw-r--r--addons/account/views/report_trialbalance.xml94
-rw-r--r--addons/account/views/report_vat.xml2
-rw-r--r--addons/account/wizard/account_financial_report.py10
-rw-r--r--addons/account/wizard/account_report_account_balance.py3
-rw-r--r--addons/account/wizard/account_report_aged_partner_balance.py8
-rw-r--r--addons/account/wizard/account_report_central_journal.py9
-rw-r--r--addons/account/wizard/account_report_general_journal.py5
-rw-r--r--addons/account/wizard/account_report_general_ledger.py8
-rw-r--r--addons/account/wizard/account_report_partner_balance.py9
-rw-r--r--addons/account/wizard/account_report_partner_ledger.py21
-rw-r--r--addons/account/wizard/account_report_print_journal.py10
-rw-r--r--addons/account/wizard/account_vat.py3
-rw-r--r--addons/account_analytic_plans/__openerp__.py2
-rw-r--r--addons/account_analytic_plans/account_analytic_plans_report.xml13
-rw-r--r--addons/account_analytic_plans/report/crossovered_analytic.py11
-rw-r--r--addons/account_analytic_plans/report/crossovered_analytic.rml304
-rw-r--r--addons/account_analytic_plans/test/acount_analytic_plans_report.yml2
-rw-r--r--addons/account_analytic_plans/views/report_crossoveredanalyticplans.xml66
-rw-r--r--addons/account_analytic_plans/wizard/account_crossovered_analytic.py7
-rw-r--r--addons/account_bank_statement_extensions/__openerp__.py1
-rw-r--r--addons/account_bank_statement_extensions/account_bank_statement_report.xml23
-rw-r--r--addons/account_bank_statement_extensions/report/bank_statement_balance_report.py19
-rw-r--r--addons/account_bank_statement_extensions/report/bank_statement_balance_report.rml145
-rw-r--r--addons/account_bank_statement_extensions/views/report_bankstatementbalance.xml35
-rw-r--r--addons/account_budget/__openerp__.py8
-rw-r--r--addons/account_budget/account_budget_report.xml48
-rw-r--r--addons/account_budget/report/analytic_account_budget_report.py11
-rw-r--r--addons/account_budget/report/analytic_account_budget_report.rml226
-rw-r--r--addons/account_budget/report/budget_report.py8
-rw-r--r--addons/account_budget/report/budget_report.rml188
-rw-r--r--addons/account_budget/report/crossovered_budget_report.py14
-rw-r--r--addons/account_budget/report/crossovered_budget_report.rml203
-rw-r--r--addons/account_budget/test/account_budget_report.yml25
-rw-r--r--addons/account_budget/views/report_analyticaccountbudget.xml69
-rw-r--r--addons/account_budget/views/report_budget.xml77
-rw-r--r--addons/account_budget/views/report_crossoveredbudget.xml81
-rw-r--r--addons/account_budget/wizard/account_budget_analytic.py21
-rw-r--r--addons/account_budget/wizard/account_budget_crossovered_report.py17
-rw-r--r--addons/account_budget/wizard/account_budget_crossovered_summary_report.py20
-rw-r--r--addons/account_budget/wizard/account_budget_report.py20
-rw-r--r--addons/account_check_writing/__openerp__.py4
-rw-r--r--addons/account_check_writing/account_check_writing_report.xml36
-rw-r--r--addons/account_check_writing/data/report_paperformat.xml20
-rw-r--r--addons/account_check_writing/report/check_print.py29
-rw-r--r--addons/account_check_writing/report/check_print_bottom.rml318
-rw-r--r--addons/account_check_writing/report/check_print_middle.rml356
-rw-r--r--addons/account_check_writing/report/check_print_top.rml336
-rw-r--r--addons/account_check_writing/views/report_check.xml48
-rw-r--r--addons/account_followup/__openerp__.py3
-rw-r--r--addons/account_followup/account_followup.py10
-rw-r--r--addons/account_followup/account_followup_reports.xml14
-rw-r--r--addons/account_followup/account_followup_view.xml1
-rw-r--r--addons/account_followup/report/account_followup_print.py12
-rw-r--r--addons/account_followup/report/account_followup_print.rml238
-rw-r--r--addons/account_followup/tests/test_account_followup.py4
-rw-r--r--addons/account_followup/views/report_followup.xml58
-rw-r--r--addons/account_followup/wizard/account_followup_print.py8
-rw-r--r--addons/account_payment/__openerp__.py2
-rw-r--r--addons/account_payment/account_payment_report.xml9
-rw-r--r--addons/account_payment/report/order.rml290
-rw-r--r--addons/account_payment/report/payment_order.py10
-rw-r--r--addons/account_payment/test/account_payment_report.yml2
-rw-r--r--addons/account_payment/views/report_paymentorder.xml109
-rw-r--r--addons/account_test/__openerp__.py15
-rw-r--r--addons/account_test/account_test_report.xml21
-rw-r--r--addons/account_test/report/account_test.rml78
-rw-r--r--addons/account_test/report/account_test_report.py11
-rw-r--r--addons/account_test/views/report_accounttest.xml23
-rw-r--r--addons/account_voucher/__openerp__.py2
-rw-r--r--addons/account_voucher/account_voucher_report.xml23
-rw-r--r--addons/account_voucher/report/__init__.py2
-rw-r--r--addons/account_voucher/report/account_voucher.py75
-rw-r--r--addons/account_voucher/report/account_voucher.rml446
-rw-r--r--addons/account_voucher/report/account_voucher_print.py96
-rw-r--r--addons/account_voucher/report/account_voucher_print.rml331
-rw-r--r--addons/account_voucher/test/account_voucher_report.yml27
-rw-r--r--addons/document/document.py4
-rw-r--r--addons/edi/edi_service.py12
-rw-r--r--addons/event/event.py9
-rw-r--r--addons/gamification/models/goal.py2
-rw-r--r--addons/l10n_lu/__init__.py2
-rw-r--r--addons/l10n_lu/__openerp__.py5
-rw-r--r--addons/l10n_lu/test/l10n_lu_report.yml18
-rw-r--r--addons/l10n_lu/wizard/TVA_MEN_09_xxxx.pdfbin384828 -> 0 bytes
-rw-r--r--addons/l10n_lu/wizard/TVA_TRI_10_xxxx.pdfbin291286 -> 0 bytes
-rw-r--r--addons/l10n_lu/wizard/__init__.py24
-rw-r--r--addons/l10n_lu/wizard/pdf_ext.py110
-rw-r--r--addons/l10n_lu/wizard/print_vat.py96
-rw-r--r--addons/l10n_lu/wizard/print_vat_view.xml39
-rw-r--r--addons/lunch/__openerp__.py2
-rw-r--r--addons/lunch/report/order.py29
-rw-r--r--addons/lunch/security/lunch_security.xml38
-rw-r--r--addons/mail/data/mail_data.xml11
-rw-r--r--addons/mail/static/src/css/mail.css2
-rw-r--r--addons/mail/static/src/js/mail_followers.js35
-rw-r--r--addons/mail/static/src/xml/mail_followers.xml28
-rw-r--r--addons/mrp/__openerp__.py2
-rw-r--r--addons/mrp/report/bom_structure.py29
-rw-r--r--addons/procurement/schedulers.py4
-rw-r--r--addons/procurement/wizard/orderpoint_procurement.py2
-rw-r--r--addons/procurement/wizard/schedulers_all.py2
-rw-r--r--addons/purchase/__openerp__.py2
-rw-r--r--addons/report/controllers/main.py108
-rw-r--r--addons/report/models/__init__.py1
-rw-r--r--addons/report/models/abstract_report.py65
-rw-r--r--addons/report/models/report.py316
-rw-r--r--addons/report/models/report_paperformat.py4
-rw-r--r--addons/report/static/src/js/qwebactionmanager.js71
-rw-r--r--addons/report/tests/test_reports.py50
-rw-r--r--addons/report/views/layouts.xml13
-rw-r--r--addons/report_intrastat/__init__.py2
-rw-r--r--addons/report_intrastat/__openerp__.py5
-rw-r--r--addons/report_intrastat/intrastat_report.xml20
-rw-r--r--addons/report_intrastat/report/__init__.py22
-rw-r--r--addons/report_intrastat/report/invoice.py35
-rw-r--r--addons/report_intrastat/report/invoice.rml401
-rw-r--r--addons/report_intrastat/test/report_intrastat_report.yml2
-rw-r--r--addons/report_intrastat/views/report_intrastatinvoice.xml149
-rw-r--r--addons/sale/__openerp__.py2
-rw-r--r--addons/sale/views/report_saleorder.xml240
-rw-r--r--addons/sale_layout/__init__.py1
-rw-r--r--addons/sale_layout/__openerp__.py (renamed from addons/account/report/account_print_invoice.py)41
-rw-r--r--addons/sale_layout/data/sale_layout_category_data.xml20
-rw-r--r--addons/sale_layout/models/__init__.py1
-rw-r--r--addons/sale_layout/models/sale_layout.py146
-rw-r--r--addons/sale_layout/security/ir.model.access.csv5
-rw-r--r--addons/sale_layout/views/report_invoice_layouted.xml65
-rw-r--r--addons/sale_layout/views/report_quotation_layouted.xml70
-rw-r--r--addons/sale_layout/views/sale_layout_category_view.xml120
-rw-r--r--addons/sale_layout/views/sale_layout_template.xml43
-rw-r--r--addons/website/controllers/main.py67
-rw-r--r--addons/website/models/ir_ui_view.py2
-rw-r--r--addons/website/models/website.py2
-rw-r--r--addons/website/static/src/css/editor.css33
-rw-r--r--addons/website/static/src/css/editor.sass30
-rw-r--r--addons/website/static/src/css/snippets.css15
-rw-r--r--addons/website/static/src/css/snippets.sass15
-rw-r--r--addons/website/static/src/css/website.css59
-rw-r--r--addons/website/static/src/css/website.sass48
-rw-r--r--addons/website/static/src/js/jQuery.transfo.js433
-rw-r--r--addons/website/static/src/js/website.editor.js677
-rw-r--r--addons/website/static/src/js/website.snippets.animation.js7
-rw-r--r--addons/website/static/src/js/website.snippets.editor.js108
-rw-r--r--addons/website/static/src/js/website.tour.banner.js2
-rw-r--r--addons/website/static/src/xml/website.editor.xml237
-rw-r--r--addons/website/static/src/xml/website.snippets.xml2
-rw-r--r--addons/website/tests/test_requests.py91
-rw-r--r--addons/website/views/snippets.xml32
-rw-r--r--addons/website/views/website_templates.xml2
-rw-r--r--addons/website_blog/__openerp__.py2
-rw-r--r--addons/website_blog/controllers/main.py238
-rw-r--r--addons/website_blog/data/website_blog_data.xml3
-rw-r--r--addons/website_blog/data/website_blog_demo.xml468
-rw-r--r--addons/website_blog/doc/blog_blog.rst20
-rw-r--r--addons/website_blog/doc/changelog.rst26
-rw-r--r--addons/website_blog/doc/controller.rst21
-rw-r--r--addons/website_blog/models/__init__.py1
-rw-r--r--addons/website_blog/models/mail_message.py13
-rw-r--r--addons/website_blog/models/website_blog.py156
-rw-r--r--addons/website_blog/static/lib/contentshare.js63
-rw-r--r--addons/website_blog/static/src/css/website_blog.css130
-rw-r--r--addons/website_blog/static/src/css/website_blog.sass116
-rw-r--r--addons/website_blog/static/src/img/CMS_WMS_screens.jpgbin0 -> 23187 bytes
-rw-r--r--addons/website_blog/static/src/img/anonymous.pngbin0 -> 1586 bytes
-rw-r--r--addons/website_blog/static/src/img/mail-sc-00.pngbin0 -> 21784 bytes
-rw-r--r--addons/website_blog/static/src/img/mail-sc-03.pngbin0 -> 71427 bytes
-rw-r--r--addons/website_blog/static/src/img/post1.jpgbin0 -> 77421 bytes
-rw-r--r--addons/website_blog/static/src/img/post2.jpgbin0 -> 69043 bytes
-rw-r--r--addons/website_blog/static/src/js/website_blog.editor.js33
-rw-r--r--addons/website_blog/static/src/js/website_blog.inline.discussion.js199
-rw-r--r--addons/website_blog/static/src/js/website_blog.js40
-rw-r--r--addons/website_blog/static/src/xml/website_blog.inline.discussion.xml38
-rw-r--r--addons/website_blog/views/website_blog_templates.xml314
-rw-r--r--addons/website_blog/views/website_blog_views.xml7
-rw-r--r--addons/website_event_track/models/event.py8
-rw-r--r--addons/website_partner/website_partner_demo.xml7
-rw-r--r--addons/website_report/views/layouts.xml27
-rw-r--r--addons/website_sale/static/src/js/website.tour.shop.js30
242 files changed, 7275 insertions, 13813 deletions
diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py
index 95ecdc8c35a..1a222b2f83c 100644
--- a/addons/account/__openerp__.py
+++ b/addons/account/__openerp__.py
@@ -49,7 +49,7 @@ for a particular financial year and for preparation of vouchers there is a modul
""",
'website': 'http://www.openerp.com',
'images' : ['images/accounts.jpeg','images/bank_statement.jpeg','images/cash_register.jpeg','images/chart_of_accounts.jpeg','images/customer_invoice.jpeg','images/journal_entries.jpeg'],
- 'depends' : ['base_setup', 'product', 'analytic', 'process', 'board', 'edi'],
+ 'depends' : ['base_setup', 'product', 'analytic', 'process', 'board', 'edi', 'report'],
'data': [
'security/account_security.xml',
'security/ir.model.access.csv',
@@ -126,6 +126,24 @@ for a particular financial year and for preparation of vouchers there is a modul
'account_pre_install.yml',
'views/report_vat.xml',
+ 'views/report_invoice.xml',
+ 'views/report_trialbalance.xml',
+ 'views/report_centraljournal.xml',
+ 'views/report_overdue.xml',
+ 'views/report_generaljournal.xml',
+ 'views/report_journal.xml',
+ 'views/report_salepurchasejournal.xml',
+ 'views/report_partnerbalance.xml',
+ 'views/report_agedpartnerbalance.xml',
+ 'views/report_partnerledger.xml',
+ 'views/report_partnerledgerother.xml',
+ 'views/report_financial.xml',
+ 'views/report_generalledger.xml',
+ 'project/views/report_analyticbalance.xml',
+ 'project/views/report_analyticjournal.xml',
+ 'project/views/report_analyticcostledgerquantity.xml',
+ 'project/views/report_analyticcostledger.xml',
+ 'project/views/report_invertedanalyticbalance.xml',
],
'js': [
'static/src/js/account_move_reconciliation.js',
@@ -157,8 +175,6 @@ for a particular financial year and for preparation of vouchers there is a modul
'test/account_period_close.yml',
'test/account_use_model.yml',
'test/account_validate_account_move.yml',
- #'test/account_bank_statement.yml',
- #'test/account_cash_statement.yml',
'test/test_edi_invoice.yml',
'test/account_report.yml',
'test/account_fiscalyear_close.yml', #last test, as it will definitively close the demo fiscalyear
@@ -166,4 +182,5 @@ for a particular financial year and for preparation of vouchers there is a modul
'installable': True,
'auto_install': False,
}
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py
index 06e59232ac9..effc2b03f61 100644
--- a/addons/account/account_invoice.py
+++ b/addons/account/account_invoice.py
@@ -409,17 +409,9 @@ class account_invoice(osv.osv):
'''
assert len(ids) == 1, 'This option should only be used for a single id at a time.'
self.write(cr, uid, ids, {'sent': True}, context=context)
- datas = {
- 'ids': ids,
- 'model': 'account.invoice',
- 'form': self.read(cr, uid, ids[0], context=context)
- }
- return {
- 'type': 'ir.actions.report.xml',
- 'report_name': 'account.invoice',
- 'datas': datas,
- 'nodestroy' : True
- }
+ context2 = context.copy()
+ context2['active_ids'] = ids
+ return self.pool['report'].get_action(cr, uid, [], 'account.report_invoice', context=context2)
def action_invoice_sent(self, cr, uid, ids, context=None):
'''
diff --git a/addons/account/account_report.xml b/addons/account/account_report.xml
index 4f9ad1b5c56..90d2c1637fb 100644
--- a/addons/account/account_report.xml
+++ b/addons/account/account_report.xml
@@ -1,45 +1,168 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
- <report auto="False" id="account_general_ledger" menu="False" model="account.account" name="account.general.ledger" rml="account/report/account_general_ledger.rml" string="General Ledger"/>
- <report auto="False" id="account_general_ledger_landscape" menu="False" model="account.account" name="account.general.ledger_landscape" rml="account/report/account_general_ledger_landscape.rml" string="General Ledger"/>
- <report auto="False" id="account_3rdparty_ledger" menu="False" model="res.partner" name="account.third_party_ledger" rml="account/report/account_partner_ledger.rml" string="Partner Ledger"/>
- <report auto="False" id="account_3rdparty_ledger_other" menu="False" model="res.partner" name="account.third_party_ledger_other" rml="account/report/account_partner_ledger_other.rml" string="Partner Ledger"/>
- <report auto="False" id="account_account_balance" menu="False" model="account.account" name="account.account.balance" rml="account/report/account_balance.rml" string="Trial Balance"/>
- <report auto="False" id="account_3rdparty_account_balance" menu="False" model="account.account" name="account.partner.balance" rml="account/report/account_partner_balance.rml" string="Partner Balance"/>
- <report auto="False" id="account_central_journal" model="account.journal.period" name="account.central.journal" rml="account/report/account_central_journal.rml" string="Central Journal" header="False"/>
- <report auto="False" id="account_general_journal" model="account.journal.period" name="account.general.journal" rml="account/report/account_general_journal.rml" string="General Journal" header="False"/>
- <report auto="False" id="account_journal" model="account.journal.period" name="account.journal.period.print" rml="account/report/account_journal.rml" string="Journal" header="False"/>
- <report auto="False" id="account_journal_sale_purchase" model="account.journal.period" name="account.journal.period.print.sale.purchase" rml="account/report/account_journal_sale_purchase.rml" string="Sale/Purchase Journal" header="False"/>
- <report id="account_overdue" model="res.partner" name="account.overdue" rml="account/report/account_print_overdue.rml" string="Overdue Payments" parser="account.report.account_print_overdue.Overdue"/>
+ <report
+ id="account_transfers"
+ model="account.transfer"
+ name="account.transfer"
+ string="Transfers"
+ xml="account/report/transfer.xml"
+ xsl="account/report/transfer.xsl"
+ />
+
<report
auto="False"
+ id="account_intracom"
+ menu="False"
+ model="account.move.line"
+ name="account.intracom"
+ string="IntraCom"
+ />
+
+ <!-- QWeb Reports -->
+ <report
+ id="action_report_vat"
+ model="account.tax.code"
+ report_type="qweb-pdf"
+ string="Account tax"
+ name="account.report_vat"
+ file="account.report_vat"
+ />
+
+ <report
id="account_invoices"
model="account.invoice"
- name="account.invoice"
- rml="account/report/account_print_invoice.rml"
string="Invoices"
- attachment="(object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/','')+'.pdf')"
+ report_type="qweb-pdf"
+ name="account.report_invoice"
+ file="account.report_invoice"
attachment_use="True"
- usage="default"
- />
- <report id="account_transfers" model="account.transfer" name="account.transfer" string="Transfers" xml="account/report/transfer.xml" xsl="account/report/transfer.xsl"/>
- <report auto="False" id="account_intracom" menu="False" model="account.move.line" name="account.intracom" string="IntraCom"/>
+ attachment="(object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/','')+'.pdf')"
+ />
+
+ <report
+ id="action_report_trial_balance"
+ model="account.balance.report"
+ string="Trial Balance"
+ report_type="qweb-pdf"
+ name="account.report_trialbalance"
+ file="account.report_trialbalance"
+ />
+
+ <report
+ id="action_report_central_journal"
+ model="account.journal.period"
+ string="Central Journal"
+ report_type="qweb-pdf"
+ name="account.report_centraljournal"
+ file="account.report_centraljournal"
+ />
+
+ <report
+ id="action_report_print_overdue"
+ model="res.partner"
+ report_type="qweb-pdf"
+ string="Overdue Payments"
+ name="account.report_overdue"
+ file="account.report_overdue"
+ />
+
+ <report
+ id="action_report_general_journal"
+ model="account.journal.period"
+ string="General Journal"
+ report_type="qweb-pdf"
+ name="account.report_generaljournal"
+ file="account.report_generaljournal"
+ menu="False"
+ />
+
+ <report
+ id="action_report_account_journal"
+ model="account.journal.period"
+ string="Journal"
+ report_type="qweb-pdf"
+ name="account.report_journal"
+ file="account.report_journal"
+ />
+
+ <report
+ id="action_report_account_salepurchasejournal"
+ model="account.journal.period"
+ string="Journal"
+ report_type="qweb-pdf"
+ name="account.report_salepurchasejournal"
+ file="account.report_salepurchasejournal"
+ />
+
+ <report
+ id="action_account_3rdparty_account_balance"
+ model="account.account"
+ string="Partner Balance"
+ report_type="qweb-pdf"
+ name="account.report_partnerbalance"
+ file="account.report_partnerbalance"
+ menu="False"
+ />
+
+ <report
+ id="action_report_aged_partner_balance"
+ model="res.partner"
+ string="Aged Partner Balance"
+ report_type="qweb-pdf"
+ name="account.report_agedpartnerbalance"
+ file="account.report_agedpartnerbalance"
+ menu="False"
+ />
<report
- id="action_report_vat"
- model="account.tax.code"
- report_type="qweb-pdf"
- string="Account tax"
- name="account.report_vat"
- file="account.report_vat"
+ id="action_report_partner_ledger"
+ model="res.partner"
+ string="Partner Ledger"
+ report_type="qweb-pdf"
+ name="account.report_partnerledger"
+ file="account.report_partnerledger"
+ menu="False"
/>
+ <report
+ id="action_report_partner_ledger_other"
+ model="res.partner"
+ string="Partner Ledger"
+ report_type="qweb-pdf"
+ name="account.report_partnerledgerother"
+ file="account.report_partnerledgerother"
+ menu="False"
+ />
+
+ <report
+ id="action_report_financial"
+ model="account.financial.report"
+ string="Financial report"
+ report_type="qweb-pdf"
+ name="account.report_financial"
+ file="account.report_financial"
+ menu="False"
+ />
+
+ <report
+ id="action_report_general_ledger"
+ model="account.report.general.ledger"
+ string="General Ledger"
+ report_type="qweb-pdf"
+ name="account.report_generalledger"
+ file="account.report_generalledger"
+ menu="False"
+ auto="False"
+ />
+
+ <!-- Menu items -->
<menuitem
id="menu_tax_report"
name="Taxes"
groups="group_account_user,group_account_manager"
- parent="account.menu_finance_generic_reporting" sequence="3"/>
-
+ parent="account.menu_finance_generic_reporting"
+ sequence="3"
+ />
</data>
</openerp>
diff --git a/addons/account/project/project_report.xml b/addons/account/project/project_report.xml
index 3ee449e01b5..de2e2feee5a 100644
--- a/addons/account/project/project_report.xml
+++ b/addons/account/project/project_report.xml
@@ -1,29 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
- <report auto="False" id="analytic_journal_print" menu="False"
- model="account.analytic.journal" name="account.analytic.account.journal"
- rml="account/project/report/analytic_journal.rml" string="Analytic Journal"/>
+ <report
+ id="action_account_analytic_account_inverted_balance"
+ model="account.analytic.account"
+ string="Inverted Analytic Balance"
+ report_type="qweb-pdf"
+ name="account.report_invertedanalyticbalance"
+ file="account.report_invertedanalyticbalance"
+ menu="False"
+ />
- <report auto="False" id="account_analytic_account_balance" menu="False"
- model="account.analytic.account" name="account.analytic.account.balance"
- rml="account/project/report/analytic_balance.rml" string="Analytic Balance"/>
+ <report
+ id="action_report_analytic_journal"
+ model="account.analytic.journal"
+ string="Analytic Journal"
+ report_type="qweb-pdf"
+ name="account.report_analyticjournal"
+ file="account.report_analyticjournal"
+ menu="False"
+ />
- <report auto="False" id="account_analytic_account_inverted_balance"
- menu="False" model="account.analytic.account"
- name="account.analytic.account.inverted.balance"
- rml="account/project/report/inverted_analytic_balance.rml"
- string="Inverted Analytic Balance"/>
+ <report
+ id="action_report_analytic_balance"
+ model="account.analytic.account"
+ string="Analytic Balance"
+ report_type="qweb-pdf"
+ name="account.report_analyticbalance"
+ file="account.report_analyticbalance"
+ menu="False"
+ />
- <report auto="False" id="account_analytic_account_cost_ledger" menu="False"
- model="account.analytic.account" name="account.analytic.account.cost_ledger"
- rml="account/project/report/cost_ledger.rml" string="Cost Ledger"/>
-
- <report auto="False" id="account_analytic_account_quantity_cost_ledger"
- menu="False" model="account.analytic.account"
- name="account.analytic.account.quantity_cost_ledger"
- rml="account/project/report/quantity_cost_ledger.rml"
- string="Cost Ledger (Only quantities)"/>
+ <report
+ id="action_report_cost_ledger"
+ model="account.analytic.account"
+ report_type="qweb-pdf"
+ string="Cost Ledger"
+ name="account.report_analyticcostledger"
+ file="account.report_analyticcostledger"
+ menu="False"
+ />
+ <report
+ id="action_report_cost_ledgerquantity"
+ model="account.analytic.account"
+ report_type="qweb-pdf"
+ string="Cost Ledger (Only quantities)"
+ name="account.report_analyticcostledgerquantity"
+ file="account.report_analyticcostledgerquantity"
+ menu="False"
+ />
</data>
</openerp>
diff --git a/addons/account/project/report/account_journal.py b/addons/account/project/report/account_journal.py
deleted file mode 100644
index 50f98fd0ee0..00000000000
--- a/addons/account/project/report/account_journal.py
+++ /dev/null
@@ -1,49 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-
-import time
-from openerp.report import report_sxw
-
-#
-# Use period and Journal for selection or resources
-#
-class journal_print(report_sxw.rml_parse):
- def lines(self, journal_id, *args):
- self.cr.execute('select id from account_analytic_line where journal_id=%s order by date,id', (journal_id,))
- ids = map(lambda x: x[0], self.cr.fetchall())
- res = self.pool.get('account.analytic.line').browse(self.cr, self.uid, ids)
- return res
- def _sum_lines(self, journal_id):
- self.cr.execute('select sum(amount) from account_analytic_line where journal_id=%s', (journal_id,))
- return self.cr.fetchone()[0] or 0.0
- def __init__(self, cr, uid, name, context):
- super(journal_print, self).__init__(cr, uid, name, context=context)
- self.localcontext = {
- 'time': time,
- 'lines': self.lines,
- 'sum_lines': self._sum_lines,
- }
-report_sxw.report_sxw('report.account.analytic.journal.print', 'account.analytic.journal', 'addons/account/project/report/analytic_journal.rml',parser=journal_print)
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account/project/report/analytic_balance.py b/addons/account/project/report/analytic_balance.py
index 2aa9f2c549e..7c333b84c45 100644
--- a/addons/account/project/report/analytic_balance.py
+++ b/addons/account/project/report/analytic_balance.py
@@ -20,7 +20,7 @@
##############################################################################
import time
-
+from openerp.osv import osv
from openerp.report import report_sxw
@@ -56,7 +56,6 @@ class account_analytic_balance(report_sxw.rml_parse):
self.get_children(data['child_ids'])
return True
-
def _get_objects(self, empty_acc):
if self.read_data:
return self.read_data
@@ -143,18 +142,16 @@ class account_analytic_balance(report_sxw.rml_parse):
WHERE account_id IN %s AND date>=%s AND date<=%s",query_params)
return self.cr.fetchone()[0] or 0.0
-
-
def _sum_balance(self, accounts, date1, date2):
debit = self._sum_all(accounts, date1, date2, 'debit') or 0.0
credit = self._sum_all(accounts, date1, date2, 'credit') or 0.0
return (debit-credit)
-report_sxw.report_sxw('report.account.analytic.account.balance',
- 'account.analytic.account', 'addons/account/project/report/analytic_balance.rml',
- parser=account_analytic_balance, header="internal")
-
+class report_analyticbalance(osv.AbstractModel):
+ _name = 'report.account.report_analyticbalance'
+ _inherit = 'report.abstract_report'
+ _template = 'account.report_analyticbalance'
+ _wrapped_report_class = account_analytic_balance
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account/project/report/analytic_balance.rml b/addons/account/project/report/analytic_balance.rml
deleted file mode 100644
index 1754988f7d6..00000000000
--- a/addons/account/project/report/analytic_balance.rml
+++ /dev/null
@@ -1,234 +0,0 @@
-<?xml version="1.0"?>
-<document filename="Analytic Balance.pdf">
- <template title="Analytic Balance" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
- <pageTemplate id="first">
- <frame id="first" x1="31.0" y1="30.0" width="531" height="779"/>
- </pageTemplate>
- </template>
- <stylesheet>
- <blockTableStyle id="Standard_Outline">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Header_analytic">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Header_Tile">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table1">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table2">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="1,-1" stop="1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table3">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
- </blockTableStyle>
- <initialize>
- <paraStyle name="all" alignment="justify"/>
- </initialize>
- <paraStyle name="Standard" fontName="Helvetica"/>
- <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Table Contents" fontName="Helvetica" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="Caption" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="Index" fontName="Helvetica"/>
- <paraStyle name="Heading" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Footer" fontName="Helvetica"/>
- <paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
- <paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_space" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="9.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_9_Bold" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <images/>
- </stylesheet>
- <story>
- <pto>
- <pto_header>
- <blockTable colWidths="57.0,192.0,71.0,71.0,71.0,71.0" style="Table_Header_Tile">
- <tr>
- <td>
- <para style="terp_tblheader_Details">Code</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Account Name</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Debit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Credit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Balance</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Quantity</para>
- </td>
- </tr>
- </blockTable>
- </pto_header>
-
- <blockTable colWidths="532.0" style="Table_Header_analytic">
- <tr>
- <td>
- <para style="terp_header_Centre">Analytic Balance - [[ company.currency_id.name ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_space">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="57.0,192.0,71.0,71.0,71.0,71.0" style="Table_Header_Tile">
- <tr>
- <td>
- <para style="terp_tblheader_Details">Code</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Account Name</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Debit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Credit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Balance</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Quantity</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="57.0,192.0,71.0,71.0,71.0,71.0" style="Table1">
- <tr>
- <td>
- <para style="terp_tblheader_Details">Total</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">[[ formatLang(sum_all(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'],'debit')) ]] </para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">[[ formatLang(sum_all(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'],'credit')) ]] </para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">[[ formatLang(sum_balance(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2']), currency_obj = company.currency_id)]]</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">[[ formatLang(sum_all(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'],'quantity')) ]]</para>
- </td>
- </tr>
- </blockTable>
- <section>
- <para style="terp_default_2">[[ repeatIn(get_objects(data['form']['empty_acc']),'o') ]]</para>
- <blockTable colWidths="57.0,192.0,71.0,71.0,71.0,71.0" style="Table2">
- <tr>
- <td>
- <para style="terp_default_Bold_9">[[ o['code'] ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_9">[[ o['complete_name'] ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9_Bold">[[ formatLang(move_sum(o['id'],data['form']['date1'],data['form']['date2'],'debit')) ]] </para>
- </td>
- <td>
- <para style="terp_default_Right_9_Bold">[[ formatLang(move_sum(o['id'],data['form']['date1'],data['form']['date2'],'credit')) ]] </para>
- </td>
- <td>
- <para style="terp_default_Right_9_Bold">[[ formatLang(move_sum_balance(o['id'],data['form']['date1'],data['form']['date2']), currency_obj = company.currency_id)]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9_Bold">[[ formatLang(move_sum(o['id'],data['form']['date1'],data['form']['date2'],'quantity')) ]]</para>
- </td>
- </tr>
- </blockTable>
- <section>
- <para style="terp_default_2">[[ repeatIn(lines_g(o['id'],data['form']['date1'],data['form']['date2']),'move_g') ]]</para>
- <blockTable colWidths="57.0,192.0,71.0,71.0,71.0,71.0" style="Table3">
- <tr>
- <td>
- <para style="terp_default_9">[[ move_g['code'] ]]</para>
- </td>
- <td>
- <para style="terp_default_9">[[ move_g['name'] ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang(move_g['debit'])]] </para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang(move_g['credit']) ]] </para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang(move_g['balance'], currency_obj = company.currency_id) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang(move_g['quantity']) ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_2">
- <font color="white"> </font>
- </para>
- </section>
- </section>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- <para style="Standard">
- <font color="white"> </font>
- </para>
- </pto>
- </story>
-</document> \ No newline at end of file
diff --git a/addons/account/project/report/analytic_journal.py b/addons/account/project/report/analytic_journal.py
index 1ca1ffb3ca4..c59efb057d7 100644
--- a/addons/account/project/report/analytic_journal.py
+++ b/addons/account/project/report/analytic_journal.py
@@ -20,9 +20,10 @@
##############################################################################
import time
-
+from openerp.osv import osv
from openerp.report import report_sxw
+
#
# Use period and Journal for selection or resources
#
@@ -57,8 +58,11 @@ class account_analytic_journal(report_sxw.rml_parse):
res = self.cr.dictfetchone()
return res['sum'] or 0
-report_sxw.report_sxw('report.account.analytic.journal', 'account.analytic.journal', 'addons/account/project/report/analytic_journal.rml',parser=account_analytic_journal,header="internal")
+class report_analyticjournal(osv.AbstractModel):
+ _name = 'report.account.report_analyticjournal'
+ _inherit = 'report.abstract_report'
+ _template = 'account.report_analyticjournal'
+ _wrapped_report_class = account_analytic_journal
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account/project/report/analytic_journal.rml b/addons/account/project/report/analytic_journal.rml
deleted file mode 100644
index 719851252b5..00000000000
--- a/addons/account/project/report/analytic_journal.rml
+++ /dev/null
@@ -1,346 +0,0 @@
-<?xml version="1.0"?>
-<document filename="test.pdf">
- <template title="Analytic Journal" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
- <pageTemplate id="first">
- <frame id="first" x1="28.0" y1="28.0" width="539" height="786"/>
- </pageTemplate>
- </template>
- <stylesheet>
- <blockTableStyle id="Standard_Outline">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Tilte">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table_detail_header">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table1">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table2">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table4">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table3">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table5">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table6">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- </blockTableStyle>
- <initialize>
- <paraStyle name="all" alignment="justify"/>
- </initialize>
- <paraStyle name="P1" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P2" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P3" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P4" fontName="Helvetica-Bold" fontSize="11.0" leading="14" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P5" fontName="Helvetica-Bold" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P6" fontName="Helvetica" fontSize="11.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P7" fontName="Helvetica" fontSize="11.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P8" fontName="Helvetica" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P10" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P11" fontName="Helvetica" fontSize="6.0" leading="8" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P12" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P13" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="Standard" fontName="Helvetica"/>
- <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Heading" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Table Contents" fontName="Helvetica" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="Caption" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="Index" fontName="Helvetica"/>
- <paraStyle name="Footer" fontName="Helvetica"/>
- <paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
- <paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_space" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="11.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_9_Bold" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- </stylesheet>
- <images/>
- <story>
- <para style="P12">[[ repeatIn(objects,'o') ]]</para>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <para style="terp_header_Centre">Analytic Journal</para>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="180.0,180.0,180.0" style="Table5">
- <tr>
- <td>
- <para style="terp_tblheader_Details_Centre">Period from</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Period to</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Currency</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="180.0,180.0,180.0" style="Table6">
- <tr>
- <td>
- <para style="terp_default_Centre_8">[[ formatLang(data['form']['date1'],date=True) ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ formatLang(data['form']['date2'],date=True) ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ company.currency_id.name ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_space">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="85.0,62.0,168.0,73.0,74.0,77.0" style="Table_detail_header">
- <tr>
- <td>
- <para style="terp_tblheader_Details">Date</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Code</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Move Name</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Account n°</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">General</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Analytic</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_2">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="118.0,28.0,168.0,73.0,74.0,77.0" style="Table1">
- <tr>
- <td>
- <para style="terp_tblheader_Details">[[ o.code ]] - [[ o.name ]]</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_tblheader_Details">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_tblheader_Details">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_Right_9_Bold">[[ formatLang(sum_general(o.id,data['form']['date1'],data['form']['date2'])) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9_Bold">[[ formatLang(sum_analytic(o.id,data['form']['date1'],data['form']['date2'])) ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_2">
- <font color="white"> </font>
- </para>
- <section>
- <para style="terp_default_8">[[ repeatIn(lines(o.id,data['form']['date1'],data['form']['date2']), 'move') ]]</para>
- <blockTable colWidths="85.0,62.0,168.0,73.0,74.0,77.0" style="Table2">
- <tr>
- <td>
- <para style="terp_tblheader_Details">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_tblheader_Details">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_9">[[ move.name ]] KI</para>
- </td>
- <td>
- <para style="terp_default_9">[[ move.account_id.code ]] [[ move.account_id.name ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang(move.debit-move.credit) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_2">
- <font color="white"> </font>
- </para>
- <section>
- <para style="terp_default_8">[[ repeatIn(lines_a(move.id,o.id,data['form']['date1'],data['form']['date2']),'move_a') ]]</para>
- <blockTable colWidths="85.0,62.0,168.0,73.0,74.0,77.0" style="Table4">
- <tr>
- <td>
- <para style="terp_default_9">[[ (not move_a) and removeParentNode('blockTable') ]] [[ formatLang(move_a.date,date = True) ]]</para>
- </td>
- <td>
- <para style="terp_default_9">[[ move_a.code ]]</para>
- </td>
- <td>
- <para style="terp_default_9">[[ move_a.name ]] </para>
- </td>
- <td>
- <para style="terp_default_9">[[ move_a.account_id.code ]] - [[ move_a.account_id.name ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang( move_a.amount) ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_2">
- <font color="white"> </font>
- </para>
- </section>
- <para style="terp_default_2">
- <font color="white"> </font>
- </para>
- <para style="terp_default_2">
- <font color="white"> </font>
- </para>
- </section>
- <para style="terp_default_2">
- <font color="white"> </font>
- </para>
- <section>
- <para style="terp_default_8">[[ repeatIn(lines_a(False,o.id,data['form']['date1'],data['form']['date2']),'move_a') ]]</para>
- <blockTable colWidths="85.0,62.0,168.0,73.0,74.0,77.0" style="Table3">
- <tr>
- <td>
- <para style="terp_default_9">[[ (not move_a) and removeParentNode('blockTable') ]] [[ formatLang(move_a.date,date = True) ]]</para>
- </td>
- <td>
- <para style="terp_default_9">[[ move_a.code ]]</para>
- </td>
- <td>
- <para style="terp_default_9">[[ move_a.name ]]</para>
- </td>
- <td>
- <para style="terp_default_9">[[ move_a.account_id.code ]] - [[ move_a.account_id.name ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang( move_a.amount) ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_2">
- <font color="white"> </font>
- </para>
- </section>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- </story>
-</document>
diff --git a/addons/account/project/report/cost_ledger.py b/addons/account/project/report/cost_ledger.py
index e594ab92a63..5eef375eaab 100644
--- a/addons/account/project/report/cost_ledger.py
+++ b/addons/account/project/report/cost_ledger.py
@@ -20,9 +20,10 @@
##############################################################################
import time
-
+from openerp.osv import osv
from openerp.report import report_sxw
+
class account_analytic_cost_ledger(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(account_analytic_cost_ledger, self).__init__(cr, uid, name, context=context)
@@ -100,8 +101,11 @@ class account_analytic_cost_ledger(report_sxw.rml_parse):
credit = self._sum_credit(accounts, date1, date2)
return (debit-credit)
-report_sxw.report_sxw('report.account.analytic.account.cost_ledger', 'account.analytic.account', 'addons/account/project/report/cost_ledger.rml',parser=account_analytic_cost_ledger, header="internal")
+class report_analyticcostledger(osv.AbstractModel):
+ _name = 'report.account.report_analyticcostledger'
+ _inherit = 'report.abstract_report'
+ _template = 'account.report_analyticcostledger'
+ _wrapped_report_class = account_analytic_cost_ledger
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account/project/report/cost_ledger.rml b/addons/account/project/report/cost_ledger.rml
deleted file mode 100644
index 1099a8b8b4e..00000000000
--- a/addons/account/project/report/cost_ledger.rml
+++ /dev/null
@@ -1,305 +0,0 @@
-<?xml version="1.0"?>
-<document filename="Cost Ledger.pdf">
- <template title="Cost Ledger" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
- <pageTemplate id="first">
- <frame id="first" x1="28.0" y1="30.0" width="539" height="785"/>
- </pageTemplate>
- </template>
- <stylesheet>
- <blockTableStyle id="Standard_Outline">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table1">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Date_Sub_detail">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Sub_Content">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Header_Title">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Grant_Total">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Account_Detail">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Move_Line_Detail">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Move_Line_Content">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <initialize>
- <paraStyle name="all" alignment="justify"/>
- </initialize>
- <paraStyle name="Standard" fontName="Helvetica"/>
- <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Table Contents" fontName="Helvetica" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="Caption" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="Index" fontName="Helvetica"/>
- <paraStyle name="Heading" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Footer" fontName="Helvetica"/>
- <paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
- <paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="RIGHT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_Default_Bold_Right_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_Default_Bold_Right_9_U" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_Default_Right_9_U" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_9_Italic" fontName="Helvetica-Oblique" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_9_italic_Rignt" fontName="Helvetica-Oblique" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <images/>
- </stylesheet>
- <story>
- <pto>
- <pto_header>
- <blockTable colWidths="53.0,276.0,70.0,71.0,68.0" style="Table_Header_Title">
- <tr>
- <td>
- <para style="terp_tblheader_Details">Date/Code</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">J.C. /Move name</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Debit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Credit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Balance</para>
- </td>
- </tr>
- </blockTable>
- </pto_header>
- <blockTable colWidths="179.0,179.0,180.0" repeatRows="1" style="Table1">
- <tr>
- <td>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_header_Centre">Cost Ledger</para>
- </td>
- <td>
- <para style="terp_header_Right">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="179.0,179.0,179.0" style="Table_Date_Sub_detail">
- <tr>
- <td>
- <para style="terp_tblheader_General_Centre">Period from </para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Period to</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Printing date</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="179.0,179.0,179.0" style="Table_Sub_Content">
- <tr>
- <td>
- <para style="terp_default_Centre_8">[[ formatLang(data['form']['date1'],date = True) ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ formatLang(data['form']['date2'],date = True) ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ formatLang(time.strftime('%Y-%m-%d %H:%M:%S'),date_time = True) ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="53.0,276.0,70.0,71.0,68.0" style="Table_Header_Title">
- <tr>
- <td>
- <para style="terp_tblheader_Details">Date/Code</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">J.C. /Move name</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Debit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Credit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Balance</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="56.0,273.0,70.0,70.0,70.0" style="Table_Grant_Total">
- <tr>
- <td>
- <para style="terp_default_Bold_9">Total:</para>
- </td>
- <td>
- <para style="terp_default_Bold_9">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_Default_Bold_Right_9_U">[[ formatLang (sum_debit(objects,data['form']['date1'],data['form']['date2'])) ]] </para>
- </td>
- <td>
- <para style="terp_Default_Bold_Right_9_U">[[ formatLang (sum_credit(objects,data['form']['date1'],data['form']['date2'])) ]] </para>
- </td>
- <td>
- <para style="terp_Default_Bold_Right_9_U">[[ formatLang (sum_balance(objects,data['form']['date1'],data['form']['date2']), currency_obj = company.currency_id) ]]</para>
- </td>
- </tr>
- </blockTable>
- <section>
- <para style="terp_default_2">[[ repeatIn(objects,'account') ]]</para>
- <blockTable colWidths="56.0,273.0,70.0,70.0,70.0" style="Table_Account_Detail">
- <tr>
- <td>
- <para style="terp_default_Bold_9">[[ account.code ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_9">[[ account.complete_name ]]</para>
- </td>
- <td>
- <para style="terp_Default_Bold_Right_9_U">[[ formatLang (account_sum_debit(account,data['form']['date1'],data['form']['date2'])) ]] </para>
- </td>
- <td>
- <para style="terp_Default_Bold_Right_9_U">[[ formatLang (account_sum_credit(account,data['form']['date1'],data['form']['date2'])) ]] </para>
- </td>
- <td>
- <para style="terp_Default_Bold_Right_9_U">[[ formatLang (account_sum_balance(account,data['form']['date1'],data['form']['date2']), currency_obj = company.currency_id) ]]</para>
- </td>
- </tr>
- </blockTable>
- <section>
- <para style="terp_default_2">[[ repeatIn(lines_g(account,data['form']['date1'],data['form']['date2']),'move_g') ]]</para>
- <blockTable colWidths="56.0,273.0,70.0,70.0,70.0" style="Table_Move_Line_Detail">
- <tr>
- <td>
- <para style="terp_default_Bold_9">[[ move_g['code'] ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_9">[[ move_g['name'] ]]</para>
- </td>
- <td>
- <para style="terp_Default_Bold_Right_9_U">[[ formatLang( move_g['debit']) ]] </para>
- </td>
- <td>
- <para style="terp_Default_Bold_Right_9_U">[[ formatLang( move_g['credit']) ]] </para>
- </td>
- <td>
- <para style="terp_Default_Bold_Right_9_U">[[ formatLang( move_g['balance'], currency_obj = company.currency_id) ]]</para>
- </td>
- </tr>
- </blockTable>
- <section>
- <para style="terp_default_2">[[ repeatIn(lines_a(move_g,account,data['form']['date1'],data['form']['date2']),'move_a') ]]</para>
- <blockTable colWidths="56.0,56.0,217.0,70.0,70.0,70.0" style="Table_Move_Line_Content">
- <tr>
- <td>
- <para style="terp_default_9_Italic">[[ formatLang(move_a['date'],date = True) ]]</para>
- </td>
- <td>
- <para style="terp_default_9_Italic">[[ move_a['cj'] ]]</para>
- </td>
- <td>
- <para style="terp_default_9_Italic">[[ move_a['name'] ]]</para>
- </td>
- <td>
- <para style="terp_default_9_italic_Rignt">[[ formatLang( move_a['debit'] )]] </para>
- </td>
- <td>
- <para style="terp_default_9_italic_Rignt">[[ formatLang( move_a['credit']) ]] </para>
- </td>
- <td>
- <para style="terp_default_9_italic_Rignt">[[ formatLang( move_a['balance'], currency_obj = company.currency_id)]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_2">
- <font color="white"> </font>
- </para>
- </section>
- </section>
- </section>
- </pto>
- </story>
-</document>
diff --git a/addons/account/project/report/inverted_analytic_balance.py b/addons/account/project/report/inverted_analytic_balance.py
index bd86bcfe257..23129144555 100644
--- a/addons/account/project/report/inverted_analytic_balance.py
+++ b/addons/account/project/report/inverted_analytic_balance.py
@@ -20,7 +20,7 @@
##############################################################################
import time
-
+from openerp.osv import osv
from openerp.report import report_sxw
class account_inverted_analytic_balance(report_sxw.rml_parse):
@@ -120,8 +120,11 @@ class account_inverted_analytic_balance(report_sxw.rml_parse):
WHERE account_id IN %s AND date>=%s AND date<=%s", (tuple(ids),date1, date2,))
return self.cr.fetchone()[0] or 0.0
-report_sxw.report_sxw('report.account.analytic.account.inverted.balance', 'account.analytic.account', 'addons/account/project/report/inverted_analytic_balance.rml',parser=account_inverted_analytic_balance, header="internal")
+class report_invertedanalyticbalance(osv.AbstractModel):
+ _name = 'report.account.report_invertedanalyticbalance'
+ _inherit = 'report.abstract_report'
+ _template = 'account.report_invertedanalyticbalance'
+ _wrapped_report_class = account_inverted_analytic_balance
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account/project/report/inverted_analytic_balance.rml b/addons/account/project/report/inverted_analytic_balance.rml
deleted file mode 100644
index 54b6878c407..00000000000
--- a/addons/account/project/report/inverted_analytic_balance.rml
+++ /dev/null
@@ -1,229 +0,0 @@
-<?xml version="1.0"?>
-<document filename="test.pdf">
- <template title="Inverted Analytic Balance" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
- <pageTemplate id="first">
- <frame id="first" x1="28.0" y1="28.0" width="539" height="786"/>
- </pageTemplate>
- </template>
- <stylesheet>
- <blockTableStyle id="Standard_Outline">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Title">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Header_table">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table1">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table3">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="1,-1" stop="1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table4">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
- </blockTableStyle>
- <initialize>
- <paraStyle name="all" alignment="justify"/>
- </initialize>
- <paraStyle name="Standard" fontName="Helvetica"/>
- <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Table Contents" fontName="Helvetica" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="Caption" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="Index" fontName="Helvetica"/>
- <paraStyle name="Heading" fontName="Helvetica" fontSize="15.0" leading="19" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Footer" fontName="Helvetica"/>
- <paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
- <paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_space" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="9.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <images/>
- </stylesheet>
- <story>
- <pto>
- <pto_header>
- <blockTable colWidths="58.0,238.0,62.0,62.0,60.0,59.0" style="Table_Header_table">
- <tr>
- <td>
- <para style="terp_tblheader_Details">Code</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Name</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Debit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Credit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Balance</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Quantity</para>
- </td>
- </tr>
- </blockTable>
- </pto_header>
- <blockTable colWidths="539.0" style="Table_Title">
- <tr>
- <td>
- <para style="terp_header_Centre">Inverted Analytic Balance - [[ company.currency_id.name ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="Text body">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="58.0,238.0,62.0,62.0,60.0,59.0" style="Table_Header_table">
- <tr>
- <td>
- <para style="terp_tblheader_Details">Code</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Name</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Debit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Credit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Balance</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Quantity</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_2">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="58.0,238.0,62.0,62.0,60.0,59.0" style="Table1">
- <tr>
- <td>
- <para style="terp_tblheader_Details">Total</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">[[ formatLang(sum_debit(objects,data['form']['date1'],data['form']['date2'])) ]]</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">[[ formatLang(sum_credit(objects,data['form']['date1'],data['form']['date2']))]]</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">[[ formatLang(sum_balance(objects,data['form']['date1'],data['form']['date2']), currency_obj = company.currency_id)]]</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">[[ formatLang(sum_quantity(objects,data['form']['date1'],data['form']['date2'])) ]]</para>
- </td>
- </tr>
- </blockTable>
- <section>
- <para style="terp_default_8">[[ repeatIn(lines_g(objects,data['form']['date1'],data['form']['date2']),'move_g') ]]</para>
- <blockTable colWidths="58.0,238.0,62.0,62.0,60.0,59.0" style="Table3">
- <tr>
- <td>
- <para style="terp_default_Bold_9">[[ (not move_g) and removeParentNode('blockTable') ]] [[ move_g['code'] ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_9">[[ move_g['name'] ]]</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">[[ formatLang(move_g['debit'])]]</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">[[formatLang(move_g['credit'])]]</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">[[ formatLang(move_g['balance'], currency_obj = company.currency_id)]]</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">[[formatLang(move_g['quantity']) ]]</para>
- </td>
- </tr>
- </blockTable>
- <section>
- <para style="terp_default_8">[[ repeatIn(lines_a(objects,move_g['id'],data['form']['date1'],data['form']['date2']),'move_a') ]]</para>
- <blockTable colWidths="58.0,238.0,62.0,62.0,60.0,59.0" style="Table4">
- <tr>
- <td>
- <para style="terp_default_9">[[ (not move_a) and removeParentNode('blockTable') ]] [[ move_a['code'] ]]</para>
- </td>
- <td>
- <para style="terp_default_9">[[ move_a['complete_name'] ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang(move_a['debit']) ]] </para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang(move_a['credit']) ]] </para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang(move_a['balance'], currency_obj = company.currency_id)]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang(move_a['quantity']) ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_2">
- <font color="white"> </font>
- </para>
- </section>
- </section>
- </pto>
- </story>
-</document> \ No newline at end of file
diff --git a/addons/account/project/report/quantity_cost_ledger.py b/addons/account/project/report/quantity_cost_ledger.py
index b22558b900f..d3ed1cdc3a8 100644
--- a/addons/account/project/report/quantity_cost_ledger.py
+++ b/addons/account/project/report/quantity_cost_ledger.py
@@ -19,9 +19,10 @@
#
##############################################################################
import time
-
+from openerp.osv import osv
from openerp.report import report_sxw
+
class account_analytic_quantity_cost_ledger(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(account_analytic_quantity_cost_ledger, self).__init__(cr, uid, name, context=context)
@@ -116,9 +117,11 @@ class account_analytic_quantity_cost_ledger(report_sxw.rml_parse):
AND journal_id IN %s",(tuple(ids), date1, date2, tuple(journal_ids)))
return self.cr.fetchone()[0] or 0.0
-report_sxw.report_sxw('report.account.analytic.account.quantity_cost_ledger',
- 'account.analytic.account',
- 'addons/account/project/report/quantity_cost_ledger.rml',
- parser=account_analytic_quantity_cost_ledger, header="internal")
+
+class report_analyticcostledgerquantity(osv.AbstractModel):
+ _name = 'report.account.report_analyticcostledgerquantity'
+ _inherit = 'report.abstract_report'
+ _template = 'account.report_analyticcostledgerquantity'
+ _wrapped_report_class = account_analytic_quantity_cost_ledger
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/project/report/quantity_cost_ledger.rml b/addons/account/project/report/quantity_cost_ledger.rml
deleted file mode 100644
index 9f99f50ccc2..00000000000
--- a/addons/account/project/report/quantity_cost_ledger.rml
+++ /dev/null
@@ -1,281 +0,0 @@
-<?xml version="1.0"?>
-<document filename="Cost Ledger.pdf">
- <template title="Cost Ledger" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
- <pageTemplate id="first">
- <frame id="first" x1="30.0" y1="29.0" width="534" height="783"/>
- </pageTemplate>
- </template>
- <stylesheet>
- <blockTableStyle id="Standard_Outline">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Header_Detail">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Date_Detail">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Date_Content">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Header_Move_Line">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Final_Total">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Account_Detail">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Analytical_Detail">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Move_Line_Content">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <initialize>
- <paraStyle name="all" alignment="justify"/>
- </initialize>
- <paraStyle name="Standard" fontName="Helvetica"/>
- <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Table Contents" fontName="Helvetica" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="Caption" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="Index" fontName="Helvetica"/>
- <paraStyle name="Heading" fontName="Helvetica" fontSize="15.0" leading="19" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Footer" fontName="Helvetica"/>
- <paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
- <paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="RIGHT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_9_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_9_Italic" fontName="Helvetica-Oblique" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_9_Italic_Right" fontName="Helvetica-Oblique" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Rignt_9_U" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_9_Right_U" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <images/>
- </stylesheet>
- <story>
- <pto>
- <pto_header>
- <blockTable colWidths="57.0,322.0,85.0,71.0" style="Table_Header_Move_Line">
- <tr>
- <td>
- <para style="terp_tblheader_Details">Code/Date</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">J.C./Move name</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Quantity</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Total</para>
- </td>
- </tr>
- </blockTable>
- </pto_header>
- <blockTable colWidths="178.0,178.0,178.0" repeatRows="1" style="Table_Header_Detail">
- <tr>
- <td>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_header_Centre">Cost Ledger</para>
- </td>
- <td>
- <para style="terp_header_Right">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="178.0,178.0,178.0" style="Table_Date_Detail">
- <tr>
- <td>
- <para style="terp_tblheader_General_Centre">Period from</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Period to</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Printing date</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="178.0,178.0,178.0" style="Table_Date_Content">
- <tr>
- <td>
- <para style="terp_default_Centre_8">[[ formatLang(data['form']['date1'],date = True) ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ formatLang(data['form']['date2'],date = True) ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ formatLang(time.strftime('%Y-%m-%d %H:%M:%S'),date_time = True) ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="57.0,322.0,85.0,71.0" style="Table_Header_Move_Line">
- <tr>
- <td>
- <para style="terp_tblheader_Details">Code/Date</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">J.C./Move name</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Quantity</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Total</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="57.0,322.0,85.0,71.0" style="Table_Final_Total">
- <tr>
- <td>
- <para style="terp_default_Bold_9">Total:</para>
- </td>
- <td>
- <para style="terp_default_Bold_9">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_Bold_9">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_Bold_9_Right_U">[[ formatLang (sum_quantity(objects,data['form']['date1'],data['form']['date2'], data['form']['journal']) ) ]]</para>
- </td>
- </tr>
- </blockTable>
- <section>
- <para style="terp_default_2">[[ repeatIn(objects,'o') ]]</para>
- <blockTable colWidths="57.0,322.0,85.0,71.0" style="Table_Account_Detail">
- <tr>
- <td>
- <para style="terp_default_Bold_9">[[ o.code ]]<font face="Helvetica" size="10.0"/></para>
- </td>
- <td>
- <para style="terp_default_Bold_9">[[ o.complete_name ]]<font face="Helvetica" size="10.0"/></para>
- </td>
- <td>
- <para style="terp_default_Bold_9">Max Qty: [[ formatLang (o.quantity_max )]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_9_Right_U">[[ formatLang (account_sum_quantity(o.id,data['form']['date1'],data['form']['date2'], data['form']['journal']) )]]</para>
- </td>
- </tr>
- </blockTable>
- <section>
- <para style="terp_default_2">[[ repeatIn(lines_g(o.id,data['form']['date1'],data['form']['date2'],data['form']['journal']),'move_g') ]]</para>
- <blockTable colWidths="57.0,407.0,71.0" style="Table_Analytical_Detail">
- <tr>
- <td>
- <para style="terp_default_Bold_9">[[ move_g['code'] ]] </para>
- </td>
- <td>
- <para style="terp_default_Bold_9">[[ move_g['name'] ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_9_Right_U">[[ formatLang (move_g['quantity']) ]]</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="57.0,71.0,336.0,71.0" style="Table_Move_Line_Content">
- <tr>
- <td>
- <para style="terp_default_9_Italic">[[ repeatIn(lines_a(move_g['id'],o.id,data['form']['date1'],data['form']['date2'],data['form']['journal']),'move_a') ]]</para>
- <para style="terp_default_9_Italic">[[ formatLang(move_a['date'],date = True) ]]</para>
- </td>
- <td>
- <para style="terp_default_9_Italic">[[ move_a['cj'] ]]</para>
- </td>
- <td>
- <para style="terp_default_9_Italic">[[ move_a['name'] ]]</para>
- </td>
- <td>
- <para style="terp_default_9_Italic_Right">[[ formatLang (move_a['quantity'] )]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_2">
- <font color="white"> </font>
- </para>
- </section>
- </section>
- </pto>
- </story>
-</document> \ No newline at end of file
diff --git a/addons/account/project/views/report_analyticbalance.xml b/addons/account/project/views/report_analyticbalance.xml
new file mode 100644
index 00000000000..09cd56fc83f
--- /dev/null
+++ b/addons/account/project/views/report_analyticbalance.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+<template id="report_analyticbalance">
+ <t t-call="report.html_container">
+ <t t-call="report.internal_layout">
+ <div class="page">
+ <h2>Analytic Balance - <span t-esc="res_company.currency_id.name"/></h2>
+
+ <table class="table table-condensed">
+ <thead>
+ <tr>
+ <th>Code</th>
+ <th>Account Name</th>
+ <th>Debit</th>
+ <th>Credit</th>
+ <th>Balance</th>
+ <th>Quantity</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td colspan="2">Total</td>
+ <td>
+ <span t-esc="formatLang(sum_all(get_objects(data['form']['empty_acc']), data['form']['date1'], data['form']['date2'], 'debit'))"/>
+ </td>
+ <td>
+ <span t-esc="formatLang(sum_all(get_objects(data['form']['empty_acc']), data['form']['date1'], data['form']['date2'], 'credit'))"/>
+ </td>
+ <td>
+ <span t-esc="formatLang(sum_balance(get_objects(data['form']['empty_acc']), data['form']['date1'], data['form']['date2']),currency_obj=res_company.currency_id)"/>
+ </td>
+ <td>
+ <span t-esc="formatLang(sum_all(get_objects(data['form']['empty_acc']), data['form']['date1'], data['form']['date2'], 'quantity'))"/>
+ </td>
+ </tr>
+ <t t-foreach="get_objects(data['form']['empty_acc'])" t-as="o">
+ <tr>
+ <td><span t-esc="o['code']"/></td>
+ <td><span t-esc="o['complete_name']"/></td>
+ <td><span t-esc="formatLang(move_sum(o['id'], data['form']['date1'], data['form']['date2'], 'debit'))"/></td>
+ <td><span t-esc="formatLang(move_sum(o['id'], data['form']['date1'], data['form']['date2'], 'credit'))"/></td>
+ <td><span t-esc="formatLang(move_sum_balance(o['id'], data['form']['date1'], data['form']['date2']), currency_obj=res_company.currency_id)"/></td>
+ <td><span t-esc="formatLang(move_sum(o['id'], data['form']['date1'], data['form']['date2'], 'quantity'))"/></td>
+ </tr>
+ <tr t-foreach="lines_g(o['id'], data['form']['date1'], data['form']['date2'])" t-as="move_g">
+ <td><span t-esc="move_g['code']"/></td>
+ <td><span t-esc="move_g['name']"/></td>
+ <td><span t-esc="formatLang(move_g['debit'])"/></td>
+ <td><span t-esc="formatLang(move_g['credit'])"/></td>
+ <td><span t-esc="formatLang(move_g['balance'], currency_obj=res_company.currency_id)"/></td>
+ <td><span t-esc="formatLang(move_g['quantity'])"/></td>
+ </tr>
+ </t>
+ </tbody>
+ </table>
+ </div>
+ </t>
+ </t>
+</template>
+</data>
+</openerp>
diff --git a/addons/account/project/views/report_analyticcostledger.xml b/addons/account/project/views/report_analyticcostledger.xml
new file mode 100644
index 00000000000..cda37d4158f
--- /dev/null
+++ b/addons/account/project/views/report_analyticcostledger.xml
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+<template id="report_analyticcostledger">
+ <t t-call="report.html_container">
+ <t t-call="report.internal_layout">
+ <div class="page">
+ <h2>Cost Ledger</h2>
+
+ <div class="row mt32 mb32">
+ <div class="col-xs-3">
+ <strong>Period From:</strong>
+ <p t-esc="formatLang(data['form']['date1'], date=True)"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Period To:</strong>
+ <p t-esc="formatLang(data['form']['date2'], date=True)"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Printing Date:</strong>
+ <p t-esc="formatLang(time.strftime('%Y-%m-%d %H:%M:%S'), date_time=True)" />
+ </div>
+ </div>
+
+ <table class="table table-condensed">
+ <thead>
+ <tr>
+ <th>Date/Code</th>
+ <th>J.C. /Move</th>
+ <th>Name</th>
+ <th>Debit</th>
+ <th>Credit</th>
+ <th>Balance</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr style="font-weight: bold;">
+ <td>Total:</td>
+ <td></td>
+ <td></td>
+ <td><span t-esc="formatLang(sum_debit(docs, data['form']['date1'], data['form']['date2']))"/></td>
+ <td><span t-esc="formatLang(sum_credit(docs,data['form']['date1'],data['form']['date2']))"/></td>
+ <td>
+ <span t-esc="formatLang(sum_debit(docs, data['form']['date1'], data['form']['date2']) - sum_credit(docs, data['form']['date1'], data['form']['date2']), currency_obj=res_company.currency_id)"/>
+ </td>
+ </tr>
+
+ <t t-foreach="docs" t-as="account">
+ <tr style="font-weight: bold;">
+ <td><span t-esc="account.code"/></td>
+ <td></td>
+ <td><span t-esc="account.complete_name"/></td>
+ <td><span t-esc="formatLang(sum_debit([account], data['form']['date1'], data['form']['date2']))"/></td>
+ <td><span t-esc="formatLang(sum_credit([account], data['form']['date1'], data['form']['date2']))"/></td>
+ <td><span t-esc="formatLang(sum_debit([account], data['form']['date1'], data['form']['date2']) - sum_credit([account], data['form']['date1'], data['form']['date2']), currency_obj=res_company.currency_id)"/></td>
+ </tr>
+
+ <t t-foreach="lines_g(account, data['form']['date1'], data['form']['date2'])" t-as="move_g">
+ <tr>
+ <td><span t-esc="move_g['code']"/></td>
+ <td></td>
+ <td><span t-esc="move_g['name']"/></td>
+ <td><span t-esc="move_g['debit']"/></td>
+ <td><span t-esc="move_g['credit']"/></td>
+ <td>
+ <span t-esc="formatLang(move_g['balance'], currency_obj=res_company.currency_id)"/>
+ </td>
+ </tr>
+ <tr t-foreach="lines_a(move_g, account, data['form']['date1'], data['form']['date2'])" t-as="move_a">
+ <td>
+ <t t-esc="formatLang(move_a['date'], date=True)"></t>
+ </td>
+ <td><span t-esc="move_a['cj']"/></td>
+ <td><span t-esc="move_a['name']"/></td>
+ <td><span t-esc="move_a['debit']"/></td>
+ <td><span t-esc="move_a['credit']"/></td>
+ <td>
+ <span t-esc="formatLang(move_a['balance'], currency_obj=res_company.currency_id)"/>
+ </td>
+ </tr>
+ </t>
+ </t>
+ </tbody>
+ </table>
+ </div>
+ </t>
+ </t>
+</template>
+</data>
+</openerp> \ No newline at end of file
diff --git a/addons/account/project/views/report_analyticcostledgerquantity.xml b/addons/account/project/views/report_analyticcostledgerquantity.xml
new file mode 100644
index 00000000000..de49d4972e5
--- /dev/null
+++ b/addons/account/project/views/report_analyticcostledgerquantity.xml
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+<template id="report_analyticcostledgerquantity">
+ <t t-call="report.html_container">
+ <t t-call="report.internal_layout">
+ <div class="page">
+ <h2>Cost Ledger</h2>
+
+ <div class="row mt32 mb32">
+ <div class="col-xs-3">
+ <strong>Period From:</strong>
+ <p t-esc="formatLang(data['form']['date1'], date=True)"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Period To:</strong>
+ <p t-esc="formatLang(data['form']['date2'], date=True)"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Printing Date:</strong>
+ <p t-esc="formatLang(time.strftime('%Y-%m-%d %H:%M:%S'), date_time=True)" />
+ </div>
+ </div>
+
+ <table class="table table-condensed">
+ <thead>
+ <tr>
+ <th>Date/Code</th>
+ <th>J.C./Move</th>
+ <th>Name</th>
+ <th>Quantity</th>
+ <th>Total</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr style="font-weight:bold;">
+ <td>Total:</td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td>
+ <span t-esc="sum_quantity(docs, data['form']['date1'], data['form']['date2'], data['form']['journal'])"/>
+ </td>
+ </tr>
+
+ <t t-foreach="docs" t-as="account">
+ <tr style="font-weight:bold;">
+ <td><span t-esc="account.code"/></td>
+ <td><span t-esc="account.complete_name"/></td>
+ <td></td>
+ <td>
+ <p t-if="account.quantity_max">
+ Max quantity : <span t-esc="formatLang(account.quantity_max)"/>
+ </p>
+ </td>
+ <td>
+ <span t-esc="account_sum_quantity(account.id, data['form']['date1'], data['form']['date2'], data['form']['journal'])"/>
+ </td>
+ </tr>
+
+ <t t-foreach="lines_g(account.id, data['form']['date1'], data['form']['date2'], data['form']['journal'])" t-as="move_g">
+ <tr style="font-weight:bold;">
+ <td><span t-esc="move_g['code']"/></td>
+ <td colspan="2"><span t-esc="move_g['name']"/></td>
+ <td></td>
+ <td class="text-right"><span t-esc="move_g['quantity']"/></td>
+ </tr>
+
+ <t t-foreach="lines_a(move_g['id'], account.id, data['form']['date1'], data['form']['date2'], data['form']['journal'])" t-as="move_a">
+ <tr style="font-weight:normal;">
+ <td><span t-esc="formatLang(move_a['date'], date=True)"/></td>
+ <td><span t-esc="move_a['cj']"/></td>
+ <td><span t-esc="move_a['name']"/></td>
+ <td></td>
+ <td class="text-right"><span t-esc="move_a['quantity']"/></td>
+ </tr>
+ </t>
+ </t>
+ </t>
+ </tbody>
+ </table>
+ </div>
+ </t>
+ </t>
+</template>
+</data>
+</openerp> \ No newline at end of file
diff --git a/addons/account/project/views/report_analyticjournal.xml b/addons/account/project/views/report_analyticjournal.xml
new file mode 100644
index 00000000000..1b3a4fda97c
--- /dev/null
+++ b/addons/account/project/views/report_analyticjournal.xml
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+<template id="report_analyticjournal">
+ <t t-call="report.html_container">
+ <t t-foreach="docs" t-as="o">
+ <t t-call="report.internal_layout">
+ <div class="page">
+ <h2>Analytic Journal</h2>
+
+ <div class="row mt32 mb32">
+ <div class="col-xs-3">
+ <strong>Period From:</strong>
+ <p t-esc="formatLang(data['form']['date1'], date=True)"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Period To:</strong>
+ <p t-esc="formatLang(data['form']['date2'], date=True)"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Currency:</strong>
+ <p t-field="res_company.currency_id" />
+ </div>
+ </div>
+
+ <table class="table table-condensed">
+ <thead>
+ <tr>
+ <th>Date</th>
+ <th>Code</th>
+ <th>Move Name</th>
+ <th>Account n°</th>
+ <th>General</th>
+ <th>Analytic</th>
+ </tr>
+ <tr>
+ <th colspan="4"><t t-if="o.code"><span t-esc="o.code"/></t> - <span t-esc="o.name"/></th>
+ <th><span t-esc="formatLang(sum_general(o.id, data['form']['date1'], data['form']['date2']))"/></th>
+ <th><span t-esc="formatLang(sum_analytic(o.id, data['form']['date1'], data['form']['date2']))"/></th>
+ </tr>
+ </thead>
+ <tbody>
+ <t t-foreach="lines(o.id, data['form']['date1'], data['form']['date2'])" t-as="move">
+ <tr>
+ <td></td>
+ <td></td>
+ <td>
+ <span t-esc="move.name"/>
+ </td>
+ <td>
+ <span t-esc="move.account_id.code"/>
+ <span t-esc="move.account_id.name"/>
+ </td>
+ <td>
+ <span t-esc="formatLang(move.debit-move.credit)"/>
+ </td>
+ <td></td>
+ </tr>
+ <tr t-foreach="lines_a(move.id, o.id, data['form']['date1'], data['form']['date2'])" t-as="move_a">
+ <td>
+ <span t-esc="formatLang(move_a.date,date = True)"/>
+ </td>
+ <td>
+ <p t-if="move_a.code"><span t-esc="move_a.code"/></p>
+ </td>
+ <td>
+ <span t-esc="move_a.name"/>
+ </td>
+ <td><span t-esc="move_a.account_id.code"/> - <span t-esc="move_a.account_id.name"/></td>
+ <td></td>
+ <td><span t-esc="formatLang(move_a.amount)"/></td>
+ </tr>
+ </t>
+ <tr t-foreach="lines_a(False, o.id, data['form']['date1'], data['form']['date2'])" t-as="move_a">
+ <td><span t-esc="formatLang(move_a.date,date = True)"/></td>
+ <td><p t-if="move_a.code"><span t-esc="move_a.code"/></p></td>
+ <td><span t-esc="move_a.name"/></td>
+ <td><span t-esc="move_a.account_id.code"/> - <span t-esc="move_a.account_id.name"/></td>
+ <td></td>
+ <td><span t-esc="formatLang(move_a.amount)"/></td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </t>
+ </t>
+ </t>
+</template>
+</data>
+</openerp>
diff --git a/addons/account/project/views/report_invertedanalyticbalance.xml b/addons/account/project/views/report_invertedanalyticbalance.xml
new file mode 100644
index 00000000000..e545ec8525b
--- /dev/null
+++ b/addons/account/project/views/report_invertedanalyticbalance.xml
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+<template id="report_invertedanalyticbalance">
+ <t t-call="report.html_container">
+ <t t-call="report.internal_layout">
+ <div class="page">
+ <h2>Inverted Analytic Balance - <span t-esc="res_company.currency_id.name"/></h2>
+
+ <table class="table table-condensed">
+ <thead>
+ <tr>
+ <th>Code</th>
+ <th>Account Name</th>
+ <th>Debit</th>
+ <th>Credit</th>
+ <th>Balance</th>
+ <th>Quantity</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td><strong>Total</strong></td>
+ <td></td>
+ <td><strong t-esc="formatLang(sum_debit(docs, data['form']['date1'], data['form']['date2']))"/></td>
+ <td><strong t-esc="formatLang(sum_credit(docs, data['form']['date1'], data['form']['date2']))"/></td>
+ <td>
+ <strong t-esc="formatLang(sum_balance(docs, data['form']['date1'], data['form']['date2']), currency_obj=res_company.currency_id)"/>
+ </td>
+ <td><strong><span t-esc="formatLang(sum_quantity(docs, data['form']['date1'], data['form']['date2']))"/></strong></td>
+ </tr>
+ <t t-foreach="lines_g(docs, data['form']['date1'], data['form']['date2'])" t-as="move_g">
+ <tr>
+ <td>
+ <strong t-esc="move_g['code']"/>
+ </td>
+ <td>
+ <strong t-esc="move_g['name']"/>
+ </td>
+ <td class="text-right">
+ <strong>
+ <span t-esc="formatLang(move_g['debit'])"/>
+ </strong>
+ </td>
+ <td class="text-right">
+ <strong>
+ <span t-esc="formatLang(move_g['credit'])"/>
+ </strong>
+ </td>
+ <td class="text-right">
+ <strong>
+ <span t-esc="formatLang(move_g['balance'], currency_obj = res_company.currency_id)"/>
+ </strong>
+ </td>
+ <td class="text-right">
+ <strong>
+ <span t-esc="formatLang(move_g['quantity'])"/>
+ </strong>
+ </td>
+ </tr>
+ <t t-foreach="lines_a(docs, move_g['id'], data['form']['date1'], data['form']['date2'])" t-as="move_a">
+ <tr>
+ <td>
+ <span t-esc="move_a['code']"/>
+ </td>
+ <td>
+ <span t-esc="move_a['complete_name']"/>
+ </td>
+ <td class="text-right">
+ <span t-esc="formatLang(move_a['debit'])"/>
+ </td>
+ <td class="text-right">
+ <span t-esc="formatLang(move_a['credit'])"/>
+ </td>
+ <td class="text-right">
+ <span t-esc="formatLang(move_a['balance'], currency_obj = res_company.currency_id)"/>
+ </td>
+ <td class="text-right">
+ <span t-esc="formatLang(move_a['quantity'])"/>
+ </td>
+ </tr>
+ </t>
+ </t>
+ </tbody>
+ </table>
+ </div>
+ </t>
+ </t>
+</template>
+</data>
+</openerp>
diff --git a/addons/account/project/wizard/account_analytic_balance_report.py b/addons/account/project/wizard/account_analytic_balance_report.py
index 02b2eb6e95d..3a3c301cffc 100644
--- a/addons/account/project/wizard/account_analytic_balance_report.py
+++ b/addons/account/project/wizard/account_analytic_balance_report.py
@@ -18,10 +18,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
-import time
+import time
from openerp.osv import fields, osv
+
class account_analytic_balance(osv.osv_memory):
_name = 'account.analytic.balance'
_description = 'Account Analytic Balance'
@@ -42,16 +43,13 @@ class account_analytic_balance(osv.osv_memory):
context = {}
data = self.read(cr, uid, ids)[0]
datas = {
- 'ids': context.get('active_ids',[]),
- 'model': 'account.analytic.account',
- 'form': data
- }
- return {
- 'type': 'ir.actions.report.xml',
- 'report_name': 'account.analytic.account.balance',
- 'datas': datas,
- }
+ 'ids': context.get('active_ids', []),
+ 'model': 'account.analytic.account',
+ 'form': data
+ }
+ datas['form']['active_ids'] = context.get('active_ids', False)
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+ return self.pool['report'].get_action(cr, uid, ids, 'account.report_analyticbalance', data=datas, context=context)
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report.py b/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report.py
index 814cbb8cacc..125dfda46fb 100644
--- a/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report.py
+++ b/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report.py
@@ -18,10 +18,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
-import time
+import time
from openerp.osv import fields, osv
+
class account_analytic_cost_ledger_journal_report(osv.osv_memory):
_name = 'account.analytic.cost.ledger.journal.report'
_description = 'Account Analytic Cost Ledger For Journal Report'
@@ -42,14 +43,12 @@ class account_analytic_cost_ledger_journal_report(osv.osv_memory):
context = {}
data = self.read(cr, uid, ids)[0]
datas = {
- 'ids': context.get('active_ids',[]),
- 'model': 'account.analytic.account',
- 'form': data
- }
- return {
- 'type': 'ir.actions.report.xml',
- 'report_name': 'account.analytic.account.quantity_cost_ledger',
- 'datas': datas,
- }
+ 'ids': context.get('active_ids', []),
+ 'model': 'account.analytic.account',
+ 'form': data
+ }
+
+ datas['form']['active_ids'] = context.get('active_ids', False)
+ return self.pool['report'].get_action(cr, uid, ids, 'account.report_analyticcostledgerquantity', data=datas, context=context)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/project/wizard/account_analytic_cost_ledger_report.py b/addons/account/project/wizard/account_analytic_cost_ledger_report.py
index ffd56352382..5f00c3c9ac5 100644
--- a/addons/account/project/wizard/account_analytic_cost_ledger_report.py
+++ b/addons/account/project/wizard/account_analytic_cost_ledger_report.py
@@ -20,9 +20,9 @@
##############################################################################
import time
-
from openerp.osv import osv, fields
+
class account_analytic_cost_ledger(osv.osv_memory):
_name = 'account.analytic.cost.ledger'
_description = 'Account Analytic Cost Ledger'
@@ -42,14 +42,13 @@ class account_analytic_cost_ledger(osv.osv_memory):
context = {}
data = self.read(cr, uid, ids)[0]
datas = {
- 'ids': context.get('active_ids',[]),
- 'model': 'account.analytic.account',
- 'form': data
- }
- return {
- 'type': 'ir.actions.report.xml',
- 'report_name': 'account.analytic.account.cost_ledger',
- 'datas': datas,
- }
+ 'ids': context.get('active_ids',[]),
+ 'model': 'account.analytic.account',
+ 'form': data
+ }
+
+ datas['form']['active_ids'] = context.get('active_ids', False)
+
+ return self.pool['report'].get_action(cr, uid, ids, 'account.report_analyticcostledger', data=datas, context=context)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/project/wizard/account_analytic_inverted_balance_report.py b/addons/account/project/wizard/account_analytic_inverted_balance_report.py
index 9e54f4f848d..ad79c0b33f6 100644
--- a/addons/account/project/wizard/account_analytic_inverted_balance_report.py
+++ b/addons/account/project/wizard/account_analytic_inverted_balance_report.py
@@ -18,10 +18,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
-import time
+import time
from openerp.osv import fields, osv
+
class account_analytic_inverted_balance(osv.osv_memory):
_name = 'account.analytic.inverted.balance'
_description = 'Account Analytic Inverted Balance'
@@ -41,14 +42,11 @@ class account_analytic_inverted_balance(osv.osv_memory):
context = {}
data = self.read(cr, uid, ids)[0]
datas = {
- 'ids': context.get('active_ids',[]),
- 'model': 'account.analytic.account',
- 'form': data
- }
- return {
- 'type': 'ir.actions.report.xml',
- 'report_name': 'account.analytic.account.inverted.balance',
- 'datas': datas,
- }
+ 'ids': context.get('active_ids', []),
+ 'model': 'account.analytic.account',
+ 'form': data
+ }
+ datas['form']['active_ids'] = context.get('active_ids', False)
+ return self.pool['report'].get_action(cr, uid, ids, 'account.report_invertedanalyticbalance', data=datas, context=context)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/project/wizard/account_analytic_journal_report.py b/addons/account/project/wizard/account_analytic_journal_report.py
index 61fe2cd318a..f2e406bc3a5 100644
--- a/addons/account/project/wizard/account_analytic_journal_report.py
+++ b/addons/account/project/wizard/account_analytic_journal_report.py
@@ -18,10 +18,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
-import time
+import time
from openerp.osv import fields, osv
+
class account_analytic_journal_report(osv.osv_memory):
_name = 'account.analytic.journal.report'
_description = 'Account Analytic Journal'
@@ -49,16 +50,15 @@ class account_analytic_journal_report(osv.osv_memory):
for analytic_record in record.analytic_account_journal_id:
ids_list.append(analytic_record.id)
datas = {
- 'ids': ids_list,
- 'model': 'account.analytic.journal',
- 'form': data
- }
- return {
- 'type': 'ir.actions.report.xml',
- 'report_name': 'account.analytic.journal',
- 'datas': datas,
- }
-
+ 'ids': ids_list,
+ 'model': 'account.analytic.journal',
+ 'form': data
+ }
+ context2 = context.copy()
+ context2['active_model'] = 'account.analytic.journal'
+ context2['active_ids'] = ids_list
+ return self.pool['report'].get_action(cr, uid, ids, 'account.report_analyticjournal', data=datas, context=context2)
+
def default_get(self, cr, uid, fields, context=None):
if context is None:
context = {}
diff --git a/addons/account/report/__init__.py b/addons/account/report/__init__.py
index 544aa9e262e..ed8cc0aa8b3 100644
--- a/addons/account/report/__init__.py
+++ b/addons/account/report/__init__.py
@@ -26,12 +26,8 @@ import account_balance
import account_partner_balance
import account_general_ledger
import account_partner_ledger
-#import invoice
-import account_print_invoice
-#import overdue
import account_print_overdue
import account_aged_partner_balance
-#import tax_report
import report_vat
import account_invoice_report
import account_report
diff --git a/addons/account/report/account_aged_partner_balance.py b/addons/account/report/account_aged_partner_balance.py
index 3b000e40592..3fd83c19207 100644
--- a/addons/account/report/account_aged_partner_balance.py
+++ b/addons/account/report/account_aged_partner_balance.py
@@ -20,9 +20,11 @@
##############################################################################
import time
+from openerp.osv import osv
from openerp.report import report_sxw
from common_report_header import common_report_header
+
class aged_trial_report(report_sxw.rml_parse, common_report_header):
def __init__(self, cr, uid, name, context):
@@ -375,8 +377,11 @@ class aged_trial_report(report_sxw.rml_parse, common_report_header):
return self._translate('Receivable and Payable Accounts')
return ''
-report_sxw.report_sxw('report.account.aged_trial_balance', 'res.partner',
- 'addons/account/report/account_aged_partner_balance.rml',parser=aged_trial_report, header="internal landscape")
+class report_agedpartnerbalance(osv.AbstractModel):
+ _name = 'report.account.report_agedpartnerbalance'
+ _inherit = 'report.abstract_report'
+ _template = 'account.report_agedpartnerbalance'
+ _wrapped_report_class = aged_trial_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/report/account_aged_partner_balance.rml b/addons/account/report/account_aged_partner_balance.rml
deleted file mode 100644
index 5b5404e9c86..00000000000
--- a/addons/account/report/account_aged_partner_balance.rml
+++ /dev/null
@@ -1,285 +0,0 @@
-<?xml version="1.0"?>
-<document filename="Aged Trial Balance.pdf">
- <template pageSize="(842.0,595.0)" title="Aged Trial Balance" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
- <pageTemplate id="first">
- <frame id="first" x1="28.0" y1="57.0" width="772" height="481"/>
- </pageTemplate>
- </template>
- <stylesheet>
- <blockTableStyle id="Standard_Outline">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table1">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <blockBackground colorName="#e6e6e6" start="0,0" stop="0,0"/>
- <blockBackground colorName="#e6e6e6" start="1,0" stop="1,0"/>
- <blockBackground colorName="#e6e6e6" start="2,0" stop="2,0"/>
- <blockBackground colorName="#e6e6e6" start="0,1" stop="0,1"/>
- <blockBackground colorName="#e6e6e6" start="1,1" stop="1,1"/>
- <blockBackground colorName="#e6e6e6" start="2,1" stop="2,1"/>
- </blockTableStyle>
- <blockTableStyle id="Table_header_Content">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Tableau1">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="GRID" colorName="black"/>
- </blockTableStyle>
- <blockTableStyle id="Table2">
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,1" stop="-1,1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,2" stop="-1,-1"/>
-
- <blockValign value="TOP"/>
- <blockAlignment value="LEFT" start="2,1" stop="-1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table8">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="-1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="-1,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="0,0" stop="-1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,0" stop="-1,-1"/>
- </blockTableStyle>
-
- <blockTableStyle id="Tableau3">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="GRID" colorName="black"/>
- </blockTableStyle>
- <initialize>
- <paraStyle name="all" alignment="justify"/>
- </initialize>
- <paraStyle name="P1" fontName="Helvetica" fontSize="20.0" leading="25" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="P2" fontName="Helvetica" fontSize="8.3" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="P2_content" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Total" fontName="Helvetica-Bold" fontSize="8.5" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Total_right" fontName="Helvetica-Bold" fontSize="8.5" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="P3" fontName="Helvetica" fontSize="15.0" leading="20" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P4" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="P5" fontName="Helvetica" fontSize="8.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="P6" fontName="Helvetica" fontSize="8.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="P7" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="P8" fontName="Helvetica" fontSize="8.3" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="content" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="P9" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="P10" fontName="Helvetica" fontSize="8.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="P11" fontName="Helvetica" fontSize="8.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="P12" fontName="Helvetica" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P13" fontName="Helvetica" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P14" fontName="Helvetica" fontSize="8.0" leading="13" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="P10" fontName="Helvetica" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Standard" fontName="Helvetica"/>
- <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Heading" fontName="Helvetica" fontSize="8.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Table Contents" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Caption" fontName="Helvetica" fontSize="8.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="Index" fontName="Helvetica"/>
- <paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="15.0" leading="15" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_9_italic" fontName="Helvetica-Oblique" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_9_Bold" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
-
- </stylesheet>
- <story>
-
- <blockTable colWidths="180.0,180.0,180.0" style="Table_header_Content">
- <tr>
- <td><para style="terp_header"><font color="white"> </font></para>
- </td>
- <td><para style="terp_header_Centre">Aged Trial Balance</para></td>
- <td><para style="terp_header"><font color="white"> </font></para></td>
- </tr>
- </blockTable>
- <blockTable colWidths="110.0,110.0,110.0,110.0,128.0,93.0,110.0" style="Table8">
- <tr>
- <td>
- <para style="terp_tblheader_General_Centre">Chart of Accounts</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Fiscal Year</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Start Date</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Period Length(days)</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Partner's</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Analysis Direction</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Target Moves</para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="terp_default_Centre_8">[[ get_account(data) or '' ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ get_fiscalyear(data) or '' ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ formatLang(data['form']['date_from'],date=True) ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ data['form']['period_length'] ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">Receivable Accounts[[ data['form']['result_selection'] == 'customer' or removeParentNode('para') ]]</para>
- <para style="terp_default_Centre_8">Payable Accounts[[ data['form']['result_selection'] == 'supplier' or removeParentNode('para') ]]</para>
- <para style="terp_default_Centre_8">Receivable and Payable Accounts[[ data['form']['result_selection'] == 'customer_supplier' or removeParentNode('para') ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ data['form']['direction_selection'] ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ get_target_move(data) ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="P9">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="135.0,90.0,90.0,90.0,90.0,90.0,90.0,90.0" style="Table2" repeatRows="1">
- <tr>
- <td>
- <para style="terp_tblheader_Details">Partners</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Due[[ data['form']['direction_selection'] == 'future' and ' ' or removeParentNode('para') ]]</para>
- <para style="terp_tblheader_Details_Right">Not due[[ data['form']['direction_selection'] != 'future' and ' ' or removeParentNode('para') ]]</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">[[ data['form']['4']['name'] ]]</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">[[ data['form']['3']['name'] ]]</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">[[ data['form']['2']['name'] ]]</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">[[ data['form']['1']['name'] ]]</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">[[ data['form']['0']['name'] ]]</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Total</para>
- </td>
- </tr>
-
- <tr>
-
- <td>
- <para style="P3"> <font color="white">[[ (get_lines(data['form']), 'partner') == False or removeParentNode('para') ]]</font></para>
- <para style="P3"> <font color="white">[[ (get_lines_with_out_partner(data['form']), 'not_partner') == False or removeParentNode('para') ]]</font></para>
- <para style="Total">Account Total</para>
- </td>
- <td>
- <para style="Total_right">[[ formatLang(get_direction('6'), currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="Total_right">[[ formatLang(get_for_period('4'), currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="Total_right">[[ formatLang(get_for_period('3'), currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="Total_right">[[ formatLang(get_for_period('2'), currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="Total_right">[[ formatLang(get_for_period('1'), currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="Total_right">[[ formatLang(get_for_period('0'), currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="Total_right">[[ formatLang(get_total('5'), currency_obj=company.currency_id) ]]</para>
- </td>
- </tr>
-
- <tr>
- <td>
- <para style="P3">[[ repeatIn(get_lines(data['form']), 'partner') ]]</para>
- <para style="P2_content">[[ partner['name'] ]]</para>
- </td>
- <td>
- <para style="content">[[ formatLang(partner['direction'], currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="content">[[ formatLang(partner['4'], currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="content">[[ formatLang(partner['3'], currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="content">[[ formatLang(partner['2'], currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="content">[[ formatLang(partner['1'], currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="content">[[ formatLang(partner['0'], currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="content">[[ formatLang(partner['total'], currency_obj=company.currency_id) ]]</para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="P3">[[ repeatIn(get_lines_with_out_partner(data['form']), 'not_partner') ]]</para>
- <para style="P2_content">[[ not_partner['name'] ]]</para>
- </td>
- <td>
- <para style="content">[[ formatLang(not_partner['direction'], currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="content">[[ formatLang(not_partner['4'], currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="content">[[ formatLang(not_partner['3'], currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="content">[[ formatLang(not_partner['2'], currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="content">[[ formatLang(not_partner['1'], currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="content">[[ formatLang(not_partner['0'], currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="content">[[ formatLang(not_partner['total'], currency_obj=company.currency_id) ]]</para>
- </td>
- </tr>
- </blockTable>
-
- <para style="P9">
- <font color="white"> </font>
- </para>
- </story>
-</document>
-
diff --git a/addons/account/report/account_balance.py b/addons/account/report/account_balance.py
index 2a445984b27..af2c37fc610 100644
--- a/addons/account/report/account_balance.py
+++ b/addons/account/report/account_balance.py
@@ -21,9 +21,11 @@
import time
+from openerp.osv import osv
from openerp.report import report_sxw
from common_report_header import common_report_header
+
class account_balance(report_sxw.rml_parse, common_report_header):
_name = 'report.account.account.balance'
@@ -58,11 +60,6 @@ class account_balance(report_sxw.rml_parse, common_report_header):
objects = self.pool.get('account.account').browse(self.cr, self.uid, new_ids)
return super(account_balance, self).set_context(objects, data, new_ids, report_type=report_type)
- #def _add_header(self, node, header=1):
- # if header == 0:
- # self.rml_header = ""
- # return True
-
def _get_account(self, data):
if data['model']=='account.account':
return self.pool.get('account.account').browse(self.cr, self.uid, data['form']['id']).company_id.name
@@ -131,6 +128,11 @@ class account_balance(report_sxw.rml_parse, common_report_header):
_process_child(accounts,form['display_account'],parent)
return self.result_acc
-report_sxw.report_sxw('report.account.account.balance', 'account.account', 'addons/account/report/account_balance.rml', parser=account_balance, header="internal")
+
+class report_trialbalance(osv.AbstractModel):
+ _name = 'report.account.report_trialbalance'
+ _inherit = 'report.abstract_report'
+ _template = 'account.report_trialbalance'
+ _wrapped_report_class = account_balance
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/report/account_balance.rml b/addons/account/report/account_balance.rml
deleted file mode 100644
index 08c05c65fa8..00000000000
--- a/addons/account/report/account_balance.rml
+++ /dev/null
@@ -1,313 +0,0 @@
-<?xml version="1.0"?>
-<document filename="Account Balance.pdf">
- <template title="Account Balance" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
- <pageTemplate id="first">
- <frame id="first" x1="35.0" y1="35.0" width="525" height="772"/>
- </pageTemplate>
- </template>
- <stylesheet>
- <blockTableStyle id="Standard_Outline">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Tilte_Table">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table2">
- <blockValign value="TOP"/>
- <blockAlignment value="RIGHT"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,1" stop="-1,-1"/>
- </blockTableStyle>
-
- <blockTableStyle id="Table8">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="4,0" stop="4,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="4,0" stop="4,0"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="5,0" stop="5,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="5,0" stop="5,0"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="6,0" stop="6,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="6,0" stop="6,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="6,0" stop="6,0"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,1" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,1" stop="0,1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,1" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,1" stop="1,1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,1" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,1" stop="2,1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,1" stop="3,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,1" stop="3,1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="4,1" stop="4,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="4,1" stop="4,1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#c0c0c0" start="5,1" stop="5,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#c0c0c0" start="5,1" stop="5,1"/>
- <lineStyle kind="LINEBELOW" colorName="#c0c0c0" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#c0c0c0" start="6,1" stop="6,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#c0c0c0" start="6,1" stop="6,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#c0c0c0" start="6,1" stop="6,1"/>
- <lineStyle kind="LINEBELOW" colorName="#c0c0c0" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#c0c0c0" start="7,1" stop="7,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#c0c0c0" start="7,-1" stop="7,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#c0c0c0" start="8,1" stop="8,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#c0c0c0" start="8,1" stop="8,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#c0c0c0" start="8,-1" stop="8,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="9,1" stop="9,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="9,1" stop="9,1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="9,-1" stop="9,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="10,1" stop="10,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="10,1" stop="10,1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="10,-1" stop="10,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="11,1" stop="11,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="11,-1" stop="11,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="12,1" stop="12,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="12,1" stop="12,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="12,-1" stop="12,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="13,1" stop="13,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="13,1" stop="13,1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="13,-1" stop="13,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="14,1" stop="14,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="14,1" stop="14,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="14,1" stop="14,1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="14,-1" stop="14,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#c0c0c0" start="0,2" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#c0c0c0" start="0,2" stop="0,2"/>
- <lineStyle kind="LINEBELOW" colorName="#c0c0c0" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#c0c0c0" start="1,2" stop="1,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#c0c0c0" start="1,2" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#c0c0c0" start="1,2" stop="1,2"/>
- <lineStyle kind="LINEBELOW" colorName="#c0c0c0" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#c0c0c0" start="0,3" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#c0c0c0" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#c0c0c0" start="1,3" stop="1,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#c0c0c0" start="1,3" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#c0c0c0" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,4" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,4" stop="0,4"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,4" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,4" stop="1,4"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,5" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,5" stop="1,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="1,5" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table5">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table6">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Account_Balance_Content">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table_account_Detail">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
- </blockTableStyle>
- <initialize>
- <paraStyle name="all" alignment="justify"/>
- </initialize>
- <paraStyle name="P1" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P2" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P3" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="P4" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P5" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P6" fontName="Helvetica-Bold" fontSize="2.0" leading="3" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0" textColor="#ffffff"/>
- <paraStyle name="P7" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="P8" fontName="Helvetica"/>
- <paraStyle name="P9" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="P10" fontName="Helvetica-Bold" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="0.0" alignment="RIGHT"/>
- <paraStyle name="P11" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P12" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="P13" fontName="Helvetica-Bold" fontSize="2.0" leading="3" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0" textColor="#ffffff"/>
- <paraStyle name="P14" rightIndent="17.0" leftIndent="-0.0" fontName="Helvetica-Bold" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="P15" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="P16" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P17" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="Standard" fontName="Helvetica"/>
- <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Table Contents" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Caption" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="Index" fontName="Helvetica"/>
- <paraStyle name="Heading" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Footer" fontName="Helvetica"/>
- <paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
- <paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_Centre_7" fontName="Helvetica" fontSize="7.0" leading="9" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="15.0" leading="15" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_9_italic" fontName="Helvetica-Oblique" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_9_Bold" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="Heading 3" fontName="Helvetica-Bold" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="P12a" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <images/>
- </stylesheet>
- <story>
- <para style="P8">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="525.0" style="Table_Tilte_Table">
- <tr>
- <td>
- <para style="P15">Trial Balance </para>
- </td>
- </tr>
- </blockTable>
- <para style="P11">
- <font color="white"> </font>
- </para>
- <para style="P11">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="130.0,80.0,100.0,140.0,90.0" style="Table8">
- <tr>
- <td>
- <para style="terp_tblheader_General_Centre">Company[[ data['model']=='account.account' and ' ' or removeParentNode('para') ]]</para>
- <para style="terp_tblheader_General_Centre">Chart of Accounts[[ data['model']=='ir.ui.menu' and ' ' or removeParentNode('para') ]]</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Fiscal Year</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Display Account</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Filter By <font>[[ data['form']['filter']!='filter_no' and get_filter(data) ]]</font> </para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Target Moves</para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="terp_default_Centre_8">[[ get_account(data) or '' ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ get_fiscalyear(data) or '' ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_7">All[[ data['form']['display_account']=='all' and ' ' or removeParentNode('para') ]]</para>
- <para style="terp_default_Centre_7">With movements[[ data['form']['display_account']=='movement' and ' ' or removeParentNode('para') ]]</para>
- <para style="terp_default_Centre_7">With balance is not equal to 0[[ data['form']['display_account']=='not_zero' and ' ' or removeParentNode('para') ]]</para>
- </td>
- <td> <para style="terp_default_Centre_8">[[ data['form']['filter']=='filter_no' and get_filter(data) or removeParentNode('para') ]] </para>
- <blockTable colWidths="60.0,60.0" style="Table5">[[ data['form']['filter']=='filter_date' or removeParentNode('blockTable') ]]
- <tr>
- <td>
- <para style="terp_tblheader_General_Centre">Start Date</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">End Date</para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="terp_default_Centre_8">[[ formatLang(get_start_date(data),date=True) ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ formatLang(get_end_date(data),date=True) ]]</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="60.0,60.0" style="Table5">[[ data['form']['filter']=='filter_period' or removeParentNode('blockTable') ]]
- <tr>
- <td>
- <para style="terp_tblheader_General_Centre">Start Period</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">End Period</para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="terp_default_Centre_8">[[ get_start_period(data) or removeParentNode('para') ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ get_end_period(data) or removeParentNode('para') ]]</para>
- </td>
- </tr>
- </blockTable>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ get_target_move(data) ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="P11">
- <font color="white"> </font>
- </para>
- <para style="P11">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="80,215.0,80.0,80.0,80.0" style="Table2" repeatRows="1">
- <tr noRowsplits="1">
- <td><para style="P12a">Code</para></td>
- <td><para style="P12a">Account</para></td>
- <td><para style="P10">Debit</para></td>
- <td><para style="P10">Credit</para></td>
- <td><para style="P10">Balance</para></td>
- </tr>
- <tr>
- <td><para style="P14">[[ repeatIn(lines(data['form']), 'a') ]]<font>[[ (a['type']&lt;&gt;'view' and setTag('para','para',{'fontName':"Helvetica"})) or removeParentNode('font') ]]</font><i>[[ a['code'] or removeParentNode('tr') ]]</i></para></td>
- <td><para style="P14"><font>[[ (a['type']&lt;&gt;'view' and setTag('para','para',{'fontName':"Helvetica"})) or removeParentNode('font') ]]</font><font color="white">[[ '..'*(a['level']-1) ]]</font><font>[[ a['name'] ]]</font> </para></td>
- <td><para style="P3"><font>[[ (a['type']&lt;&gt;'view' and setTag('para','para',{'fontName':"Helvetica"})) or removeParentNode('font') ]]</font><font>[[ a['type']=='view' and removeParentNode('font') ]][[ formatLang(a['debit']) ]]</font><font>[[ a['type']&lt;&gt;'view' and removeParentNode('font') ]] [[formatLang(a['debit']) ]]</font></para></td>
- <td><para style="P3"><font>[[ (a['type']&lt;&gt;'view' and setTag('para','para',{'fontName':"Helvetica"})) or removeParentNode('font')]]</font><font>[[ a['type']=='view' and removeParentNode('font') ]][[ formatLang(a['credit']) ]]</font><font>[[ a['type']&lt;&gt;'view' and removeParentNode('font') ]] [[ formatLang(a['credit']) ]]</font> </para></td>
- <td><para style="P3"><font>[[ (a['type']&lt;&gt;'view' and setTag('para','para',{'fontName':"Helvetica"})) or removeParentNode('font') ]]</font><font>[[ a['type']=='view' and removeParentNode('font') ]][[ formatLang(a['balance'], currency_obj=company.currency_id) ]]</font><font>[[ a['type']&lt;&gt;'view' and removeParentNode('font') ]] [[ formatLang(a['balance'], currency_obj=company.currency_id) ]]</font> </para></td>
- </tr>
- </blockTable>
- <para style="P11">
- <font color="white"> </font>
- </para>
- </story>
-</document>
diff --git a/addons/account/report/account_central_journal.py b/addons/account/report/account_central_journal.py
index 8dae208a7a5..28892d0730e 100644
--- a/addons/account/report/account_central_journal.py
+++ b/addons/account/report/account_central_journal.py
@@ -20,11 +20,14 @@
##############################################################################
import time
+from openerp.osv import osv
from openerp.report import report_sxw
from common_report_header import common_report_header
#
# Use period and Journal for selection or resources
#
+
+
class journal_print(report_sxw.rml_parse, common_report_header):
def __init__(self, cr, uid, name, context=None):
@@ -103,6 +106,11 @@ class journal_print(report_sxw.rml_parse, common_report_header):
return True
return data['form']['amount_currency']
-report_sxw.report_sxw('report.account.central.journal', 'account.journal.period', 'addons/account/report/account_central_journal.rml', parser=journal_print, header='external')
+
+class report_agedpartnerbalance(osv.AbstractModel):
+ _name = 'report.account.report_centraljournal'
+ _inherit = 'report.abstract_report'
+ _template = 'account.report_centraljournal'
+ _wrapped_report_class = journal_print
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/report/account_central_journal.rml b/addons/account/report/account_central_journal.rml
deleted file mode 100644
index 6d350b5fe8f..00000000000
--- a/addons/account/report/account_central_journal.rml
+++ /dev/null
@@ -1,338 +0,0 @@
-<?xml version="1.0"?>
-<document filename="Centralized Journal.pdf">
- <template title="Centralized Journal" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
- <pageTemplate id="first">
- <frame id="first" x1="28.0" y1="42.0" width="539" height="758"/>
- </pageTemplate>
- </template>
- <stylesheet>
- <blockTableStyle id="Standard_Outline">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table_header_Content">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Subheader_Content_detail">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="4,0" stop="4,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="4,0" stop="4,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="5,0" stop="5,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="5,0" stop="5,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="6,0" stop="6,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="6,0" stop="6,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="6,0" stop="6,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="7,0" stop="7,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="7,0" stop="7,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="7,0" stop="7,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="7,-1" stop="7,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="8,0" stop="8,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="8,0" stop="8,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="8,0" stop="8,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="8,-1" stop="8,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Sub_Header_Content">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="4,0" stop="4,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="4,0" stop="4,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="5,0" stop="5,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="5,0" stop="5,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="6,0" stop="6,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="6,0" stop="6,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="6,0" stop="6,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="7,0" stop="7,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="7,0" stop="7,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="7,0" stop="7,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="7,-1" stop="7,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="8,0" stop="8,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="8,0" stop="8,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="8,0" stop="8,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="8,-1" stop="8,-1"/>
- </blockTableStyle>
-
- <blockTableStyle id="Table_Account_detail_Title">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Account_detail_Title_Currency">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="6,-1" stop="6,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table3">
- <blockAlignment value="LEFT"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Final_Total">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Final_Total_currency">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="6,-1" stop="6,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Journal_Line_Content">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Journal_Line_Content_currency">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table2">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,0" stop="-1,0"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="4,0" stop="4,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="4,0" stop="4,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="5,0" stop="5,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="5,0" stop="5,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="6,0" stop="6,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="6,0" stop="6,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="6,0" stop="6,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="7,0" stop="7,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="7,0" stop="7,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="7,0" stop="7,0"/>
- </blockTableStyle>
-
- <initialize>
- <paraStyle name="all" alignment="justify"/>
- </initialize>
- <paraStyle name="Standard" fontName="Times-Roman"/>
- <paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="List" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Table Contents" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Caption" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="Index" fontName="Times-Roman"/>
- <paraStyle name="Heading" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Footer" fontName="Times-Roman"/>
- <paraStyle name="Horizontal Line" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
- <paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="P9" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="15.0" leading="15" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_9_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- </stylesheet>
- <images/>
- <story>
- <para style="terp_default_8">[[ repeatIn(objects, 'o') ]]</para>
- <blockTable colWidths="180.0,180.0,180.0" style="Table_header_Content">
- <tr>
- <td><para style="terp_header"><font color="white"> </font></para>
- </td>
- <td><para style="terp_header_Centre">Centralized Journal</para></td>
- <td><para style="terp_header"><font color="white"> </font></para></td>
- </tr>
- </blockTable>
- <blockTable colWidths="130.0,80.0,100.0,130.0,100.0" style="Table2">
- <tr>
- <td><para style="terp_tblheader_General_Centre">Chart of Accounts</para></td>
- <td><para style="terp_tblheader_General_Centre">Fiscal Year</para></td>
- <td><para style="terp_tblheader_General_Centre">Journal</para></td>
- <td><para style="terp_tblheader_General_Centre">Filter By [[ data['form']['filter']!='filter_no' and get_filter(data) ]]</para></td>
- <td><para style="terp_tblheader_General_Centre">Target Moves</para></td>
- </tr>
- <tr>
- <td><para style="terp_default_Centre_8">[[ get_account(data) or removeParentNode('para') ]]</para></td>
- <td><para style="terp_default_Centre_8">[[ get_fiscalyear(data) or '' ]]</para></td>
- <td><para style="terp_default_Centre_8">[[o.journal_id.name ]]</para></td>
- <td><para style="terp_default_Centre_8">[[ data['form']['filter']=='filter_no' and get_filter(data) or removeParentNode('para') ]] </para>
- <blockTable colWidths="60.0,60.0" style="Table3">[[ data['form']['filter']=='filter_date' or removeParentNode('blockTable') ]]
- <tr>
- <td><para style="terp_tblheader_Details_Centre">Start Date</para></td>
- <td><para style="terp_tblheader_Details_Centre">End Date</para></td>
- </tr>
- <tr>
- <td><para style="terp_default_Centre_8">[[ formatLang(get_start_date(data),date=True) ]]</para></td>
- <td><para style="terp_default_Centre_8">[[ formatLang(get_end_date(data),date=True) ]]</para></td>
- </tr>
- </blockTable>
- <blockTable colWidths="65.0,65.0" style="Table3">[[ data['form']['filter']=='filter_period' or removeParentNode('blockTable') ]]
- <tr>
- <td><para style="terp_tblheader_Details_Centre">Start Period</para></td>
- <td><para style="terp_tblheader_Details_Centre">End Period</para></td>
- </tr>
- <tr>
- <td><para style="terp_default_Centre_8">[[ get_start_period(data) or removeParentNode('para') ]]</para></td>
- <td><para style="terp_default_Centre_8">[[ get_end_period(data) or removeParentNode('para') ]]</para></td>
- </tr>
- </blockTable>
- </td>
- <td><para style="terp_default_Centre_8">[[ get_target_move(data) ]] </para></td>
- </tr>
- </blockTable>
- <para style="P9">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="50.0,240.0,85.0,85.0,90.0" style="Table_Account_detail_Title">[[ display_currency(data) == False or removeParentNode('blockTable') ]]
- <tr>
- <td><para style="terp_tblheader_Details">A/C No.</para></td>
- <td><para style="terp_tblheader_Details">Account Name</para></td>
- <td><para style="terp_tblheader_Details_Right">Debit</para></td>
- <td><para style="terp_tblheader_Details_Right">Credit</para></td>
- <td><para style="terp_tblheader_Details_Right">Balance</para></td>
- </tr>
- </blockTable>
- <blockTable colWidths="50.0,180.0,80.0,80.0,80.0,80.0" style="Table_Account_detail_Title_Currency">[[ display_currency(data) or removeParentNode('blockTable') ]]
- <tr>
- <td><para style="terp_tblheader_Details">A/C No.</para></td>
- <td><para style="terp_tblheader_Details">Account Name</para></td>
- <td><para style="terp_tblheader_Details_Right">Debit</para></td>
- <td><para style="terp_tblheader_Details_Right">Credit</para></td>
- <td><para style="terp_tblheader_Details_Right">Balance</para></td>
- <td><para style="terp_tblheader_Details_Right">Currency</para></td>
- </tr>
- </blockTable>
- <blockTable colWidths="50.0,240.0,85.0,85.0,90.0" style="Table_Final_Total">[[ display_currency(data) == False or removeParentNode('blockTable') ]]
- <tr>
- <td><para style="terp_default_Bold_9">Total:</para></td>
- <td><para style="terp_default_Bold_9"><font color="white"> </font></para></td>
- <td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_debit(o.period_id.id, o.journal_id.id)) ]] </para></td>
- <td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_credit(o.period_id.id, o.journal_id.id)) ]] </para></td>
- <td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_credit(o.period_id.id, o.journal_id.id)-sum_debit(o.period_id.id, o.journal_id.id), currency_obj=company.currency_id ) ]]</para></td>
- </tr>
- </blockTable>
- <blockTable colWidths="50.0,180.0,80.0,80.0,80.0,80.0" style="Table_Final_Total_currency">[[ display_currency(data) or removeParentNode('blockTable') ]]
- <tr>
- <td><para style="terp_default_Bold_9">Total:</para></td>
- <td><para style="terp_default_Bold_9"><font color="white"> </font></para></td>
- <td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_debit(o.period_id.id, o.journal_id.id)) ]]</para></td>
- <td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_credit(o.period_id.id, o.journal_id.id)) ]]</para></td>
- <td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_credit(o.period_id.id, o.journal_id.id)-sum_debit(o.period_id.id, o.journal_id.id), currency_obj=company.currency_id ) ]]</para></td>
- <td><para style="terp_default_Bold_9"><font color="white"> </font></para></td>
- </tr>
- </blockTable>
- <section>
- <para style="terp_default_8">[[ repeatIn(lines(o.period_id.id,o.journal_id.id),'line') ]]</para>
- <blockTable colWidths="50.0,240.0,85.0,85.0,90.0" style="Table_Journal_Line_Content">[[ display_currency(data) == False or removeParentNode('blockTable') ]]
- <tr>
- <td><para style="terp_default_9">[[ line['code'] ]]</para></td>
- <td><para style="terp_default_9">[[ line['name'] ]]</para></td>
- <td><para style="terp_default_Right_9">[[ formatLang(line['debit']) ]]</para></td>
- <td><para style="terp_default_Right_9">[[ formatLang(line['credit'])]]</para></td>
- <td><para style="terp_default_Right_9">[[ formatLang(line['credit']-line['debit'], currency_obj=company.currency_id ) ]]</para></td>
- </tr>
- </blockTable>
- <blockTable colWidths="50.0,180.0,80.0,80.0,80.0,80.0" style="Table_Journal_Line_Content_currency">[[ display_currency(data) or removeParentNode('blockTable') ]]
- <tr>
- <td><para style="terp_default_9">[[ line['code'] ]]</para></td>
- <td><para style="terp_default_9">[[ line['name'] ]]</para></td>
- <td><para style="terp_default_Right_9">[[ formatLang(line['debit']) ]]</para></td>
- <td><para style="terp_default_Right_9">[[ formatLang(line['credit'])]]</para></td>
- <td><para style="terp_default_Right_9">[[ formatLang(line['credit']-line['debit'], currency_obj=company.currency_id ) ]]</para></td>
- <td><para style="terp_default_Right_9"><font>[[ (line['currency_id']==None or line['amount_currency']==None) and removeParentNode('font') ]] [[ formatLang(line['amount_currency'] ) ]] [[ line['currency_code'] or '' ]]</font></para></td>
- </tr>
- </blockTable>
- </section>
-
- </story>
-</document>
diff --git a/addons/account/report/account_financial_report.py b/addons/account/report/account_financial_report.py
index 2b1f5af4d68..064f02c5fbf 100644
--- a/addons/account/report/account_financial_report.py
+++ b/addons/account/report/account_financial_report.py
@@ -23,6 +23,8 @@ import time
from openerp.report import report_sxw
from common_report_header import common_report_header
from openerp.tools.translate import _
+from openerp.osv import osv
+
class report_account_common(report_sxw.rml_parse, common_report_header):
@@ -105,8 +107,11 @@ class report_account_common(report_sxw.rml_parse, common_report_header):
lines.append(vals)
return lines
-report_sxw.report_sxw('report.account.financial.report', 'account.financial.report',
- 'addons/account/report/account_financial_report.rml', parser=report_account_common, header='internal')
+class report_financial(osv.AbstractModel):
+ _name = 'report.account.report_financial'
+ _inherit = 'report.abstract_report'
+ _template = 'account.report_financial'
+ _wrapped_report_class = report_account_common
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/report/account_financial_report.rml b/addons/account/report/account_financial_report.rml
deleted file mode 100644
index 7949077e43f..00000000000
--- a/addons/account/report/account_financial_report.rml
+++ /dev/null
@@ -1,303 +0,0 @@
-<?xml version="1.0"?>
-<document filename="Financial Report.pdf">
- <template title="Financial Report" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
- <pageTemplate id="first">
- <frame id="first" x1="28.0" y1="28.0" width="539" height="786"/>
- </pageTemplate>
- </template>
- <stylesheet>
- <blockTableStyle id="Standard_Outline">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Heading">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Company_Name">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Date_from_To">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Account_Line_Title">
- <blockAlignment value="LEFT"/>
- <blockValign value="MIDDLE"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
- </blockTableStyle>
- <blockTableStyle id="Table3">
- <blockAlignment value="LEFT"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table6">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Net_Profit_Loss">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,0" stop="-1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table4">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,0" stop="-1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Final_Result">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table2_header">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,0" stop="-1,0"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="4,0" stop="4,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="4,0" stop="4,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="5,0" stop="5,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="5,0" stop="5,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="6,0" stop="6,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="6,0" stop="6,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="6,0" stop="6,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="7,0" stop="7,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="7,0" stop="7,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="7,0" stop="7,0"/>
- </blockTableStyle>
- <initialize>
- <paraStyle name="all" alignment="justify"/>
- </initialize>
- <paraStyle name="P1" rightIndent="2.0" leftIndent="0.0" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="P2" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="Standard" fontName="Times-Roman"/>
- <paraStyle name="Heading" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Caption" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="Index" fontName="Helvetica" fontSize="9.0" leading="11"/>
- <paraStyle name="Footer" fontName="Times-Roman"/>
- <paraStyle name="Table Contents" fontName="Times-Roman"/>
- <paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER"/>
- <paraStyle name="Horizontal Line" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
- <paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_9_Bold" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
-
- <paraStyle name="terp_level_0_name" fontName="Helvetica-Bold" fontSize="9.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_level_0_balance" fontName="Helvetica-Bold" fontSize="9.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_level_1_name" fontName="Helvetica-Bold" fontSize="10.0" alignment="LEFT" leading="20" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_level_1_balance" fontName="Helvetica-Bold" fontSize="10.0" alignment="RIGHT" leading="20" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_level_2_name" fontName="Helvetica-Bold" fontSize="9.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_level_2_balance" fontName="Helvetica-Bold" fontSize="9.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_level_3_name" fontName="Helvetica-Bold" fontSize="8.0" leftIndent="10.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_level_3_balance" fontName="Helvetica-Bold" fontSize="8.0" leftIndent="10.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_level_4_name" fontName="Helvetica" fontSize="8.0" leftIndent="20.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_level_4_balance" fontName="Helvetica" fontSize="8.0" leftIndent="0.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_level_5_name" fontName="Helvetica-Oblique" fontSize="7.5" leftIndent="30.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_level_5_balance" fontName="Helvetica-Oblique" fontSize="7.5" leftIndent="0.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_level_6_name" fontName="Helvetica" fontSize="6.5" leftIndent="40.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_level_6_balance" fontName="Helvetica" fontSize="6.5" leftIndent="0.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
-
- <blockTableStyle id="Table1">
- <blockTopPadding start="0,0" stop="-1,0" length="10"/>
- <blockAlignment value="LEFT"/>
- <lineStyle kind="LINEBELOW" colorName="#666666" start="1,1" stop="-1,1"/>
- </blockTableStyle>
- <blockTableStyle id="Table2">
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table3">
- <blockValign value="TOP"/>
- </blockTableStyle>
-
-</stylesheet>
- <images/>
- <story>
- <blockTable colWidths="539.0" style="Table_Company_Name">
- <tr>
- <td>
- <para style="terp_header_Centre">[[ data['form']['account_report_id'][1] ]]</para>
- </td>
- </tr>
- </blockTable>
-
- <para style="Standard">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="122.0,122.0,122.0,122.0" style="Table2_header">
- <tr>
- <td><para style="terp_tblheader_General_Centre">Chart of Accounts</para></td>
- <td><para style="terp_tblheader_General_Centre">Fiscal Year</para></td>
- <td><para style="terp_tblheader_General_Centre">Filter By [[ get_filter(data)!='No Filters' and get_filter(data) ]]</para></td>
- <td><para style="terp_tblheader_General_Centre">Target Moves</para></td>
- </tr>
- <tr>
- <td><para style="terp_default_Centre_8">[[ get_account(data) or removeParentNode('para') ]]</para></td>
- <td><para style="terp_default_Centre_8">[[ get_fiscalyear(data) or '' ]]</para></td>
- <td><para style="terp_default_Centre_8">[[ get_filter(data)=='No Filters' and get_filter(data) or removeParentNode('para') ]] </para>
- <blockTable colWidths="60.0,60.0" style="Table3">[[ get_filter(data)=='Date' or removeParentNode('blockTable') ]]
- <tr>
- <td><para style="terp_tblheader_General_Centre">Start Date</para></td>
- <td><para style="terp_tblheader_General_Centre">End Date</para></td>
- </tr>
- <tr>
- <td><para style="terp_default_Centre_8">[[ formatLang(get_start_date(data),date=True) ]]</para></td>
- <td><para style="terp_default_Centre_8">[[ formatLang(get_end_date(data),date=True) ]]</para></td>
- </tr>
- </blockTable>
- <blockTable colWidths="65.0,60.0" style="Table3">[[ get_filter(data)=='Periods' or removeParentNode('blockTable') ]]
- <tr>
- <td><para style="terp_tblheader_General_Centre">Start Period</para></td>
- <td><para style="terp_tblheader_General_Centre">End Period</para></td>
- </tr>
- <tr>
- <td><para style="terp_default_Centre_8">[[ get_start_period(data) or removeParentNode('para') ]]</para></td>
- <td><para style="terp_default_Centre_8">[[ get_end_period(data) or removeParentNode('para') ]]</para></td>
- </tr>
- </blockTable>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ get_target_move(data) ]]</para>
- </td>
-
- </tr>
- </blockTable>
- <para style="Standard">
- <font color="white"> </font>
- </para>
- <para style="Standard">
- <font color="white"> </font>
- </para>
- <!-- table with debit/credit displayed -->
- <blockTable colWidths="210.0,90.0,90.0,100.0" style="Table_Account_Line_Title">
- [[ data['form']['debit_credit'] == 1 or removeParentNode('blockTable') ]]
- <tr>
- <td>
- <para style="terp_default_Bold_9">Name</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Debit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Credit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Balance</para>
- </td>
- </tr>
- <tr style="Table3">
- [[ repeatIn(get_lines(data), 'a') ]]
- [[ (a.get('level') &lt;&gt; 0) or removeParentNode('tr') ]]
- [[ setTag('tr','tr',{'style': 'Table'+str(min(3,'level' in a and a.get('level') or 1))}) ]]
- <td><para style="terp_level_3_name">[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a.get('level')))+'_name'}) ]][[ a.get('name') ]]</para></td>
- <td><para style="terp_level_3_balance">[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a.get('level')))+'_balance'}) ]][[ formatLang(a.get('debit',0.0), currency_obj = company.currency_id) ]]</para></td>
- <td><para style="terp_level_3_balance">[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a.get('level')))+'_balance'}) ]][[ formatLang(a.get('credit',0.0), currency_obj = company.currency_id) ]]</para></td>
- <td>[[ (a.get('account_type') =='view' and a.get('level') &lt;&gt; 1) or removeParentNode('td') ]]
- <para style="terp_level_3_balance"><u>[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a.get('level')))+'_balance'}) ]][[ formatLang(a.get('balance'), currency_obj = company.currency_id) ]]</u></para></td>
- <td>[[ (a.get('account_type') &lt;&gt;'view' or a.get('level') == 1) or removeParentNode('td') ]]
- <para style="terp_level_3_balance">[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a.get('level')))+'_balance'}) ]][[ formatLang(a.get('balance'), currency_obj = company.currency_id) ]]</para></td>
- </tr>
- </blockTable>
-
- <!-- table with no comparison, no debit/credit displayed -->
- <blockTable colWidths="390.0,100.0" style="Table_Account_Line_Title">
- [[ (not data['form']['enable_filter'] and not data['form']['debit_credit']) or removeParentNode('blockTable') ]]
- <tr>
- <td>
- <para style="terp_default_Bold_9">Name</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Balance</para>
- </td>
- </tr>
- <tr style="Table3">
- [[ repeatIn(get_lines(data), 'a') ]]
- [[ (a.get('level') &lt;&gt; 0) or removeParentNode('tr') ]]
- [[ setTag('tr','tr',{'style': 'Table'+str(min(3,'level' in a and a.get('level') or 1))}) ]]
- <td><para style="terp_level_3_name">[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a.get('level')))+'_name'}) ]][[ a.get('name') ]]</para></td>
- <td>[[ (a.get('account_type') =='view' and a.get('level') &lt;&gt; 1) or removeParentNode('td') ]]
- <para style="terp_level_3_balance"><u>[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a.get('level')))+'_balance'}) ]][[ formatLang(a.get('balance'), currency_obj = company.currency_id) ]]</u></para></td>
- <td>[[ (a.get('account_type') &lt;&gt;'view' or a.get('level') == 1) or removeParentNode('td') ]]
- <para style="terp_level_3_balance">[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a.get('level')))+'_balance'}) ]][[ formatLang(a.get('balance'), currency_obj = company.currency_id) ]]</para></td>
- </tr>
- </blockTable>
- <para style="Standard">
- <font color="white"> </font>
- </para>
-
- <!-- table with comparison -->
- <blockTable colWidths="263.0,100.0,100" style="Table_Account_Line_Title">
- [[ (data['form']['enable_filter'] == 1 and not data['form']['debit_credit']) or removeParentNode('blockTable') ]]
- <tr>
- <td>
- <para style="terp_default_Bold_9">Name</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Balance</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">[[ data['form']['label_filter'] ]]</para>
- </td>
- </tr>
- <tr style="Table3">
- [[ repeatIn(get_lines(data), 'a') ]]
- [[ (a.get('level') &lt;&gt; 0) or removeParentNode('tr') ]]
- [[ setTag('tr','tr',{'style': 'Table'+str(min(3,'level' in a and a.get('level') or 1))}) ]]
- <td><para style="terp_level_3_name">[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a.get('level')))+'_name'}) ]][[ a.get('name') ]]</para></td>
- <td>[[ (a.get('account_type') =='view' and a.get('level') &lt;&gt; 1) or removeParentNode('td') ]]
- <para style="terp_level_3_balance"><u>[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a.get('level')))+'_balance'}) ]][[ formatLang(a.get('balance'), currency_obj = company.currency_id) ]]</u></para></td>
- <td>[[ (a.get('account_type') &lt;&gt;'view' or a.get('level') == 1) or removeParentNode('td') ]]
- <para style="terp_level_3_balance">[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a.get('level')))+'_balance'}) ]][[ formatLang(a.get('balance'), currency_obj = company.currency_id) ]]</para></td>
- <td>[[ (a.get('account_type') =='view' and a.get('level') &lt;&gt; 1) or removeParentNode('td') ]]
- <para style="terp_level_3_balance"><u>[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a.get('level')))+'_balance'}) ]][[ formatLang(a.get('balance_cmp'), currency_obj = company.currency_id) ]]</u></para></td>
- <td>[[ (a.get('account_type') &lt;&gt;'view' or a.get('level') == 1) or removeParentNode('td') ]]
- <para style="terp_level_3_balance">[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a.get('level')))+'_balance'}) ]][[ formatLang(a.get('balance_cmp'), currency_obj = company.currency_id) ]]</para></td>
- </tr>
- </blockTable>
- <para style="Standard">
- <font color="white"> </font>
- </para>
- </story>
-</document>
diff --git a/addons/account/report/account_general_journal.py b/addons/account/report/account_general_journal.py
index 4f63411478c..ada615e31fa 100644
--- a/addons/account/report/account_general_journal.py
+++ b/addons/account/report/account_general_journal.py
@@ -20,8 +20,10 @@
##############################################################################
import time
-from common_report_header import common_report_header
+from openerp.osv import osv
from openerp.report import report_sxw
+from common_report_header import common_report_header
+
class journal_print(report_sxw.rml_parse, common_report_header):
@@ -156,6 +158,11 @@ class journal_print(report_sxw.rml_parse, common_report_header):
(tuple(move_state), period_id, tuple(journals)))
return self.cr.fetchone()[0] or 0.0
-report_sxw.report_sxw('report.account.general.journal', 'account.journal.period', 'addons/account/report/general_journal.rml', parser=journal_print, header='internal')
+
+class report_generaljournal(osv.AbstractModel):
+ _name = 'report.account.report_generaljournal'
+ _inherit = 'report.abstract_report'
+ _template = 'account.report_generaljournal'
+ _wrapped_report_class = journal_print
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/report/account_general_journal.rml b/addons/account/report/account_general_journal.rml
deleted file mode 100644
index dce30e59918..00000000000
--- a/addons/account/report/account_general_journal.rml
+++ /dev/null
@@ -1,387 +0,0 @@
-<?xml version="1.0"?>
-<document filename="General Journal.pdf">
- <template title="General Journal" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
- <pageTemplate id="first">
- <frame id="first" x1="28.0" y1="42.0" width="540" height="758"/>
- </pageTemplate>
- </template>
- <stylesheet>
- <blockTableStyle id="Standard_Outline">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Header_Title">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Print_Current_datetime">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Journal_Title">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,1" stop="-1,1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,2" stop="-1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,1" stop="-1,1"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Final_Total">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Sub_Total">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="2,-1" stop="2,-1"/>
- </blockTableStyle>
-
- <blockTableStyle id="Table_Subheader_Content_detail">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="4,0" stop="4,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="4,0" stop="4,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="5,0" stop="5,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="5,0" stop="5,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="6,0" stop="6,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="6,0" stop="6,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="6,0" stop="6,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="7,0" stop="7,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="7,0" stop="7,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="7,0" stop="7,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="7,-1" stop="7,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="8,0" stop="8,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="8,0" stop="8,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="8,0" stop="8,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="8,-1" stop="8,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table2">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,0" stop="-1,0"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="4,0" stop="4,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="4,0" stop="4,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="5,0" stop="5,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="5,0" stop="5,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="6,0" stop="6,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="6,0" stop="6,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="6,0" stop="6,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="7,0" stop="7,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="7,0" stop="7,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="7,0" stop="7,0"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Sub_Header_Content">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="4,0" stop="4,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="4,0" stop="4,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="5,0" stop="5,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="5,0" stop="5,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="6,0" stop="6,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="6,0" stop="6,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="6,0" stop="6,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="7,0" stop="7,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="7,0" stop="7,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="7,0" stop="7,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="7,-1" stop="7,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="8,0" stop="8,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="8,0" stop="8,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="8,0" stop="8,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="8,-1" stop="8,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table3">
- <blockAlignment value="LEFT"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Company_Name">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Journal_Detail">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,0" stop="-1,-1"/>
- </blockTableStyle>
- <initialize>
- <paraStyle name="all" alignment="justify"/>
- </initialize>
- <paraStyle name="Standard" fontName="Times-Roman"/>
- <paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="P9" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Table Contents" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Heading" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Caption" fontName="Helvetica-Oblique" fontSize="9.0" leading="11" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="Index" fontName="Helvetica"/>
- <paraStyle name="Footer" fontName="Times-Roman"/>
- <paraStyle name="Horizontal Line" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
- <paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="15.0" leading="15" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_9_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- </stylesheet>
- <images/>
- <story>
- <para style="terp_default_8">[[ repeatIn( periods(objects), 'o') ]]</para>
-
- <blockTable colWidths="180.0,180.0,179.0" style="Table_Header_Title">
- <tr>
- <td>
- <para style="terp_header">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_header_Centre">General Journal</para>
- </td>
- <td>
- <para style="terp_header">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="80.0,100,80.0,150.0,100.0" style="Table2">
- <tr>
- <td><para style="terp_tblheader_General_Centre">Company[[ data['model']=='account.journal.period' and ' ' or removeParentNode('para') ]]</para>
- <para style="terp_tblheader_General_Centre">Chart of Accounts[[ data['model']=='ir.ui.menu' and ' ' or removeParentNode('para') ]]</para></td>
- <td><para style="terp_tblheader_General_Centre">Fiscal Year</para></td>
- <td><para style="terp_tblheader_General_Centre">Journals</para></td>
- <td><para style="terp_tblheader_General_Centre">Filter By [[ data['form']['filter']!='filter_no' and get_filter(data) ]]</para></td>
- <td><para style="terp_tblheader_General_Centre">Target Moves</para></td>
- </tr>
- <tr>
- <td><para style="terp_default_Centre_8">[[ get_account(data) or removeParentNode('para') ]]</para></td>
- <td><para style="terp_default_Centre_8">[[ get_fiscalyear(data) or '' ]]</para></td>
- <td> <para style="terp_default_Centre_8">[[', '.join([ lt or '' for lt in get_journal(data) ]) ]] </para></td>
- <td><para style="terp_default_Centre_8">[[ data['form']['filter']=='filter_no' and get_filter(data) or removeParentNode('para') ]] </para>
- <blockTable colWidths="60.0,60.0" style="Table3">[[ data['form']['filter']=='filter_date' or removeParentNode('blockTable') ]]
- <tr>
- <td><para style="terp_tblheader_Details_Centre">Start Date</para></td>
- <td><para style="terp_tblheader_Details_Centre">End Date</para></td>
- </tr>
- <tr>
- <td><para style="terp_default_Centre_8">[[ formatLang(get_start_date(data),date=True)]]</para></td>
- <td><para style="terp_default_Centre_8">[[ formatLang(get_end_date(data),date=True) ]]</para></td>
- </tr>
- </blockTable>
- <blockTable colWidths="60.0,60.0" style="Table3">[[ data['form']['filter']=='filter_period' or removeParentNode('blockTable') ]]
- <tr>
- <td><para style="terp_tblheader_Details_Centre">Start Period</para></td>
- <td><para style="terp_tblheader_Details_Centre">End Period</para></td>
- </tr>
- <tr>
- <td><para style="terp_default_Centre_8">[[ get_start_period(data) or removeParentNode('para') ]]</para></td>
- <td><para style="terp_default_Centre_8">[[ get_end_period(data) or removeParentNode('para') ]]</para></td>
- </tr>
- </blockTable>
- </td>
- <td><para style="terp_default_Centre_8">[[ get_target_move(data) ]] </para></td>
- </tr>
- </blockTable>
-
- <para style="P9">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="100.0,125.0,90.0,100.0,100.0" style="Table_Journal_Title" repeatRows="1"><para>[[ display_currency(data)==False or removeParentNode('blockTable') ]]</para>
- <tr>
- <td><para style="terp_tblheader_Details">Code</para></td>
- <td><para style="terp_tblheader_Details">Journal Name</para></td>
- <td><para style="terp_tblheader_Details_Right">Debit</para></td>
- <td><para style="terp_tblheader_Details_Right">Credit</para></td>
- <td><para style="terp_tblheader_Details_Right">Balance</para></td>
- </tr>
- <tr>
- <td><para style="terp_default_Bold_9">Total:</para></td>
- <td><para style="terp_default_Bold_9"><font color="white"> </font></para></td>
- <td><para style="terp_default_Bold_9_Right">[[ formatLang(sum_debit()) ]] </para></td>
- <td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_credit()) ]]</para></td>
- <td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_debit()- sum_credit(), currency_obj=company.currency_id) ]]</para></td>
- </tr>
- </blockTable>
- <blockTable colWidths="100.0,100.0,73.0,80.0,80.0,80.0" style="Table_Journal_Title" repeatRows="1">[[ display_currency(data) or removeParentNode('blockTable') ]]
- <tr>
- <td><para style="terp_tblheader_Details">Code</para></td>
- <td><para style="terp_tblheader_Details">Journal Name</para></td>
- <td><para style="terp_tblheader_Details_Right">Debit</para></td>
- <td><para style="terp_tblheader_Details_Right">Credit</para></td>
- <td><para style="terp_tblheader_Details_Right">Balance</para></td>
- <td><para style="terp_tblheader_Details_Right">Currency</para></td>
- </tr>
- <tr>
- <td><para style="terp_default_Bold_9">Total:</para></td>
- <td><para style="terp_default_Bold_9"><font color="white"> </font></para></td>
- <td><para style="terp_default_Bold_9_Right">[[ formatLang(sum_debit()) ]]</para></td>
- <td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_credit()) ]]</para></td>
- <td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_credit()- sum_debit(), currency_obj=company.currency_id) ]]</para></td>
- </tr>
- </blockTable>
-
- <section>
- <blockTable colWidths="100.0,100.0,73.0,80.0,80.0,80.0" style="Table_Journal_Title">[[ display_currency(data) or removeParentNode('blockTable') ]]
- <tr>
- <td>
- <para style="terp_default_Bold_9">[[ o.name ]] :</para>
- </td>
- <td>
- <para style="terp_default_Bold_9">
- </para>
- </td>
- <td>
- <para style="terp_default_Bold_9_Right">[[ formatLang(sum_debit_period(o.id)) ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_9_Right">[[ formatLang(sum_credit_period(o.id)) ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_9_Right">[[ formatLang(sum_credit_period(o.id)-sum_debit_period(o.id), currency_obj=company.currency_id) ]] </para>
-
- </td>
- <td>
- <para style="terp_default_Bold_9">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="100.0,125.0,90.0,100.0,100.0" style="Table_Journal_Title">[[ display_currency(data)==False or removeParentNode('blockTable') ]]
- <tr>
- <td>
- <para style="terp_default_Bold_9">[[ o.name ]] :</para>
- </td>
- <td>
- <para style="terp_default_Bold_9">
- </para>
- </td>
- <td>
- <para style="terp_default_Bold_9_Right">[[ formatLang(sum_debit_period(o.id)) ]] </para>
- </td>
- <td>
- <para style="terp_default_Bold_9_Right">[[ formatLang(sum_credit_period(o.id)) ]] </para>
- </td>
- <td>
- <para style="terp_default_Bold_9_Right">[[ formatLang(sum_credit_period(o.id)-sum_debit_period(o.id), currency_obj=company.currency_id) ]]</para>
- </td>
- </tr>
- </blockTable>
- <section>
- <para style="Standard">[[ repeatIn(lines(o.id),'line')]]</para>
- <blockTable colWidths="100.0,125.0,90.0,100.0,100.0" style="Table_Journal_Detail">[[ display_currency(data) == False or removeParentNode('blockTable') ]]
- <tr>
- <td>
- <para style="terp_default_9">[[ line['code'] ]]</para>
- </td>
- <td>
- <para style="terp_default_9">[[ line['name'] ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang(line['debit'] )]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang(line['credit']) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang(line['credit']-line['debit'], currency_obj=company.currency_id ) ]]</para>
- </td>
- </tr>
- </blockTable>
- </section>
- <section>
- <para style="Standard">[[ repeatIn(lines(o.id),'line')]]</para>
- <blockTable colWidths="100.0,100.0,73.0,80.0,80.0,80.0" style="Table_Journal_Detail">[[ display_currency(data) or removeParentNode('blockTable') ]]
- <tr>
- <td><para style="terp_default_9">[[ line['code'] ]]</para></td>
- <td><para style="terp_default_9">[[ line['name'] ]]</para></td>
- <td><para style="terp_default_Right_9">[[ formatLang(line['debit'] )]]</para></td>
- <td><para style="terp_default_Right_9">[[ formatLang(line['credit']) ]]</para></td>
- <td><para style="terp_default_Right_9">[[ formatLang(line['credit']-line['debit'], currency_obj=company.currency_id ) ]]</para></td>
- <td><para style="terp_default_Right_9"><font>[[ (line['currency_id']==None or line['amount_currency']==None) and removeParentNode('font') ]] [[ formatLang(line['amount_currency'] ) ]] [[ line['currency_code'] or '' ]]</font></para></td>
- </tr>
- </blockTable>
- </section>
- <para style="terp_default_2">
- <font color="white"> </font>
- </para>
- </section>
- <para style="P9">
- <font color="white"> </font>
- </para>
- </story>
-</document>
diff --git a/addons/account/report/account_general_ledger.py b/addons/account/report/account_general_ledger.py
index 4f712ad58cc..ffccbec300d 100644
--- a/addons/account/report/account_general_ledger.py
+++ b/addons/account/report/account_general_ledger.py
@@ -28,9 +28,11 @@
##############################################################################
import time
+from openerp.osv import osv
from openerp.report import report_sxw
from common_report_header import common_report_header
+
class general_ledger(report_sxw.rml_parse, common_report_header):
_name = 'report.account.general.ledger'
@@ -304,7 +306,11 @@ class general_ledger(report_sxw.rml_parse, common_report_header):
return self._translate('Journal & Partner')
return self._translate('Date')
-report_sxw.report_sxw('report.account.general.ledger', 'account.account', 'addons/account/report/account_general_ledger.rml', parser=general_ledger, header='internal')
-report_sxw.report_sxw('report.account.general.ledger_landscape', 'account.account', 'addons/account/report/account_general_ledger_landscape.rml', parser=general_ledger, header='internal landscape')
+
+class report_generalledger(osv.AbstractModel):
+ _name = 'report.account.report_generalledger'
+ _inherit = 'report.abstract_report'
+ _template = 'account.report_generalledger'
+ _wrapped_report_class = general_ledger
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/report/account_general_ledger.rml b/addons/account/report/account_general_ledger.rml
deleted file mode 100644
index 6897e15078d..00000000000
--- a/addons/account/report/account_general_ledger.rml
+++ /dev/null
@@ -1,619 +0,0 @@
-<?xml version="1.0"?>
-<document filename="General Ledger.pdf">
- <template title="General Ledger" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
- <pageTemplate id="first">
- <frame id="first" x1="28.0" y1="28.0" width="539" height="772"/>
- </pageTemplate>
- </template>
- <stylesheet>
- <blockTableStyle id="Standard_Outline">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table13">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="4,0" stop="4,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="4,0" stop="4,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="5,0" stop="5,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="5,0" stop="5,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="5,0" stop="5,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table1">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="4,0" stop="4,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="4,0" stop="4,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="5,0" stop="5,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="5,0" stop="5,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="5,0" stop="5,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="6,0" stop="6,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="6,0" stop="6,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="7,0" stop="7,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="7,0" stop="7,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="7,0" stop="7,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="7,-1" stop="7,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="8,0" stop="8,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="8,0" stop="8,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="8,-1" stop="8,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="9,0" stop="9,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="9,0" stop="9,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="9,0" stop="9,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="9,-1" stop="9,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="10,0" stop="10,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="10,0" stop="10,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="10,-1" stop="10,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="11,0" stop="11,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="11,0" stop="11,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="11,0" stop="11,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="11,-1" stop="11,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="12,0" stop="12,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="12,0" stop="12,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="12,-1" stop="12,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="13,0" stop="13,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="13,0" stop="13,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="13,0" stop="13,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="13,-1" stop="13,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,1" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,1" stop="0,1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,1" stop="1,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="1,1" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,1" stop="1,1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,2" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,2" stop="0,2"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,2" stop="1,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="1,2" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,2" stop="1,2"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,3" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,3" stop="0,3"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,3" stop="1,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="1,3" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,3" stop="1,3"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,4" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,4" stop="0,4"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,4" stop="1,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="1,4" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,4" stop="1,4"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table2">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table3">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table4">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table5">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table7">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="7,-1" stop="7,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="8,-1" stop="8,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="9,-1" stop="9,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="10,-1" stop="10,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table8">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table9">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="7,-1" stop="7,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="8,-1" stop="8,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="9,-1" stop="9,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="10,-1" stop="10,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table10">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="7,-1" stop="7,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="8,-1" stop="8,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="9,-1" stop="9,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table11">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table6">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="7,-1" stop="7,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="8,-1" stop="8,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="9,-1" stop="9,-1"/>
- </blockTableStyle>
- <initialize>
- <paraStyle name="all" alignment="justify"/>
- </initialize>
- <paraStyle name="Standard" fontName="Helvetica"/>
- <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Table Contents" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Caption" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="Index" fontName="Helvetica"/>
- <paraStyle name="Heading" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Footer" fontName="Helvetica"/>
- <paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
- <paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_8" fontName="Helvetica" fontSize="7.0" leading="9" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="7.0" leading="9" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="7.0" leading="9" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="7.0" leading="9" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_9" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_9_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <images/>
- </stylesheet>
- <story>
- <pto>
- <pto_header>
- <blockTable colWidths="40.0,28.0,82.0,42.0,42.0,71.0,42.0,57.0,57.0,77.0" style="Table10">[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
- <tr>
- <td>
- <para style="terp_tblheader_Details">Date</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">JRNL</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Partner</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Ref</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Move</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Entry Label</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Counterpart</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Debit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Credit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Balance</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="40.0,28.0,48.0,42.0,42.0,48.0,28.0,57.0,57.0,74.0,74.0" style="Table7">[[data['form']['amount_currency'] == True or removeParentNode('blockTable')]]
- <tr>
- <td>
- <para style="terp_tblheader_Details">Date</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">JRNL</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Partner</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Ref</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Move</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Entry Label</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Counterpart</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Debit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Credit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Balance</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Currency</para>
- </td>
- </tr>
- </blockTable>
- </pto_header>
- <para style="terp_default_8">[[ repeatIn(objects, 'a') ]]</para>
- <para style="terp_header_Centre">General Ledger</para>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="102.0,102.0,102.0,130.0,102.0" style="Table13">
- <tr>
- <td>
- <para style="terp_tblheader_General_Centre">Chart of Accounts</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Fiscal Year</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Journals</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Filter By [[ data['form']['filter']!='filter_no' and get_filter(data) ]]</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Target Moves</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="102.0,102.0,102.0,130.0,102.0" style="Table1">
- <tr>
- <td>
- <para style="terp_default_Centre_8">[[ get_account(data) or '' ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ get_fiscalyear(data) or '' ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[', '.join([ lt or '' for lt in get_journal(data) ]) ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ data['form']['filter']=='filter_no' and get_filter(data) or removeParentNode('para') ]]</para>
- <blockTable colWidths="58.0,58.0" style="Table2">[[ data['form']['filter']=='filter_date' or removeParentNode('blockTable') ]]
- <tr>
- <td>
- <para style="terp_tblheader_General_Centre">Start Date</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">End Date</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="58.0,58.0" style="Table3">[[ data['form']['filter']=='filter_date' or removeParentNode('blockTable') ]]
- <tr>
- <td>
- <para style="terp_default_Centre_8">[[ formatLang(get_start_date(data),date=True) ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ formatLang(get_end_date(data),date=True) ]]</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="58.0,58.0" style="Table4">[[ data['form']['filter']=='filter_period' or removeParentNode('blockTable') ]]
- <tr>
- <td>
- <para style="terp_tblheader_General_Centre">Start Period</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">End Period</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="58.0,58.0" style="Table5">[[ data['form']['filter']=='filter_period' or removeParentNode('blockTable') ]]
- <tr>
- <td>
- <para style="terp_default_Centre_8">[[ get_start_period(data) or removeParentNode('para') ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ get_end_period(data) or removeParentNode('para') ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ get_target_move(data) ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="40.0,28.0,48.0,42.0,42.0,48.0,28.0,57.0,57.0,74.0,74.0" style="Table7">[[data['form']['amount_currency'] == True or removeParentNode('blockTable')]]
- <tr>
- <td>
- <para style="terp_tblheader_Details">Date</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">JRNL</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Partner</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Ref</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Move</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Entry Label</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Counterpart</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Debit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Credit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Balance</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Currency</para>
- </td>
- </tr>
- </blockTable>
- <section>
- <para style="terp_default_8">[[ repeatIn(get_children_accounts(a), 'o') ]]</para>
- <blockTable rowHeights="0.55cm" colWidths="278.0,57.0,57.0,74.0,74.0" style="Table8">[[data['form']['amount_currency'] == True or removeParentNode('blockTable')]]
- <tr>
- <td>
- <para style="terp_default_Bold_9"><font color="white">[[ '..'*(o.level-1) ]]</font>[[ o.code ]] [[ o.name ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_9_Right">[[ formatLang(sum_debit_account(o), digits=get_digits(dp='Account')) ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_9_Right">[[ formatLang(sum_credit_account(o), digits=get_digits(dp='Account')) ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_9_Right">[[ formatLang(sum_balance_account(o), digits=get_digits(dp='Account'),currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_9_Right">[[ o.currency_id and formatLang(sum_currency_amount_account(o), digits=get_digits(dp='Account'),currency_obj=o.currency_id) or '' ]]</para>
- </td>
- </tr>
- </blockTable>
- <section>
- <para style="terp_default_8">[[ repeatIn(lines(o), 'line') ]]</para>
- <blockTable rowHeights="0.55cm" colWidths="40.0,28.0,48.0,42.0,42.0,48.0,28.0,57.0,57.0,74.0,74.0" style="Table9">[[data['form']['amount_currency'] == True or removeParentNode('blockTable')]]
- <tr>
- <td>
- <para style="terp_default_8">[[ formatLang(line['ldate'],date=True) ]]</para>
- </td>
- <td>
- <para style="terp_default_8">[[ line['lcode'] ]]</para>
- </td>
- <td>
- <para style="terp_default_8">[[ strip_name(line['partner_name'],10) ]]</para>
- </td>
- <td>
- <para style="terp_default_8">[[ line['lref'] and strip_name(line['lref'],9) ]]</para>
- </td>
- <td>
- <para style="terp_default_8">[[ strip_name(line['move'],9) ]]</para>
- </td>
- <td>
- <para style="terp_default_8">[[ strip_name(line['lname'],10) ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ strip_name(line['line_corresp'].replace(', ',','),10) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_8">[[ formatLang(line['debit'], digits=get_digits(dp='Account')) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_8">[[ formatLang(line['credit'], digits=get_digits(dp='Account')) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_8">[[ formatLang(line['progress'], digits=get_digits(dp='Account'),currency_obj=company.currency_id) ]] </para>
- </td>
- <td>
- <para style="terp_default_Right_8"><font>[[ (line.has_key('currency_id') and line['currency_id']==None or line['amount_currency']==None) and removeParentNode('font') ]] [[ formatLang(line['amount_currency'])]] [[ line['currency_code'] or '']]</font></para>
- </td>
- </tr>
- </blockTable>
- </section>
- </section>
- <blockTable colWidths="40.0,28.0,82.0,42.0,42.0,71.0,42.0,57.0,57.0,77.0" style="Table10">[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
- <tr>
- <td>
- <para style="terp_tblheader_Details">Date</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">JRNL</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Partner</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Ref</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Move</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Entry Label</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Counterpart</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Debit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Credit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Balance</para>
- </td>
- </tr>
- </blockTable>
- <section>
- <para style="terp_default_8">[[ repeatIn(get_children_accounts(a), 'o') ]]</para>
- <blockTable rowHeights="0.55cm" colWidths="349.0,57.0,57.0,77.0" style="Table11">[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
- <tr>
- <td>
- <para style="terp_default_Bold_9"><font color="white">[[ '..'*(o.level-1) ]]</font>[[ o.code ]] [[ o.name ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_9_Right">[[ formatLang(sum_debit_account(o), digits=get_digits(dp='Account')) ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_9_Right">[[ formatLang(sum_credit_account(o), digits=get_digits(dp='Account')) ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_9_Right">[[ formatLang(sum_balance_account(o), digits=get_digits(dp='Account'),currency_obj=company.currency_id) ]]</para>
- </td>
- </tr>
- </blockTable>
- <section>
- <para style="terp_default_8">[[ repeatIn(lines(o), 'line') ]]</para>
- <blockTable rowHeights="0.55cm" colWidths="40.0,28.0,82.0,42.0,42.0,71.0,42.0,57.0,57.0,77.0" style="Table6">[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
- <tr>
- <td>
- <para style="terp_default_8">[[ formatLang(line['ldate'],date=True) ]]</para>
- </td>
- <td>
- <para style="terp_default_8">[[ line['lcode'] ]]</para>
- </td>
- <td>
- <para style="terp_default_8">[[ strip_name(line['partner_name'],20) ]]</para>
- </td>
- <td>
- <para style="terp_default_8">[[ line['lref'] and strip_name(line['lref'],9) ]]</para>
- </td>
- <td>
- <para style="terp_default_8">[[ strip_name(line['move'],9) ]]</para>
- </td>
- <td>
- <para style="terp_default_8">[[ strip_name(line['lname'],18) ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ strip_name(line['line_corresp'].replace(', ',','),20) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_8">[[ formatLang(line['debit'], digits=get_digits(dp='Account')) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_8">[[ formatLang(line['credit'], digits=get_digits(dp='Account')) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_8">[[ formatLang(line['progress'], digits=get_digits(dp='Account'),currency_obj=company.currency_id) ]]</para>
- </td>
- </tr>
- </blockTable>
- </section>
- </section>
- </pto>
- </story>
-</document>
diff --git a/addons/account/report/account_general_ledger_landscape.rml b/addons/account/report/account_general_ledger_landscape.rml
deleted file mode 100644
index c5d24343148..00000000000
--- a/addons/account/report/account_general_ledger_landscape.rml
+++ /dev/null
@@ -1,658 +0,0 @@
-<?xml version="1.0"?>
-<document filename="General Ledger.pdf">
- <template pageSize="(842.0,595.0)" title="General Ledger" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
- <pageTemplate id="first">
- <frame id="first" x1="28.0" y1="28.0" width="786" height="525"/>
- </pageTemplate>
- </template>
- <stylesheet>
- <blockTableStyle id="Standard_Outline">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table1">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="4,0" stop="4,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="4,0" stop="4,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="5,0" stop="5,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="5,0" stop="5,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="6,0" stop="6,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="6,0" stop="6,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="6,0" stop="6,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="6,-1" stop="6,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table2">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="4,0" stop="4,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="4,0" stop="4,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="5,0" stop="5,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="5,0" stop="5,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="6,0" stop="6,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="6,0" stop="6,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="6,0" stop="6,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="7,0" stop="7,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="7,0" stop="7,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="7,-1" stop="7,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="8,0" stop="8,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="8,0" stop="8,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="8,0" stop="8,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="8,-1" stop="8,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="9,0" stop="9,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="9,0" stop="9,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="9,-1" stop="9,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="10,0" stop="10,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="10,0" stop="10,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="10,0" stop="10,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="10,-1" stop="10,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="11,0" stop="11,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="11,0" stop="11,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="11,-1" stop="11,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="12,0" stop="12,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="12,0" stop="12,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="12,0" stop="12,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="12,-1" stop="12,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="13,0" stop="13,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="13,0" stop="13,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="13,-1" stop="13,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="14,0" stop="14,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="14,0" stop="14,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="14,0" stop="14,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="14,-1" stop="14,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,1" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,1" stop="0,1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,1" stop="1,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="1,1" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,1" stop="1,1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,2" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,2" stop="0,2"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,2" stop="1,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="1,2" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,2" stop="1,2"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,3" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,3" stop="0,3"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,3" stop="1,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="1,3" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,3" stop="1,3"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,4" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,4" stop="0,4"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,4" stop="1,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="1,4" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,4" stop="1,4"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table3">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table4">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table5">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table6">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table7">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="7,-1" stop="7,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="8,-1" stop="8,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="9,-1" stop="9,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="10,-1" stop="10,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="11,-1" stop="11,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table8">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table9">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="7,-1" stop="7,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="8,-1" stop="8,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="9,-1" stop="9,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="10,-1" stop="10,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="11,-1" stop="11,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table10">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="7,-1" stop="7,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="8,-1" stop="8,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="9,-1" stop="9,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="10,-1" stop="10,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table11">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table12">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="7,-1" stop="7,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="8,-1" stop="8,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="9,-1" stop="9,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="10,-1" stop="10,-1"/>
- </blockTableStyle>
- <initialize>
- <paraStyle name="all" alignment="justify"/>
- </initialize>
- <paraStyle name="Standard" fontName="Helvetica"/>
- <paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Caption" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="Index" fontName="Helvetica"/>
- <paraStyle name="Table Contents" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Footer" fontName="Helvetica"/>
- <paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
- <paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_7" fontName="Helvetica" fontSize="7.0" leading="9" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_7" fontName="Helvetica-Bold" fontSize="7.0" leading="9" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_Right_7" fontName="Helvetica" fontSize="7.0" leading="9" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_7" fontName="Helvetica" fontSize="7.0" leading="9" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_7" fontName="Helvetica-Bold" fontSize="7.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_7_Right" fontName="Helvetica-Bold" fontSize="7.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="Heading 3" fontName="Helvetica-Bold" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
- <images/>
- </stylesheet>
- <story>
- <pto>
- <pto_header>
- <blockTable colWidths="45.0,35.0,30.0,90.0,65.0,55.0,100.0,70.0,65.0,65.0,75.0,75.0" style="Table7">[[data['form']['amount_currency'] == True or removeParentNode('blockTable')]]
- <tr>
- <td>
- <para style="terp_tblheader_Details">Date</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Period</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">JRNL</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Partner</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Ref</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Move</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Entry Label</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Counterpart</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Debit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Credit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Balance</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Currency</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="45.0,35.0,30.0,105.0,80.0,55.0,130.0,95.0,65.0,65.0,75.0" style="Table10">[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
- <tr>
- <td>
- <para style="terp_tblheader_Details">Date</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Period</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">JRNL</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Partner</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Ref</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Move</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Entry Label</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Counterpart</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Debit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Credit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Balance</para>
- </td>
- </tr>
- </blockTable>
- </pto_header>
- <para style="terp_default_7">[[ repeatIn(objects, 'a') ]]</para>
- <para style="terp_header_Centre">General Ledger</para>
- <para style="terp_default_7">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="110.0,110.0,110.0,110.0,128.0,93.0,110.0" style="Table1">
- <tr>
- <td>
- <para style="terp_tblheader_General_Centre">Company[[ data['model']=='account.account' and ' ' or removeParentNode('para') ]]</para>
- <para style="terp_tblheader_General_Centre">Chart of Accounts[[ data['model']=='ir.ui.menu' and ' ' or removeParentNode('para') ]]</para></td>
- <td>
- <para style="terp_tblheader_General_Centre">Fiscal Year</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Journals</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Display Account</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Filter By [[ data['form']['filter']!='filter_no' and get_filter(data) ]]</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Entries Sorted By</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Target Moves</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="110.0,110.0,110.0,110.0,128.0,93.0,110.0" style="Table2">
- <tr>
- <td>
- <para style="terp_default_Centre_7">[[ get_account(data) or removeParentNode('para') ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_7">[[ get_fiscalyear(data) or '' ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_7">[[', '.join([ lt or '' for lt in get_journal(data) ]) ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_7">All[[ data['form']['display_account']=='all' and ' ' or removeParentNode('para') ]]</para>
- <para style="terp_default_Centre_7">With movements[[ data['form']['display_account']=='movement' and ' ' or removeParentNode('para') ]]</para>
- <para style="terp_default_Centre_7">With balance is not equal to 0[[ data['form']['display_account']=='not_zero' and ' ' or removeParentNode('para') ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_7">[[ data['form']['filter']=='filter_no' and get_filter(data) or removeParentNode('para') ]]</para>
- <blockTable colWidths="58.0,58.0" style="Table3">[[ data['form']['filter']=='filter_date' or removeParentNode('blockTable') ]]
- <tr>
- <td>
- <para style="terp_tblheader_General_Centre">Start Date</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">End Date</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="58.0,58.0" style="Table4">[[ data['form']['filter']=='filter_date' or removeParentNode('blockTable') ]]
- <tr>
- <td>
- <para style="terp_default_Centre_7">[[ formatLang(get_start_date(data),date=True) ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_7">[[ formatLang(get_end_date(data),date=True) ]]</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="58.0,58.0" style="Table5">[[ data['form']['filter']=='filter_period' or removeParentNode('blockTable') ]]
- <tr>
- <td>
- <para style="terp_tblheader_General_Centre">Start Period</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">End Period</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="58.0,58.0" style="Table6">[[ data['form']['filter']=='filter_period' or removeParentNode('blockTable') ]]
- <tr>
- <td>
- <para style="terp_default_Centre_7">[[ get_start_period(data) or removeParentNode('para') ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_7">[[ get_end_period(data) or removeParentNode('para') ]]</para>
- </td>
- </tr>
- </blockTable>
- </td>
- <td>
- <para style="terp_default_Centre_7">[[ get_sortby(data) ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_7">[[ get_target_move(data) ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_7">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="45.0,35.0,30.0,90.0,65.0,55.0,100.0,70.0,65.0,65.0,75.0,75.0" style="Table7">[[data['form']['amount_currency'] == True or removeParentNode('blockTable')]]
- <tr>
- <td>
- <para style="terp_tblheader_Details">Date</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Period</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">JRNL</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Partner</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Ref</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Move</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Entry Label</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Counterpart</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Debit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Credit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Balance</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Currency</para>
- </td>
- </tr>
- </blockTable>
- <section>
- <para style="terp_default_7">[[ repeatIn(get_children_accounts(a), 'o') ]]</para>
- <blockTable rowHeights="0.55cm" colWidths="490.0,65.0,65.0,75.0,75.0" style="Table8">[[data['form']['amount_currency'] == True or removeParentNode('blockTable')]]
- <tr>
- <td>
- <para style="terp_default_Bold_7"><font color="white">[[ '..'*(o.level-1) ]]</font>[[ o.code ]] [[ o.name ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_7_Right">[[ formatLang(sum_debit_account(o), digits=get_digits(dp='Account')) ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_7_Right">[[ formatLang(sum_credit_account(o), digits=get_digits(dp='Account')) ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_7_Right">[[ formatLang(sum_balance_account(o), digits=get_digits(dp='Account'), currency_obj= company.currency_id) ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_7_Right">[[ o.currency_id and formatLang(sum_currency_amount_account(o), digits=get_digits(dp='Account'),currency_obj=o.currency_id) or '' ]]</para>
- </td>
- </tr>
- </blockTable>
- <section>
- <para style="terp_default_7">[[ repeatIn(lines(o), 'line') ]]</para>
- <blockTable rowHeights="0.55cm" colWidths="45.0,35.0,30.0,90.0,65.0,55.0,100.0,70.0,65.0,65.0,75.0,75.0" style="Table9">[[data['form']['amount_currency'] == True or removeParentNode('blockTable')]]
- <tr>
- <td>
- <para style="terp_default_7">[[ formatLang(line['ldate'],date=True) ]]</para>
- </td>
- <td>
- <para style="terp_default_7">[[ line['period_code'] ]]</para>
- </td>
- <td>
- <para style="terp_default_7">[[ line['lcode'] ]]</para>
- </td>
- <td>
- <para style="terp_default_7">[[ strip_name(line['partner_name'],20) ]]</para>
- </td>
- <td>
- <para style="terp_default_7">[[ line['lref'] and strip_name(line['lref'],17) ]]</para>
- </td>
- <td>
- <para style="terp_default_7">[[ line['move'] ]]</para>
- </td>
- <td>
- <para style="terp_default_7">[[ strip_name(line['lname'],22) ]]</para>
- </td>
- <td>
- <para style="terp_default_7">[[ strip_name(line['line_corresp'],18) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_7">[[ formatLang(line['debit'], digits=get_digits(dp='Account')) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_7">[[ formatLang(line['credit'], digits=get_digits(dp='Account')) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_7">[[ formatLang(line['progress'], digits=get_digits(dp='Account'), currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_7">[[ (line.has_key('currency_id') and line['currency_id']==None or line['amount_currency']==None) and removeParentNode('font') ]] [[ formatLang(line['amount_currency'])]] [[ line['currency_code'] or '']]</para>
- </td>
- </tr>
- </blockTable>
- </section>
- </section>
- <blockTable colWidths="45.0,35.0,30.0,105.0,80.0,55.0,130.0,95.0,65.0,65.0,75.0" style="Table10">[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
- <tr>
- <td>
- <para style="terp_tblheader_Details">Date</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Period</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">JRNL</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Partner</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Ref</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Move</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Entry Label</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Counterpart</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Debit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Credit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Balance</para>
- </td>
- </tr>
- </blockTable>
- <section>
- <para style="Standard">[[ repeatIn(get_children_accounts(a), 'o') ]]</para>
- <blockTable rowHeights="0.55cm" colWidths="575.0,65.0,65.0,75.0" style="Table11">[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
- <tr>
- <td>
- <para style="terp_default_Bold_7"><font color="white">[[ '..'*(o.level-1) ]]</font>[[ o.code ]] [[ o.name ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_7_Right">[[ formatLang(sum_debit_account(o), digits=get_digits(dp='Account')) ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_7_Right">[[ formatLang(sum_credit_account(o), digits=get_digits(dp='Account')) ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_7_Right">[[ formatLang(sum_balance_account(o), digits=get_digits(dp='Account'), currency_obj=company.currency_id) ]]</para>
- </td>
- </tr>
- </blockTable>
- <section>
- <para style="Standard">[[ repeatIn(lines(o), 'line') ]]</para>
- <blockTable rowHeights="0.55cm" colWidths="45.0,35.0,30.0,105.0,80.0,55.0,130.0,95.0,65.0,65.0,75.0" style="Table12">[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
- <tr>
- <td>
- <para style="terp_default_7">[[ formatLang(line['ldate'],date=True) ]]</para>
- </td>
- <td>
- <para style="terp_default_7">[[ line['period_code'] ]]</para>
- </td>
- <td>
- <para style="terp_default_7">[[ line['lcode'] ]]</para>
- </td>
- <td>
- <para style="terp_default_7">[[ strip_name(line['partner_name'],24) ]]</para>
- </td>
- <td>
- <para style="terp_default_7">[[ strip_name(line['lref'],21) ]]</para>
- </td>
- <td>
- <para style="terp_default_7">[[ line['move'] ]]</para>
- </td>
- <td>
- <para style="terp_default_7">[[ strip_name(line['lname'],28) ]]</para>
- </td>
- <td>
- <para style="terp_default_7">[[ strip_name(line['line_corresp'],23) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_7">[[ formatLang(line['debit'], digits=get_digits(dp='Account')) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_7">[[ formatLang(line['credit'], digits=get_digits(dp='Account')) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_7">[[ formatLang(line['progress'], digits=get_digits(dp='Account'),currency_obj=company.currency_id) ]] </para>
- </td>
- </tr>
- </blockTable>
- </section>
- </section>
- </pto>
- </story>
-</document>
diff --git a/addons/account/report/account_journal.py b/addons/account/report/account_journal.py
index 97e19be4b0c..13dfd538f4a 100644
--- a/addons/account/report/account_journal.py
+++ b/addons/account/report/account_journal.py
@@ -20,8 +20,10 @@
##############################################################################
import time
-from common_report_header import common_report_header
+from openerp.osv import osv
from openerp.report import report_sxw
+from common_report_header import common_report_header
+
class journal_print(report_sxw.rml_parse, common_report_header):
@@ -196,7 +198,18 @@ class journal_print(report_sxw.rml_parse, common_report_header):
return self._translate('Reference Number')
return self._translate('Date')
-report_sxw.report_sxw('report.account.journal.period.print', 'account.journal.period', 'addons/account/report/account_journal.rml', parser=journal_print, header='external')
-report_sxw.report_sxw('report.account.journal.period.print.sale.purchase', 'account.journal.period', 'addons/account/report/account_journal_sale_purchase.rml', parser=journal_print, header='external')
+
+class report_journal(osv.AbstractModel):
+ _name = 'report.account.report_journal'
+ _inherit = 'report.abstract_report'
+ _template = 'account.report_journal'
+ _wrapped_report_class = journal_print
+
+
+class report_salepurchasejournal(osv.AbstractModel):
+ _name = 'report.account.report_salepurchasejournal'
+ _inherit = 'report.abstract_report'
+ _template = 'account.report_salepurchasejournal'
+ _wrapped_report_class = journal_print
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/report/account_journal.rml b/addons/account/report/account_journal.rml
deleted file mode 100644
index 6d606ed1937..00000000000
--- a/addons/account/report/account_journal.rml
+++ /dev/null
@@ -1,311 +0,0 @@
-<?xml version="1.0"?>
-<document filename="Journal.pdf">
- <template title="Journal" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
- <pageTemplate id="first">
- <frame id="first" x1="57.0" y1="57.0" width="481" height="728"/>
- </pageTemplate>
- </template>
- <stylesheet>
- <blockTableStyle id="Table_Print_Current_datetime">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Standard_Outline">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table1">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,2" stop="-1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table2">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,0" stop="-1,0"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="4,0" stop="4,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="4,0" stop="4,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="5,0" stop="5,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="5,0" stop="5,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="6,0" stop="6,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="6,0" stop="6,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="6,0" stop="6,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="7,0" stop="7,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="7,0" stop="7,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="7,0" stop="7,0"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Sub_Header_Content">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="4,0" stop="4,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="4,0" stop="4,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="5,0" stop="5,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="5,0" stop="5,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="6,0" stop="6,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="6,0" stop="6,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="6,0" stop="6,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="7,0" stop="7,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="7,0" stop="7,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="7,0" stop="7,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="7,-1" stop="7,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Subheader_Content_detail">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="4,0" stop="4,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="4,0" stop="4,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="5,0" stop="5,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="5,0" stop="5,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="6,0" stop="6,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="6,0" stop="6,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="6,0" stop="6,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="7,0" stop="7,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="7,0" stop="7,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="7,0" stop="7,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="7,-1" stop="7,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table_no_lines">
- </blockTableStyle>
- <blockTableStyle id="Table4NewMove">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
- </blockTableStyle>
- <blockTableStyle id="Table4Total">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="5,0" stop="8,0"/>
- </blockTableStyle>
- <initialize>
- <paraStyle name="all" alignment="justify"/>
- </initialize>
- <paraStyle name="P8" fontName="Helvetica" fontSize="7.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P9" fontName="Helvetica" fontSize="7.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P10" fontName="Helvetica-Bold" fontSize="8.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P10a" fontName="Helvetica-Bold" fontSize="7.5" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P10b" fontName="Helvetica-Bold" fontSize="8.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P11" fontName="Helvetica-Bold" fontSize="8.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P11a" fontName="Helvetica-Bold" fontSize="8.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P12" fontName="Helvetica-Bold" fontSize="7.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="Standard" fontName="Times-Roman"/>
- <paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="List" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Table Contents" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Caption" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="Index" fontName="Times-Roman"/>
- <paraStyle name="Heading" fontName="Helvetica" fontSize="7.0" leading="10" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_8" fontName="Helvetica" fontSize="7.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="7.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="7.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="7.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="7.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="Footer" fontName="Times-Roman"/>
- <paraStyle name="Horizontal Line" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
- <paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="7.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="7.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="7.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_1" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_9_Bold" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_8_Italic" fontName="Helvetica-Oblique" fontSize="7.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="7.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_Details_left" fontName="Helvetica-Bold" fontSize="7.0" leading="8" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- </stylesheet>
- <images/>
- <story>
- <para style="Table Contents">[[ repeatIn(objects, 'o') ]]</para>
-
- <blockTable colWidths="539.0" style="Table_no_lines">
- <tr>
- <td><para style="terp_header_Centre">Journal</para></td>
- </tr>
- </blockTable>
- <para style="P9">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="85.0,80.0,80.0,120.0,70.0,100.0" style="Table2">
- <tr>
- <td><para style="terp_tblheader_General_Centre">Company[[ data['model']=='account.journal.period'and ' ' or removeParentNode('para') ]]</para>
- <para style="terp_tblheader_General_Centre">Chart of Accounts[[ data['model']=='ir.ui.menu' and ' ' or removeParentNode('para') ]]</para></td>
- <td><para style="terp_tblheader_General_Centre">Fiscal Year</para></td>
- <td><para style="terp_tblheader_General_Centre">Journal</para></td>
- <td><para style="terp_tblheader_General_Centre">Period</para></td>
- <td><para style="terp_tblheader_General_Centre">Entries Sorted By</para></td>
- <td><para style="terp_tblheader_General_Centre">Target Moves</para></td>
- </tr>
- <tr>
- <td><para style="terp_default_Centre_8">[[ get_account(data) or '' ]]</para></td>
- <td><para style="terp_default_Centre_8">[[ get_fiscalyear(data) or '' ]]</para></td>
- <td><para style="terp_default_Centre_8">[[ o.journal_id.name ]]</para></td>
- <td><para style="terp_default_Centre_8">[[ o.period_id.name ]] </para></td>
- <td>
- <para style="terp_default_Centre_8">Date[[ data['form'].get('sort_selection', 'date') == 'date' and ' ' or removeParentNode('para') ]]</para>
- <para style="terp_default_Centre_8">Reference Number[[ data['form'].get('sort_selection', 'date') == 'ref' and ' ' or removeParentNode('para') ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="P9">
- <font color="white"> </font>
- </para>
- <para style="P9">
- <font color="white"> </font>
- </para>
- <para style="Standard"><font color="white">[[ set_last_move_id(False)]]</font></para>
- <section>
- [[ display_currency(data) == False or removeParentNode('section') ]]
- <blockTable rowHeights="0.55cm" colWidths="55.0,45.0,50.0,95.0,160.0,70.0,70.0" style="Table1">
- <tr>
- <td><para style="P10a">Move</para></td>
- <td><para style="P10a">Date</para></td>
- <td><para style="P10a">Account</para></td>
- <td><para style="P10a">Partner</para></td>
- <td><para style="P10a">Label</para></td>
- <td><para style="P10b">Debit</para></td>
- <td><para style="P10b">Credit</para></td>
- </tr>
- </blockTable>
- <section>
- <para style="terp_default_8">[[ repeatIn(lines(o.period_id.id, o.journal_id.id), 'line') ]]</para>
- <blockTable colWidths="545.0" style="Table4NewMove">
- <tr>
- <td><para style="P8">[[ not check_last_move_id(line.move_id.id) and removeParentNode('blockTable') ]]</para></td>
- </tr>
- </blockTable>
- <blockTable rowHeights="0.55cm" colWidths="55.0,45.0,50.0,95.0,160.0,70.0,70.0" style="Table_no_lines">
- <tr>
- <td><para style="terp_default_8">[[ line.move_id.name &lt;&gt; '/' and line.move_id.name or ('*'+str(line.move_id.id)) ]]</para></td>
- <td><para style="terp_default_8">[[ formatLang(line.date,date=True) ]]</para></td>
- <td><para style="terp_default_8">[[ line.account_id.code ]]</para></td>
- <td><para style="terp_default_8">[[ line.partner_id and strip_name(line.partner_id.name,23) ]]</para></td>
- <td><para style="terp_default_8">[[ strip_name(line.name,35) ]]</para></td>
- <td><para style="P8">[[ formatLang(line.debit, currency_obj=company.currency_id) ]]</para></td>
- <td><para style="P8">[[ formatLang(line.credit, currency_obj=company.currency_id) ]]</para></td>
- </tr>
- </blockTable>
- <para style="terp_default_8">[[ set_last_move_id(line.move_id.id) ]]</para>
- </section>
- <blockTable rowHeights="0.55cm" colWidths="55.0,45.0,50.0,95.0,160.0,70.0,70.0" style="Table4Total">
- <tr>
- <td><para style="P11"></para></td>
- <td><para style="P11"></para></td>
- <td><para style="P11"></para></td>
- <td><para style="P11"><font color="white"></font></para></td>
- <td><para style="P12">Total:</para></td>
- <td><para style="P12">[[ formatLang(sum_debit(o.period_id.id, o.journal_id.id), currency_obj=company.currency_id) ]]</para></td>
- <td><para style="P12">[[ formatLang(sum_credit(o.period_id.id, o.journal_id.id), currency_obj=company.currency_id) ]]</para></td>
- </tr>
- </blockTable>
- </section>
-
- <section>
- [[ display_currency(data) or removeParentNode('section') ]]
- <blockTable rowHeights="0.55cm" colWidths="55.0,45.0,50.0,70.0,130.0,70.0,70.0,70.0" style="Table1">
- <tr>
- <td><para style="P10a">Move</para></td>
- <td><para style="P10a">Date</para></td>
- <td><para style="P10a">Account</para></td>
- <td><para style="P10a">Partner</para></td>
- <td><para style="P10a">Label</para></td>
- <td><para style="P10b">Debit</para></td>
- <td><para style="P10b">Credit</para></td>
- <td><para style="P10b">Currency</para></td>
- </tr>
- </blockTable>
- <section>
- <para style="terp_default_8">[[ repeatIn(lines(o.period_id.id, o.journal_id.id), 'line') ]]</para>
- <blockTable colWidths="545.0" style="Table4NewMove">
- <tr>
- <td><para style="P8">[[ not check_last_move_id(line.move_id.id) and removeParentNode('blockTable') ]]</para></td>
- </tr>
- </blockTable>
- <blockTable rowHeights="0.55cm" colWidths="55.0,45.0,50.0,70.0,130.0,70.0,70.0,70.0" style="Table_no_lines">
- <tr>
- <td><para style="terp_default_8">[[ line.move_id.name &lt;&gt; '/' and line.move_id.name or ('*'+str(line.move_id.id)) ]]</para></td>
- <td><para style="terp_default_8">[[ formatLang(line.date,date=True) ]]</para></td>
- <td><para style="terp_default_8">[[ line.account_id.code ]]</para></td>
- <td><para style="terp_default_8">[[ line.partner_id and strip_name(line.partner_id.name,17) ]]</para></td>
- <td><para style="terp_default_8">[[ strip_name(line.name,28) ]]</para></td>
- <td><para style="P8">[[ formatLang(line.debit, currency_obj=company.currency_id) ]]</para></td>
- <td><para style="P8">[[ formatLang(line.credit, currency_obj=company.currency_id) ]]</para></td>
- <td><para style="P8">[[ line.currency_id and formatLang(line.amount_currency, currency_obj=line.currency_id) or '' ]]</para></td>
- </tr>
- </blockTable>
- <para style="terp_default_8">[[ set_last_move_id(line.move_id.id) ]]</para>
- </section>
- <blockTable rowHeights="0.55cm" colWidths="55.0,45.0,50.0,70.0,130.0,70.0,70.0,70.0" style="Table4Total">
- <tr>
- <td><para style="P11"></para></td>
- <td><para style="P11"></para></td>
- <td><para style="P11"></para></td>
- <td><para style="P11"><font color="white"></font></para></td>
- <td><para style="P12">Total:</para></td>
- <td><para style="P12">[[ formatLang(sum_debit(o.period_id.id, o.journal_id.id), currency_obj=company.currency_id) ]]</para></td>
- <td><para style="P12">[[ formatLang(sum_credit(o.period_id.id, o.journal_id.id), currency_obj=company.currency_id) ]]</para></td>
- <!-- given a period and a journal, the sum of debit will always be equal to the sum of credit, so there is no point to display it-->
- <td><para style="P12"> <!--o.journal_id.currency and formatLang((sum_debit(o.period_id.id, o.journal_id.id) - sum_credit(o.period_id.id, o.journal_id.id))) ]] [[ o.journal_id.currency and o.journal_id.currency.symbol --></para></td>
- </tr>
- </blockTable>
- </section>
- </story>
-</document>
diff --git a/addons/account/report/account_journal_sale_purchase.rml b/addons/account/report/account_journal_sale_purchase.rml
deleted file mode 100644
index 3ee0b484c9a..00000000000
--- a/addons/account/report/account_journal_sale_purchase.rml
+++ /dev/null
@@ -1,346 +0,0 @@
-<?xml version="1.0"?>
-<document filename="Journal.pdf">
- <template title="Journal" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
- <pageTemplate id="first">
- <frame id="first" x1="57.0" y1="57.0" width="481" height="728"/>
- </pageTemplate>
- </template>
- <stylesheet>
- <blockTableStyle id="Table_Print_Current_datetime">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Standard_Outline">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table1">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,2" stop="-1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table2">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,0" stop="-1,0"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="4,0" stop="4,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="4,0" stop="4,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="5,0" stop="5,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="5,0" stop="5,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="6,0" stop="6,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="6,0" stop="6,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="6,0" stop="6,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="7,0" stop="7,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="7,0" stop="7,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="7,0" stop="7,0"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Sub_Header_Content">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="4,0" stop="4,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="4,0" stop="4,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="5,0" stop="5,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="5,0" stop="5,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="6,0" stop="6,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="6,0" stop="6,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="6,0" stop="6,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="7,0" stop="7,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="7,0" stop="7,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="7,0" stop="7,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="7,-1" stop="7,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Subheader_Content_detail">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="4,0" stop="4,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="4,0" stop="4,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="5,0" stop="5,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="5,0" stop="5,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="6,0" stop="6,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="6,0" stop="6,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="6,0" stop="6,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="7,0" stop="7,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="7,0" stop="7,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="7,0" stop="7,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="7,-1" stop="7,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table_no_lines">
- </blockTableStyle>
- <blockTableStyle id="Table4NewMove">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
- </blockTableStyle>
- <blockTableStyle id="Table4Total">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="6,0" stop="12,0"/>
- </blockTableStyle>
- <initialize>
- <paraStyle name="all" alignment="justify"/>
- </initialize>
- <paraStyle name="P8" fontName="Helvetica" fontSize="7.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P9" fontName="Helvetica" fontSize="7.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P10" fontName="Helvetica-Bold" fontSize="8.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P10a" fontName="Helvetica-Bold" fontSize="7.5" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P10b" fontName="Helvetica-Bold" fontSize="8.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P11" fontName="Helvetica-Bold" fontSize="8.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P11a" fontName="Helvetica-Bold" fontSize="8.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P12" fontName="Helvetica-Bold" fontSize="7.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="Standard" fontName="Times-Roman"/>
- <paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="List" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Table Contents" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Caption" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="Index" fontName="Times-Roman"/>
- <paraStyle name="Heading" fontName="Helvetica" fontSize="7.0" leading="10" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_8" fontName="Helvetica" fontSize="7.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="7.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="7.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="7.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="7.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="Footer" fontName="Times-Roman"/>
- <paraStyle name="Horizontal Line" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
- <paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="7.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="7.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="7.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_1" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_9_Bold" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_8_Italic" fontName="Helvetica-Oblique" fontSize="7.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="7.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_Details_left" fontName="Helvetica-Bold" fontSize="7.0" leading="8" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- </stylesheet>
- <images/>
- <story>
- <para style="Table Contents">[[ repeatIn(objects, 'o') ]]</para>
-
- <blockTable colWidths="539.0" style="Table_no_lines">
- <tr>
- <td><para style="terp_header_Centre">Journal</para></td>
- </tr>
- </blockTable>
- <para style="P9">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="85.0,80.0,80.0,120.0,70.0,100.0" style="Table2">
- <tr>
- <td><para style="terp_tblheader_General_Centre"> [[ data['model']=='account.journal.period'and 'Company' or removeParentNode('para') ]]</para>
- <para style="terp_tblheader_General_Centre">[[ data['model']=='ir.ui.menu' and 'Chart of Accounts' or removeParentNode('para') ]]</para></td>
- <td><para style="terp_tblheader_General_Centre">Fiscal Year</para></td>
- <td><para style="terp_tblheader_General_Centre">Journal</para></td>
- <td><para style="terp_tblheader_General_Centre">Period</para></td>
- <td><para style="terp_tblheader_General_Centre">Entries Sorted By</para></td>
- <td><para style="terp_tblheader_General_Centre">Target Moves</para></td>
- </tr>
- <tr>
- <td><para style="terp_default_Centre_8">[[ get_account(data) or '' ]]</para></td>
- <td><para style="terp_default_Centre_8">[[ get_fiscalyear(data) or '' ]]</para></td>
- <td><para style="terp_default_Centre_8">[[ o.journal_id.name ]]</para></td>
- <td><para style="terp_default_Centre_8">[[ o.period_id.name ]] </para></td>
- <td><para style="terp_default_Centre_8">[[ get_sortby(data) ]]</para></td>
- <td><para style="terp_default_Centre_8">[[ get_target_move(data) ]] </para></td>
- </tr>
- </blockTable>
- <para style="P9">
- <font color="white"> </font>
- </para>
- <para style="P9">
- <font color="white"> </font>
- </para>
- <para style="Standard"><font color="white">[[ set_last_move_id(False) ]]</font></para>
- <section>
- [[ display_currency(data) == False or removeParentNode('section') ]]
- <blockTable rowHeights="0.55cm" colWidths="55.0,45.0,50.0,60.0,110.0,15.0,70.0,70.0,70.0" style="Table1">
- <tr>
- <td><para style="P10a">Move</para></td>
- <td><para style="P10a">Date</para></td>
- <td><para style="P10a">Account</para></td>
- <td><para style="P10a">Partner</para></td>
- <td><para style="P10a">Label</para></td>
- <td><para style="P10a">Tax</para></td>
- <td><para style="P11"></para></td>
- <td><para style="P10b">Debit</para></td>
- <td><para style="P10b">Credit</para></td>
- </tr>
- </blockTable>
- <section>
- <para style="terp_default_8">[[ repeatIn(lines(o.period_id.id, o.journal_id.id), 'line') ]]</para>
- <blockTable colWidths="545.0" style="Table4NewMove">
- <tr>
- <td><para style="P8">[[ not check_last_move_id(line.move_id.id) and removeParentNode('blockTable') ]]</para></td>
- </tr>
- </blockTable>
- <blockTable rowHeights="0.55cm" colWidths="55.0,45.0,50.0,60.0,110.0,15.0,70.0,70.0,70.0" style="Table_no_lines">
- <tr>
- <td><para style="terp_default_8">[[ line.move_id.name &lt;&gt; '/' and line.move_id.name or ('*'+str(line.move_id.id)) ]]</para></td>
- <td><para style="terp_default_8">[[ formatLang(line.date,date=True) ]]</para></td>
- <td><para style="terp_default_8">[[ line.account_id.code ]]</para></td>
- <td><para style="terp_default_8">[[ line.partner_id and strip_name(line.partner_id.name,15) ]]</para></td>
- <td><para style="terp_default_8">[[ strip_name(line.name,25) ]]</para></td>
- <td><para style="P8">[[ line.tax_code_id and line.tax_code_id.code and (line.tax_code_id.code + ':') ]]</para></td>
- <td><para style="terp_default_8">[[ line.tax_amount and formatLang(line.tax_amount, currency_obj=company.currency_id) ]]</para></td>
- <td><para style="P8">[[ formatLang(line.debit, currency_obj=company.currency_id) ]]</para></td>
- <td><para style="P8">[[ formatLang(line.credit, currency_obj=company.currency_id) ]]</para></td>
- </tr>
- </blockTable>
- <para style="terp_default_8">[[ set_last_move_id(line.move_id.id) ]]</para>
- </section>
- <blockTable rowHeights="0.55cm" colWidths="55.0,45.0,50.0,60.0,110.0,15.0,70.0,70.0,70.0" style="Table4Total">
- <tr>
- <td><para style="P11"></para></td>
- <td><para style="P11"></para></td>
- <td><para style="P11"></para></td>
- <td><para style="P11"><font color="white"></font></para></td>
- <td><para style="P11"><font color="white"></font></para></td>
- <td><para style="P11"><font color="white"></font></para></td>
- <td><para style="P12">Total:</para></td>
- <td><para style="P12">[[ formatLang(sum_debit(o.period_id.id, o.journal_id.id), currency_obj=company.currency_id) ]]</para></td>
- <td><para style="P12">[[ formatLang(sum_credit(o.period_id.id, o.journal_id.id), currency_obj=company.currency_id) ]]</para></td>
- </tr>
- </blockTable>
- </section>
-
- <section>
- [[ display_currency(data) or removeParentNode('section') ]]
- <blockTable rowHeights="0.55cm" colWidths="55.0,45.0,50.0,50.0,70.0,10.0,70.0,70.0,70.0,70.0" style="Table1">
- <tr>
- <td><para style="P10a">Move</para></td>
- <td><para style="P10a">Date</para></td>
- <td><para style="P10a">Account</para></td>
- <td><para style="P10a">Partner</para></td>
- <td><para style="P10a">Label</para></td>
- <td><para style="P10a">Tax</para></td>
- <td><para style="P11"></para></td>
- <td><para style="P10b">Debit</para></td>
- <td><para style="P10b">Credit</para></td>
- <td><para style="P10b">Currency</para></td>
- </tr>
- </blockTable>
- <section>
- <para style="terp_default_8">[[ repeatIn(lines(o.period_id.id, o.journal_id.id), 'line') ]]</para>
- <blockTable colWidths="545.0" style="Table4NewMove">
- <tr>
- <td><para style="P8">[[ not check_last_move_id(line.move_id.id) and removeParentNode('blockTable') ]]</para></td>
- </tr>
- </blockTable>
- <blockTable rowHeights="0.55cm" colWidths="55.0,45.0,50.0,50.0,70.0,10.0,70.0,70.0,70.0,70.0" style="Table_no_lines">
- <tr>
- <td><para style="terp_default_8">[[ line.move_id.name &lt;&gt; '/' and line.move_id.name or ('*'+str(line.move_id.id)) ]]</para></td>
- <td><para style="terp_default_8">[[ formatLang(line.date,date=True) ]]</para></td>
- <td><para style="terp_default_8">[[ line.account_id.code ]]</para></td>
- <td><para style="terp_default_8">[[ line.partner_id and strip_name(line.partner_id.name,12) ]]</para></td>
- <td><para style="terp_default_8">[[ strip_name(line.name,16) ]]</para></td>
- <td><para style="terp_default_8">[[ line.tax_code_id and line.tax_code_id.code and (line.tax_code_id.code + ':') ]]</para></td>
- <td><para style="P8">[[ line.tax_amount and formatLang(line.tax_amount, currency_obj=company.currency_id) ]]</para></td>
- <td><para style="P8">[[ formatLang(line.debit, currency_obj=company.currency_id) ]]</para></td>
- <td><para style="P8">[[ formatLang(line.credit, currency_obj=company.currency_id) ]]</para></td>
- <td><para style="P8">[[ line.currency_id and formatLang(line.amount_currency, currency_obj=line.currency_id) or '' ]]</para></td>
- </tr>
- </blockTable>
- <para style="terp_default_8">[[ set_last_move_id(line.move_id.id) ]]</para>
- </section>
- <blockTable rowHeights="0.55cm" colWidths="55.0,45.0,50.0,50.0,70.0,10.0,70.0,70.0,70.0,70.0" style="Table4Total">
- <tr>
- <td><para style="P11"></para></td>
- <td><para style="P11"></para></td>
- <td><para style="P11"></para></td>
- <td><para style="P11"><font color="white"></font></para></td>
- <td><para style="P11"><font color="white"></font></para></td>
- <td><para style="P11"><font color="white"></font></para></td>
- <td><para style="P12">Total:</para></td>
- <td><para style="P12">[[ formatLang(sum_debit(o.period_id.id, o.journal_id.id), currency_obj=company.currency_id) ]]</para></td>
- <td><para style="P12">[[ formatLang(sum_credit(o.period_id.id, o.journal_id.id), currency_obj=company.currency_id) ]]</para></td>
- <!-- given a period and a journal, the sum of debit will always be equal to the sum of credit, so there is no point to display it-->
- <td><para style="P12"> <!--o.journal_id.currency and formatLang((sum_debit(o.period_id.id, o.journal_id.id) - sum_credit(o.period_id.id, o.journal_id.id))) ]] [[ o.journal_id.currency and o.journal_id.currency.symbol --></para></td>
- </tr>
- </blockTable>
- </section>
-
- <para style="P9">
- <font color="white"> </font>
- </para>
- <para style="P9">
- <font color="white"> </font>
- </para>
- <section>
- <para alignment="LEFT">
- </para>
- <blockTable colWidths="15.0,80.0,20.0,182.0" style="Table1" repeatRows="1">
- <tr>
- <td><para style="P12"></para></td>
- <td><para style="P12">Tax Declaration</para></td>
- <td><para style="P12"></para></td>
- <td><para style="P12"></para></td>
- </tr>
- <tr>
- <td><para style="terp_default_8">[[ repeatIn(tax_codes(o.period_id.id,o.journal_id.id), 't') ]][[ t.code + ': ' ]]</para></td>
- <td><para style="P8">[[ formatLang(sum_vat( o.period_id.id, o.journal_id.id, t.id)) ]]</para></td>
- <td><para style="P11"><font color="white"> </font></para></td>
- <td><para style="terp_default_8">[[ t.name ]]</para></td>
- </tr>
- </blockTable>
- </section>
- </story>
-</document>
diff --git a/addons/account/report/account_partner_balance.py b/addons/account/report/account_partner_balance.py
index 53edbbe9685..ecd287551e5 100644
--- a/addons/account/report/account_partner_balance.py
+++ b/addons/account/report/account_partner_balance.py
@@ -20,11 +20,12 @@
##############################################################################
import time
-
+from openerp.osv import osv
from openerp.tools.translate import _
from openerp.report import report_sxw
from common_report_header import common_report_header
+
class partner_balance(report_sxw.rml_parse, common_report_header):
def __init__(self, cr, uid, name, context=None):
@@ -301,6 +302,11 @@ class partner_balance(report_sxw.rml_parse, common_report_header):
return _('Receivable and Payable Accounts')
return ''
-report_sxw.report_sxw('report.account.partner.balance', 'res.partner', 'account/report/account_partner_balance.rml',parser=partner_balance, header="internal")
+
+class report_partnerbalance(osv.AbstractModel):
+ _name = 'report.account.report_partnerbalance'
+ _inherit = 'report.abstract_report'
+ _template = 'account.report_partnerbalance'
+ _wrapped_report_class = partner_balance
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/report/account_partner_balance.rml b/addons/account/report/account_partner_balance.rml
deleted file mode 100644
index a99a7f062ec..00000000000
--- a/addons/account/report/account_partner_balance.rml
+++ /dev/null
@@ -1,257 +0,0 @@
-<?xml version="1.0"?>
-<document filename="Partner Balance.pdf">
- <template title="Partner Balance" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
- <pageTemplate id="first">
- <frame id="first" x1="57.0" y1="57.0" width="481" height="728"/>
- </pageTemplate>
- </template>
- <stylesheet>
- <blockTableStyle id="Standard_Outline">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table1">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <blockBackground colorName="#e6e6e6" start="0,0" stop="0,0"/>
- <blockBackground colorName="#e6e6e6" start="1,0" stop="1,0"/>
- <blockBackground colorName="#e6e6e6" start="2,0" stop="2,0"/>
- <blockBackground colorName="#e6e6e6" start="0,1" stop="0,1"/>
- <blockBackground colorName="#e6e6e6" start="1,1" stop="1,1"/>
- <blockBackground colorName="#e6e6e6" start="2,1" stop="2,1"/>
- </blockTableStyle>
- <blockTableStyle id="Table6">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="GRID" colorName="black"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Company_Name">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table2">
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,1" stop="-1,1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,2" stop="-1,2"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,3" stop="-1,-1"/>
- <blockValign value="TOP"/>
- <blockAlignment value="RIGHT" start="2,1" stop="-1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table3">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table4">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="GRID" colorName="black"/>
- </blockTableStyle>
- <blockTableStyle id="Tableau3">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" />
- <lineStyle kind="OUTLINE" colorName="#e6e6e6" />
- <blockBackground colorName="white" start="0,0" stop="-1,0"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Sub_Header_Content">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="4,0" stop="4,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="4,0" stop="4,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="5,0" stop="5,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="5,0" stop="5,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table2_header">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,0" stop="-1,0"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="4,0" stop="4,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="4,0" stop="4,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="5,0" stop="5,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="5,0" stop="5,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="6,0" stop="6,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="6,0" stop="6,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="6,0" stop="6,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="7,0" stop="7,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="7,0" stop="7,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="7,0" stop="7,0"/>
- </blockTableStyle>
-
- <blockTableStyle id="Table_Subheader_Content_detail">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="4,0" stop="4,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="4,0" stop="4,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="5,0" stop="5,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="5,0" stop="5,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
- </blockTableStyle>
-
- <initialize>
- <paraStyle name="all" alignment="justify"/>
- </initialize>
-
- <paraStyle name="P3" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="P4" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="P5" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="P6" fontName="Helvetica" fontSize="11.0" leading="12" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="P7" fontName="Helvetica-Bold" fontSize="9" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="P8" fontName="Helvetica-Bold" fontSize="9" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="P9" fontName="Helvetica" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="P9b" fontName="Helvetica-Bold" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="P10" fontName="Helvetica" alignment="CENTER"/>
- <paraStyle name="P11" fontName="Helvetica" fontSize="8.0" leading="10"/>
- <paraStyle name="P12" fontName="Helvetica-Bold" fontSize="9.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="P12a" fontName="Helvetica-Bold" fontSize="9.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P12b" fontName="Helvetica-Bold" fontSize="9.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="P13" fontName="Helvetica" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="P14" rightIndent="17.0" leftIndent="-0.0" fontName="Times-Bold" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Standard" fontName="Helvetica"/>
- <paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Table Contents" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Caption" fontName="Helvetica" fontSize="10.0" leading="11" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="Index" fontName="Helvetica"/>
- <paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- </stylesheet>
-
- <story>
-
- <blockTable colWidths="539.0" style="Table_Company_Name">
- <tr>
- <td>
- <para style="terp_header_Centre">Partner Balance</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="90.0,80.0,80.0,130.0,80.0,80.0" style="Table2_header">
- <tr>
- <td><para style="terp_tblheader_General_Centre">Chart of Accounts</para></td>
- <td><para style="terp_tblheader_General_Centre">Fiscal Year</para></td>
- <td><para style="terp_tblheader_General_Centre">Journals</para></td>
- <td><para style="terp_tblheader_General_Centre">Filter By [[ data['form']['filter']!='filter_no' and get_filter(data) ]]</para></td>
- <td><para style="terp_tblheader_General_Centre">Partner's</para></td>
- <td><para style="terp_tblheader_General_Centre">Target Moves</para></td>
- </tr>
- <tr>
- <td><para style="terp_default_Centre_8">[[ get_account(data) or removeParentNode('para') ]]</para></td>
- <td><para style="terp_default_Centre_8">[[ get_fiscalyear(data) or '' ]]</para></td>
- <td> <para style="terp_default_Centre_8">[[', '.join([ lt or '' for lt in get_journal(data) ]) ]] </para></td>
-
- <td><para style="terp_default_Centre_8">[[ data['form']['filter']=='filter_no' and get_filter(data) or removeParentNode('para') ]] </para>
- <blockTable colWidths="60.0,60.0" style="Table3">[[ data['form']['filter']=='filter_date' or removeParentNode('blockTable') ]]
- <tr>
- <td><para style="terp_tblheader_General_Centre">Start Date</para></td>
- <td><para style="terp_tblheader_General_Centre">End Date</para></td>
- </tr>
- <tr>
- <td><para style="terp_default_Centre_8">[[ formatLang(get_start_date(data),date=True) ]]</para></td>
- <td><para style="terp_default_Centre_8">[[ formatLang(get_end_date(data),date=True) ]]</para></td>
- </tr>
- </blockTable>
- <blockTable colWidths="60.0,60.0" style="Table3">[[ data['form']['filter']=='filter_period' or removeParentNode('blockTable') ]]
- <tr>
- <td><para style="terp_tblheader_General_Centre">Start Period</para></td>
- <td><para style="terp_tblheader_General_Centre">End Period</para></td>
- </tr>
- <tr>
- <td><para style="terp_default_Centre_8">[[ get_start_period(data) or removeParentNode('para') ]]</para></td>
- <td><para style="terp_default_Centre_8">[[ get_end_period(data) or removeParentNode('para') ]]</para></td>
- </tr>
- </blockTable>
- </td>
- <td> <para style="terp_default_Centre_9">[[ get_partners() ]]</para></td>
- <td><para style="terp_default_Centre_8">[[ get_target_move(data) ]] </para></td>
- </tr>
- </blockTable>
-
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <para style="P12a"></para>
- <blockTable colWidths="80.0,140.0,80.0,80.0,80.0,80.0" repeatRows="1" style="Table2">
- <tr>
- <td><para style="P12a">Code</para></td>
- <td><para style="P12a">(Account/Partner) Name</para></td>
- <td><para style="P12b">Debit</para></td>
- <td><para style="P12b">Credit</para></td>
- <td><para style="P12b">Balance</para></td>
- <td><para style="P12b">In dispute</para></td>
- </tr>
- <tr>
- <td><para style="P7">Total:</para></td>
- <td><para style="P8"></para></td>
- <td><para style="P8"><u>[[ formatLang(sum_debit()) ]]</u></para></td>
- <td><para style="P8"><u>[[ formatLang(sum_credit()) ]]</u></para></td>
- <td><para style="P8"><u>[[ formatLang((sum_debit()-sum_credit()), currency_obj=company.currency_id) ]]</u></para></td>
- <td><para style="P8"><u>[[ formatLang(sum_litige(), currency_obj=company.currency_id) ]]</u></para></td>
- </tr>
- <tr>
- <td><para style="P3">[[ repeatIn(lines(), 'a') ]]<font>[[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]]</font><font>[[ a['ref'] ]] [[ a['type']==3 and a['code'] ]]</font></para></td>
- <td><para style="P3"><font>[[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]]</font>[[ a['name'] ]]</para></td>
- <td><para style="P4"><font>[[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]]</font>[[ formatLang(a['debit']) ]]</para></td>
- <td><para style="P4"><font>[[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]]</font>[[ formatLang(a['credit']) ]]</para></td>
- <td><para style="P4"><font>[[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]]</font>[[ formatLang(a['balance'], currency_obj=company.currency_id) ]]</para></td>
- <td><para style="P4"><font>[[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]]</font>[[ formatLang(a['enlitige'] or 0.0, currency_obj=company.currency_id) ]]</para></td>
- </tr>
- </blockTable>
- </story>
-</document>
diff --git a/addons/account/report/account_partner_ledger.py b/addons/account/report/account_partner_ledger.py
index d21323e02fc..f02ac96b6fc 100644
--- a/addons/account/report/account_partner_ledger.py
+++ b/addons/account/report/account_partner_ledger.py
@@ -20,10 +20,11 @@
##############################################################################
import time
-import re
+from openerp.osv import osv
+from openerp.tools.translate import _
from openerp.report import report_sxw
from common_report_header import common_report_header
-from openerp.tools.translate import _
+
class third_party_ledger(report_sxw.rml_parse, common_report_header):
@@ -297,12 +298,18 @@ class third_party_ledger(report_sxw.rml_parse, common_report_header):
return True
return False
-report_sxw.report_sxw('report.account.third_party_ledger', 'res.partner',
- 'addons/account/report/account_partner_ledger.rml',parser=third_party_ledger,
- header='internal')
-report_sxw.report_sxw('report.account.third_party_ledger_other', 'res.partner',
- 'addons/account/report/account_partner_ledger_other.rml',parser=third_party_ledger,
- header='internal')
+class report_partnerledger(osv.AbstractModel):
+ _name = 'report.account.report_partnerledger'
+ _inherit = 'report.abstract_report'
+ _template = 'account.report_partnerledger'
+ _wrapped_report_class = third_party_ledger
+
+
+class report_partnerledgerother(osv.AbstractModel):
+ _name = 'report.account.report_partnerledgerother'
+ _inherit = 'report.abstract_report'
+ _template = 'account.report_partnerledgerother'
+ _wrapped_report_class = third_party_ledger
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/report/account_partner_ledger.rml b/addons/account/report/account_partner_ledger.rml
deleted file mode 100644
index 48ed6d4afe3..00000000000
--- a/addons/account/report/account_partner_ledger.rml
+++ /dev/null
@@ -1,658 +0,0 @@
-<?xml version="1.0"?>
-<document filename="Partner Ledger.pdf">
- <template title="Partner Ledger" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
- <pageTemplate id="first">
- <frame id="first" x1="28.0" y1="28.0" width="539" height="772"/>
- </pageTemplate>
- </template>
- <stylesheet>
- <blockTableStyle id="Standard_Outline">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table1">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="4,0" stop="4,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="4,0" stop="4,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="5,0" stop="5,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="5,0" stop="5,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="5,0" stop="5,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table4">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="4,0" stop="4,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="4,0" stop="4,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="5,0" stop="5,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="5,0" stop="5,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="5,0" stop="5,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="6,0" stop="6,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="6,0" stop="6,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="7,0" stop="7,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="7,0" stop="7,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="7,0" stop="7,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="7,-1" stop="7,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="8,0" stop="8,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="8,0" stop="8,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="8,-1" stop="8,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="9,0" stop="9,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="9,0" stop="9,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="9,0" stop="9,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="9,-1" stop="9,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="10,0" stop="10,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="10,0" stop="10,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="10,-1" stop="10,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="11,0" stop="11,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="11,0" stop="11,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="11,0" stop="11,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="11,-1" stop="11,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="12,0" stop="12,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="12,0" stop="12,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="12,-1" stop="12,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="13,0" stop="13,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="13,0" stop="13,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="13,0" stop="13,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="13,-1" stop="13,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,1" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,1" stop="0,1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,1" stop="1,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="1,1" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,1" stop="1,1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,2" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,2" stop="0,2"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,2" stop="1,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="1,2" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,2" stop="1,2"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,3" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,3" stop="0,3"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,3" stop="1,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="1,3" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,3" stop="1,3"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,4" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,4" stop="0,4"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,4" stop="1,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="1,4" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,4" stop="1,4"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table7">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table9">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table10">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table11">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table2">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="7,-1" stop="7,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table3">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#999999" start="0,-1" stop="0,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table5">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table6">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="7,-1" stop="7,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table8">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="7,-1" stop="7,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="8,-1" stop="8,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table12">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#999999" start="0,-1" stop="0,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table13">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table14">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="7,-1" stop="7,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="8,-1" stop="8,-1"/>
- </blockTableStyle>
- <initialize>
- <paraStyle name="all" alignment="justify"/>
- </initialize>
- <paraStyle name="Standard" fontName="Helvetica"/>
- <paraStyle name="Heading" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Caption" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="Index" fontName="Helvetica" fontSize="9.0" leading="11"/>
- <paraStyle name="Footer" fontName="Helvetica"/>
- <paraStyle name="Table Contents" fontName="Helvetica"/>
- <paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER"/>
- <paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
- <paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_8" fontName="Helvetica" fontSize="7.0" leading="9" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="7.0" leading="9" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="7.0" leading="9" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="7.0" leading="9" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_9" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="8.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_9_italic" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_9_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="Heading 3" fontName="Helvetica-Bold" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
- <images/>
- </stylesheet>
- <story>
- <pto>
- <pto_header>
- <blockTable colWidths="50.0,30.0,60.0,60.0,130.0,64.0,64.0,79.0" style="Table2">
- <tr>
- <td>
- <para style="terp_tblheader_Details">Date</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">JRNL</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Ref</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Account</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Entry Label</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Debit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Credit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Balance</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="45.0,30.0,60.0,50.0,75.0,64.0,64.0,79.0,70.0" style="Table8">
- <tr>
- <td>
- <para style="terp_tblheader_Details">Date</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">JRNL</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Ref</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Account</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Entry Label</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Debit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Credit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Balance</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Currency</para>
- </td>
- </tr>
- </blockTable>
- </pto_header>
- <para style="terp_default_8">[[ repeatIn(objects, 'p') ]]</para>
- <para style="terp_default_8">[[ setLang(p.lang) ]]</para>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <para style="terp_header_Centre">Partner Ledger</para>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="82.0,82.0,82.0,128.0,82.0,82.0" style="Table1">
- <tr>
- <td>
- <para style="terp_tblheader_General_Centre">Chart of Accounts</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Fiscal Year</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Journals</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Filters By [[ data['form']['filter'] not in ('filter_no','unreconciled') and get_filter(data) ]]</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Partner's</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Target Moves</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="82.0,82.0,82.0,128.0,82.0,82.0" style="Table4">
- <tr>
- <td>
- <para style="terp_default_Centre_8">[[ get_account(data) or '' ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ get_fiscalyear(data) or '' ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[', '.join([ lt or '' for lt in get_journal(data) ]) ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ data['form']['filter'] in ('filter_no','unreconciled') and get_filter(data) or removeParentNode('para') ]]</para>
- <blockTable colWidths="58.0,58.0" style="Table7">[[ data['form']['filter']=='filter_date' or removeParentNode('blockTable') ]]
- <tr>
- <td>
- <para style="terp_tblheader_General_Centre">Start Date</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">End Date</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="58.0,58.0" style="Table9">[[ data['form']['filter']=='filter_date' or removeParentNode('blockTable') ]]
- <tr>
- <td>
- <para style="terp_default_Centre_8">[[ formatLang(get_start_date(data),date=True) ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ formatLang(get_end_date(data),date=True) ]]</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="58.0,58.0" style="Table10">[[ data['form']['filter']=='filter_period' or removeParentNode('blockTable') ]]
- <tr>
- <td>
- <para style="terp_tblheader_General_Centre">Start Period</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">End Period</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="58.0,58.0" style="Table11">[[ data['form']['filter']=='filter_period' or removeParentNode('blockTable') ]]
- <tr>
- <td>
- <para style="terp_default_Centre_8">[[ get_start_period(data) or removeParentNode('para') ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ get_end_period(data) or removeParentNode('para') ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_Centre_8">Receivable Accounts[[ data['form'].get('result_selection', 'customer') == 'customer' or removeParentNode('para') ]]</para>
- <para style="terp_default_Centre_8">Payable Accounts[[ data['form'].get('result_selection', 'customer') == 'supplier' or removeParentNode('para') ]]</para>
- <para style="terp_default_Centre_8">Receivable and Payable Accounts[[ data['form'].get('result_selection', 'customer') == 'customer_supplier' or removeParentNode('para') ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ get_target_move(data) ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <section>
- <para style="terp_default_2">
- <font face="Helvetica" color="white">[[ display_currency(data) == False or removeParentNode('section') ]]</font>
- </para>
- <blockTable colWidths="50.0,30.0,60.0,60.0,130.0,64.0,64.0,79.0" style="Table2">
- <tr>
- <td>
- <para style="terp_tblheader_Details">Date</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">JRNL</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Ref</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Account</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Entry Label</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Debit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Credit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Balance</para>
- </td>
- </tr>
- </blockTable>
- <blockTable rowHeights="0.55cm" colWidths="332.0,64.0,64.0,79.0" style="Table3">
- <tr>
- <td>
- <para style="terp_default_Bold_9">[[ p.ref ]] - [[ p.name ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_9_Right">[[ formatLang((sum_debit_partner(p))) ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_9_Right">[[ formatLang((sum_credit_partner(p))) ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_9_Right">[[ formatLang((sum_debit_partner(p) - sum_credit_partner(p)), currency_obj=company.currency_id) ]]</para>
- </td>
- </tr>
- </blockTable>
- <section>
- <para style="terp_default_2">
- <font face="Helvetica" color="white">[[data['form']['initial_balance']==True or removeParentNode('section') ]]</font>
- </para>
- <blockTable rowHeights="0.55cm" colWidths="332.0,64.0,64.0,79.0" style="Table5">
- <tr>
- <td>
- <para style="terp_default_8">Initial Balance</para>
- </td>
- <td>
- <para style="terp_default_Right_8">[[ formatLang(get_intial_balance(p)[0][0])]]</para>
- </td>
- <td>
- <para style="terp_default_Right_8">[[ formatLang(get_intial_balance(p)[0][1]) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_8">[[ formatLang(get_intial_balance(p)[0][2], currency_obj=company.currency_id) ]]</para>
- </td>
- </tr>
- </blockTable>
- </section>
- <section>
- <para style="terp_default_8">[[ repeatIn(lines(p), 'line') ]]</para>
- <blockTable rowHeights="0.55cm" colWidths="50.0,30.0,60.0,60.0,130.0,64.0,64.0,79.0" style="Table6">
- <tr>
- <td>
- <para style="terp_default_8">[[ formatLang(line['date'],date=True) ]]</para>
- </td>
- <td>
- <para style="terp_default_8">[[ line['code'] ]]</para>
- </td>
- <td>
- <para style="terp_default_8">[[ line['move_name'] ]]</para>
- </td>
- <td>
- <para style="terp_default_8">[[ line['a_code'] ]]</para>
- </td>
- <td>
- <para style="terp_default_8">[[ line['ref'] and strip_name(line['ref'],10) ]] - [[ strip_name(line['name'],15) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_8">[[ formatLang((line['debit'])) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_8">[[ formatLang((line['credit'])) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_8">[[ formatLang((line['progress']), currency_obj=company.currency_id) ]]</para>
- </td>
- </tr>
- </blockTable>
- </section>
- </section>
- <section>
- <para style="terp_default_2">
- <font face="Helvetica" color="white">[[ display_currency(data) == True or removeParentNode('section') ]]</font>
- </para>
- <blockTable colWidths="45.0,30.0,60.0,50.0,75.0,64.0,64.0,79.0,70.0" style="Table8">
- <tr>
- <td>
- <para style="terp_tblheader_Details">Date</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">JRNL</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Ref</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Account</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Entry Label</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Debit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Credit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Balance</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Currency</para>
- </td>
- </tr>
- </blockTable>
- <blockTable rowHeights="0.55cm" colWidths="262.0,64.0,64.0,79.0,70.0" style="Table12">
- <tr>
- <td>
- <para style="terp_default_Bold_9">[[ p.ref ]] - [[ p.name ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_9_Right">[[ formatLang((sum_debit_partner(p))) ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_9_Right">[[ formatLang((sum_credit_partner(p))) ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_9_Right">[[ formatLang((sum_debit_partner(p) - sum_credit_partner(p)), currency_obj=company.currency_id) ]] </para>
- </td>
- <td>
- <para style="terp_default_Bold_9_Right">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- </blockTable>
- <section>
- <para style="terp_default_2"><font color="white">[[ data['form']['initial_balance']==True or removeParentNode('section') ]]</font></para>
- <blockTable rowHeights="0.55cm" colWidths="262.0,64.0,64.0,79.0,70.0" style="Table13">
- <tr>
- <td>
- <para style="terp_default_9">Initial Balance</para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang(get_intial_balance(p)[0][0])]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang(get_intial_balance(p)[0][1]) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang(get_intial_balance(p)[0][2], currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- </blockTable>
- </section>
- <section>
- <para style="terp_default_8">[[ repeatIn(lines(p), 'line') ]]</para>
- <blockTable rowHeights="0.55cm" colWidths="45.0,30.0,60.0,50.0,75.0,64.0,64.0,79.0,70.0" style="Table14">
- <tr>
- <td>
- <para style="terp_default_8">[[ formatLang(line['date'],date=True) ]]</para>
- </td>
- <td>
- <para style="terp_default_8">[[ line['code'] ]]</para>
- </td>
- <td>
- <para style="terp_default_8">[[ line['move_name'] ]]</para>
- </td>
- <td>
- <para style="terp_default_8">[[ line['a_code'] ]]</para>
- </td>
- <td>
- <para style="terp_default_8">[[ strip_name(line['ref'],8) ]] - [[ strip_name(line['name'],7) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_8">[[ formatLang((line['debit'])) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_8">[[ formatLang((line['credit'])) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_8">[[ formatLang((line['progress']), currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_8">
- <font>[[ (line['currency_id']==None or line['amount_currency']==None) and removeParentNode('font') ]] [[ formatLang(line['amount_currency'] ) ]] [[ line['currency_code'] or '' ]]</font>
- </para>
- </td>
- </tr>
- </blockTable>
- </section>
- </section>
- </pto>
- </story>
-</document>
diff --git a/addons/account/report/account_partner_ledger_other.rml b/addons/account/report/account_partner_ledger_other.rml
deleted file mode 100644
index b878ab44e47..00000000000
--- a/addons/account/report/account_partner_ledger_other.rml
+++ /dev/null
@@ -1,665 +0,0 @@
-<?xml version="1.0"?>
-<document filename="Partner Ledger.pdf">
- <template title="Partner Ledger" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
- <pageTemplate id="first">
- <frame id="first" x1="28.0" y1="28.0" width="539" height="772"/>
- </pageTemplate>
- </template>
- <stylesheet>
- <blockTableStyle id="Standard_Outline">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table1">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="4,0" stop="4,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="4,0" stop="4,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="5,0" stop="5,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="5,0" stop="5,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="5,0" stop="5,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table4">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="4,0" stop="4,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="4,0" stop="4,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="5,0" stop="5,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="5,0" stop="5,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="5,0" stop="5,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="6,0" stop="6,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="6,0" stop="6,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="7,0" stop="7,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="7,0" stop="7,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="7,0" stop="7,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="7,-1" stop="7,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="8,0" stop="8,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="8,0" stop="8,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="8,-1" stop="8,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="9,0" stop="9,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="9,0" stop="9,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="9,0" stop="9,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="9,-1" stop="9,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="10,0" stop="10,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="10,0" stop="10,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="10,-1" stop="10,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="11,0" stop="11,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="11,0" stop="11,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="11,0" stop="11,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="11,-1" stop="11,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="12,0" stop="12,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="12,0" stop="12,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="12,-1" stop="12,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="13,0" stop="13,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="13,0" stop="13,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="13,0" stop="13,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="13,-1" stop="13,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,1" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,1" stop="0,1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,1" stop="1,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="1,1" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,1" stop="1,1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,2" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,2" stop="0,2"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,2" stop="1,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="1,2" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,2" stop="1,2"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,3" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,3" stop="0,3"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,3" stop="1,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="1,3" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,3" stop="1,3"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,4" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,4" stop="0,4"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,4" stop="1,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="1,4" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,4" stop="1,4"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table7">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table9">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table10">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table11">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table2">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="7,-1" stop="7,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table3">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#999999" start="0,-1" stop="0,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table5">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table6">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="7,-1" stop="7,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table8">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="7,-1" stop="7,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="8,-1" stop="8,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table12">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#999999" start="0,-1" stop="0,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table13">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table14">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="7,-1" stop="7,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="8,-1" stop="8,-1"/>
- </blockTableStyle>
- <initialize>
- <paraStyle name="all" alignment="justify"/>
- </initialize>
- <paraStyle name="Standard" fontName="Helvetica"/>
- <paraStyle name="Heading" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Caption" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="Index" fontName="Helvetica" fontSize="9.0" leading="11"/>
- <paraStyle name="Footer" fontName="Helvetica"/>
- <paraStyle name="Table Contents" fontName="Helvetica"/>
- <paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER"/>
- <paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
- <paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_8" fontName="Helvetica" fontSize="7.0" leading="9" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="7.0" leading="9" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="7.0" leading="9" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="7.0" leading="9" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_9" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="8.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_9_italic" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_9_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="Heading 3" fontName="Helvetica-Bold" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
- <images/>
- </stylesheet>
- <story>
- <pto>
- <pto_header>
- <blockTable colWidths="50.0,30.0,60.0,60.0,130.0,64.0,64.0,79.0" style="Table2">
- [[ display_currency(data) == False or removeParentNode('blockTable') ]]
- <tr>
- <td>
- <para style="terp_tblheader_Details">Date</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">JRNL</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Ref</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Account</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Entry Label</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Debit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Credit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Balance</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="50.0,30.0,60.0,50.0,70.0,64.0,64.0,79.0,70.0" style="Table8">
- [[ display_currency(data) == True or removeParentNode('blockTable') ]]
- <tr>
- <td>
- <para style="terp_tblheader_Details">Date</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">JRNL</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Ref</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Account</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Entry Label</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Debit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Credit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Balance</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Currency</para>
- </td>
- </tr>
- </blockTable>
- </pto_header>
-
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <para style="terp_header_Centre">Partner Ledger</para>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="82.0,82.0,82.0,128.0,82.0,82.0" style="Table1">
- <tr>
- <td>
- <para style="terp_tblheader_General_Centre">Chart of Accounts</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Fiscal Year</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Journals</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Filters By [[ data['form']['filter'] not in ('filter_no','unreconciled') and get_filter(data) ]]</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Partner's</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Target Moves</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="82.0,82.0,82.0,128.0,82.0,82.0" style="Table4">
- <tr>
- <td>
- <para style="terp_default_Centre_8">[[ get_account(data) or '' ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ get_fiscalyear(data) or '' ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[', '.join([ lt or '' for lt in get_journal(data) ]) ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ data['form']['filter'] in ('filter_no','unreconciled') and get_filter(data) or removeParentNode('para') ]]</para>
- <blockTable colWidths="58.0,58.0" style="Table7">[[ data['form']['filter']=='filter_date' or removeParentNode('blockTable') ]]
- <tr>
- <td>
- <para style="terp_tblheader_General_Centre">Start Date</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">End Date</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="58.0,58.0" style="Table9">[[ data['form']['filter']=='filter_date' or removeParentNode('blockTable') ]]
- <tr>
- <td>
- <para style="terp_default_Centre_8">[[ formatLang(get_start_date(data),date=True) ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ formatLang(get_end_date(data),date=True) ]]</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="58.0,58.0" style="Table10">[[ data['form']['filter']=='filter_period' or removeParentNode('blockTable') ]]
- <tr>
- <td>
- <para style="terp_tblheader_General_Centre">Start Period</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">End Period</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="58.0,58.0" style="Table11">[[ data['form']['filter']=='filter_period' or removeParentNode('blockTable') ]]
- <tr>
- <td>
- <para style="terp_default_Centre_8">[[ get_start_period(data) or removeParentNode('para') ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ get_end_period(data) or removeParentNode('para') ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ get_partners() ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ get_target_move(data) ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="50.0,30.0,60.0,60.0,130.0,64.0,64.0,79.0" style="Table2">
- [[ display_currency(data) == False or removeParentNode('blockTable') ]]
- <tr>
- <td>
- <para style="terp_tblheader_Details">Date</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">JRNL</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Ref</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Account</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Entry Label</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Debit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Credit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Balance</para>
- </td>
- </tr>
- </blockTable>
- <section>
- <para style="terp_default_8">[[ repeatIn(objects, 'p') ]]</para>
- <para style="terp_default_8">[[ setLang(p.lang) ]]</para>
- <para style="terp_default_2">
- <font face="Helvetica" color="white">[[ display_currency(data) == False or removeParentNode('section') ]]</font>
- </para>
-
- <blockTable rowHeights="0.55cm" colWidths="332.0,64.0,64.0,79.0" style="Table3">
- <tr>
- <td>
- <para style="terp_default_Bold_9">[[ p.ref ]] - [[ p.name ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_9_Right">[[ formatLang((sum_debit_partner(p))) ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_9_Right">[[ formatLang((sum_credit_partner(p))) ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_9_Right">[[ formatLang((sum_debit_partner(p) - sum_credit_partner(p)), currency_obj=company.currency_id) ]]</para>
- </td>
- </tr>
- </blockTable>
- <section>
- <para style="terp_default_2">
- <font face="Helvetica" color="white">[[data['form']['initial_balance']==True or removeParentNode('section') ]]</font>
- </para>
- <blockTable rowHeights="0.55cm" colWidths="332.0,64.0,64.0,79.0" style="Table5">
- <tr>
- <td>
- <para style="terp_default_8">Initial Balance</para>
- </td>
- <td>
- <para style="terp_default_Right_8">[[ formatLang(get_intial_balance(p)[0][0])]]</para>
- </td>
- <td>
- <para style="terp_default_Right_8">[[ formatLang(get_intial_balance(p)[0][1]) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_8">[[ formatLang(get_intial_balance(p)[0][2], currency_obj=company.currency_id) ]]</para>
- </td>
- </tr>
- </blockTable>
- </section>
- <section>
- <para style="terp_default_8">[[ repeatIn(lines(p), 'line') ]]</para>
- <blockTable rowHeights="0.55cm" colWidths="50.0,30.0,60.0,60.0,130.0,64.0,64.0,79.0" style="Table6">
- <tr>
- <td>
- <para style="terp_default_8">[[ formatLang(line['date'],date=True) ]]</para>
- </td>
- <td>
- <para style="terp_default_8">[[ line['code'] ]]</para>
- </td>
- <td>
- <para style="terp_default_8">[[ line['move_name'] ]]</para>
- </td>
- <td>
- <para style="terp_default_8">[[ line['a_code'] ]]</para>
- </td>
- <td>
- <para style="terp_default_8">[[ line['ref'] and strip_name(line['ref'],10) ]] - [[ strip_name(line['name'],15) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_8">[[ formatLang((line['debit'])) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_8">[[ formatLang((line['credit'])) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_8">[[ formatLang((line['progress']), currency_obj=company.currency_id) ]]</para>
- </td>
- </tr>
- </blockTable>
- </section>
- </section>
- <blockTable colWidths="50.0,30.0,60.0,50.0,70.0,64.0,64.0,79.0,70.0" style="Table8">
- [[ display_currency(data) == True or removeParentNode('blockTable') ]]
- <tr>
- <td>
- <para style="terp_tblheader_Details">Date</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">JRNL</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Ref</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Account</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Entry Label</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Debit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Credit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Balance</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Currency</para>
- </td>
- </tr>
- </blockTable>
- <section>
- <para style="terp_default_8">[[ repeatIn(objects, 'p') ]]</para>
- <para style="terp_default_8">[[ setLang(p.lang) ]]</para>
- <para style="terp_default_2">
- <font face="Helvetica" color="white">[[ display_currency(data) == True or removeParentNode('section') ]]</font>
- </para>
-
- <blockTable rowHeights="0.55cm" colWidths="262.0,64.0,64.0,79.0,70.0" style="Table12">
- <tr>
- <td>
- <para style="terp_default_Bold_9">[[ p.ref ]] - [[ p.name ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_9_Right">[[ formatLang((sum_debit_partner(p))) ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_9_Right">[[ formatLang((sum_credit_partner(p))) ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_9_Right">[[ formatLang((sum_debit_partner(p) - sum_credit_partner(p)), currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_9_Right">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- </blockTable>
- <section>
- <para style="terp_default_2"><font color="white">[[ data['form']['initial_balance']==True or removeParentNode('section') ]]</font></para>
- <blockTable rowHeights="0.55cm" colWidths="262.0,64.0,64.0,79.0,70.0" style="Table13">
- <tr>
- <td>
- <para style="terp_default_8">Initial Balance</para>
- </td>
- <td>
- <para style="terp_default_Right_8">[[ formatLang(get_intial_balance(p)[0][0])]]</para>
- </td>
- <td>
- <para style="terp_default_Right_8">[[ formatLang(get_intial_balance(p)[0][1]) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_8">[[ formatLang(get_intial_balance(p)[0][2], currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_8">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- </blockTable>
- </section>
- <section>
- <para style="terp_default_8">[[ repeatIn(lines(p), 'line') ]]</para>
- <blockTable rowHeights="0.55cm" colWidths="45.0,30.0,60.0,50.0,75.0,64.0,64.0,79.0,70.0" style="Table14">
- <tr>
- <td>
- <para style="terp_default_8">[[ formatLang(line['date'],date=True) ]]</para>
- </td>
- <td>
- <para style="terp_default_8">[[ line['code'] ]]</para>
- </td>
- <td>
- <para style="terp_default_8">[[ line['move_name'] ]]</para>
- </td>
- <td>
- <para style="terp_default_8">[[ line['a_code'] ]]</para>
- </td>
- <td>
- <para style="terp_default_8">[[ strip_name(line['ref'],8) ]] - [[ strip_name(line['name'],7) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_8">[[ formatLang((line['debit'])) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_8">[[ formatLang((line['credit'])) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_8">[[ formatLang((line['progress']), currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_8">
- <font>[[ (line['currency_id']==None or line['amount_currency']==None) and removeParentNode('font') ]] [[ formatLang(line['amount_currency'] ) ]] [[ line['currency_code'] or '' ]]</font>
- </para>
- </td>
- </tr>
- </blockTable>
- </section>
- </section>
- </pto>
- </story>
-</document>
diff --git a/addons/account/report/account_print_invoice.rml b/addons/account/report/account_print_invoice.rml
deleted file mode 100644
index 6914adfaf20..00000000000
--- a/addons/account/report/account_print_invoice.rml
+++ /dev/null
@@ -1,373 +0,0 @@
-<?xml version="1.0"?>
-<document filename="Invoices.pdf">
- <template title="Invoices" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
- <pageTemplate id="first">
- <frame id="first" x1="34.0" y1="28.0" width="530" height="786"/>
- </pageTemplate>
- </template>
- <stylesheet>
- <blockTableStyle id="Standard_Outline">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Partner_Address">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table_Invoice_General_Header">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table_General_Detail_Content">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table7">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table8">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table10">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="1,2" stop="1,2"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="2,2" stop="2,2"/>
- </blockTableStyle>
- <blockTableStyle id="Table9">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table2">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table1">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <initialize>
- <paraStyle name="all" alignment="justify"/>
- </initialize>
- <paraStyle name="Standard"/>
- <paraStyle name="Text body" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="List" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Table Contents" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Caption" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="Index"/>
-
- <paraStyle name="terp_header" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_8" rightIndent="0.0" leftIndent="0.0" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="Footer"/>
- <paraStyle name="Horizontal Line" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
-
- <paraStyle name="terp_tblheader_General" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General_Centre" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General_Right" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Centre" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Right" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
-
- <paraStyle name="terp_default_Right_8" rightIndent="0.0" leftIndent="0.0" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_8" rightIndent="0.0" leftIndent="0.0" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_address" rightIndent="0.0" leftIndent="0.0" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_9" rightIndent="0.0" leftIndent="0.0" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_9" rightIndent="0.0" leftIndent="-3.0" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_9" rightIndent="0.0" leftIndent="0.0" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_9" rightIndent="0.0" leftIndent="0.0" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_Right_9" rightIndent="0.0" leftIndent="-3.0" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_2" rightIndent="0.0" leftIndent="0.0" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_White_2" rightIndent="0.0" leftIndent="0.0" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0" textColor="#ffffff"/>
-
- <paraStyle name="Table" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="User Index 10" rightIndent="0.0" leftIndent="127.0"/>
- <paraStyle name="Preformatted Text" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="0.0"/>
- <images/>
- </stylesheet>
- <story>
- <pto>
- <para style="terp_default_8">[[ repeatIn(objects,'o') ]]</para>
- <para style="terp_default_8">[[ setLang(o.partner_id.lang) ]]</para>
- <pto_header><!-- Must be after setLang() -->
- <blockTable colWidths="202.0,87.0,71.0,57.0,42.0,71.0" style="Table7">
- <tr>
- <td><para style="terp_tblheader_Details"><b>Description</b></para></td>
- <td><para style="terp_tblheader_Details_Centre"><b>Taxes</b></para></td>
- <td><para style="terp_tblheader_Details_Centre"><b>Quantity</b></para></td>
- <td><para style="terp_tblheader_Details_Right"><b>Unit Price</b></para></td>
- <td><para style="terp_tblheader_Details_Right"><b>Disc.(%)</b></para></td>
- <td><para style="terp_tblheader_Details_Right"><b>Price</b></para></td>
- </tr>
- </blockTable>
- </pto_header>
- <blockTable colWidths="297.0,233.0" style="Table_Partner_Address">
- <tr>
- <td>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_8">[[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]]</para>
- <para style="terp_default_8">[[ display_address(o.partner_id) ]]</para>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <para style="terp_default_8">Tel. : [[ (o.partner_id.phone) or removeParentNode('para') ]]</para>
- <para style="terp_default_8">Fax : [[ (o.partner_id.fax) or removeParentNode('para') ]]</para>
- <para style="terp_default_8">TIN : [[ (o.partner_id.vat) or removeParentNode('para') ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_header"><b>Invoice [[ ((o.type == 'out_invoice' and (o.state == 'open' or o.state == 'paid')) or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para>
- <para style="terp_header"><b>PRO-FORMA [[ ((o.type == 'out_invoice' and o.state == 'proforma2') or removeParentNode('para')) and '' ]]</b></para>
- <para style="terp_header"><b>Draft Invoice [[ ((o.type == 'out_invoice' and o.state == 'draft') or removeParentNode('para')) and '' ]]</b></para>
- <para style="terp_header"><b>Cancelled Invoice [[ ((o.type == 'out_invoice' and o.state == 'cancel') or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para>
- <para style="terp_header"><b>Refund [[ (o.type=='out_refund' or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para>
- <para style="terp_header"><b>Supplier Refund [[ (o.type=='in_refund' or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para>
- <para style="terp_header"><b>Supplier Invoice [[ (o.type=='in_invoice' or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="132.50,132.50,132.50,132.50" style="Table_Invoice_General_Header">
- <tr>
- <td>
- <para style="terp_tblheader_General_Centre"><b>Description</b></para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre"><b>Invoice Date</b></para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre"><b>Source</b></para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre"><b>Customer Code</b></para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="132.50,132.50,132.50,132.50" style="Table_General_Detail_Content">
- <tr>
- <td>
- <para style="terp_default_Centre_9">[[ o.name or ' ' ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_9">[[ formatLang(o.date_invoice,date=True) ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_9">[[ o.origin or '' ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_9">[[ (o.partner_id.ref) or ' ' ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="185.0,70.0,80.0,60.0,50.0,85.0" style="Table7">
- <tr>
- <td>
- <para style="terp_tblheader_General"><b>Description</b></para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre"><b>Taxes</b></para>
- </td>
- <td>
- <para style="terp_tblheader_General_Right"><b>Quantity</b></para>
- </td>
- <td>
- <para style="terp_tblheader_General_Right"><b>Unit Price</b></para>
- </td>
- <td>
- <para style="terp_tblheader_General_Right"><b>Disc.(%)</b></para>
- </td>
- <td>
- <para style="terp_tblheader_General_Right"><b>Price</b></para>
- </td>
- </tr>
- </blockTable>
- <section>
- <para style="terp_default_2">[[ repeatIn(o.invoice_line,'l') ]]</para>
- <blockTable colWidths="185.0,70.0,80.0,60.0,50.0,85.0" style="Table8">
- <tr>
- <td>
- <para style="terp_default_9">[[ format(l.name) ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_9">[[ ', '.join([ lt.name or '' for lt in l.invoice_line_tax_id ]) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang(l.quantity)]] [[ (l.uos_id and l.uos_id.name) or '' ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang(l.price_unit) ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_9">[[ formatLang(l.discount, dp='Account') ]] </para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang(l.price_subtotal, dp='Account', currency_obj=o.currency_id) ]]</para>
- </td>
- </tr>
- </blockTable>
- </section>
- <blockTable colWidths="385.0,60.0,85.0" style="Table10">
- <tr>
- <td>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_9">Net Total:</para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang(o.amount_untaxed, digits=get_digits(dp='Account'), currency_obj=o.currency_id) ]]</para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_9">Taxes:</para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang(o.amount_tax, dp='Account', currency_obj=o.currency_id) ]]</para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_9"><b>Total:</b></para>
- </td>
- <td>
- <para style="terp_default_Bold_Right_9"><b>[[ formatLang(o.amount_total, digits=get_digits(dp='Account'), currency_obj=o.currency_id) ]]</b></para>
- </td>
- </tr>
- </blockTable>
- <para style="Text body">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="205.0,71.0,71.0,183.0" style="Table9">
- <tr>
- <td>
- <para style="terp_tblheader_Details"><b>Tax [[ o.tax_line==[] and removeParentNode('blockTable') ]]</b></para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right"><b>Base </b></para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right"><b>Amount </b></para>
- </td>
- <td>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- </blockTable>
- <section>
- <para style="terp_default_2">[[ repeatIn(o.tax_line,'t') ]]</para>
- <blockTable colWidths="205.0,71.0,71.0,184.0" style="Table2">
- <tr>
- <td>
- <para style="terp_default_8">[[ t.name ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_8">[[ formatLang(t.base, dp='Account', currency_obj=o.currency_id) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_8">[[ (t.tax_code_id and t.tax_code_id.notprintable) and removeParentNode('blockTable') or '' ]] [[ formatLang(t.amount, digits=get_digits(dp='Account'), currency_obj=o.currency_id) ]]</para>
- </td>
- <td>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- </blockTable>
- </section>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- <para style="terp_default_9">[[ (o.comment and format(o.comment )) or removeParentNode('para') ]]</para>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <para style="terp_default_9">[[ (o.payment_term and o.payment_term.note and format(o.payment_term and o.payment_term.note)) or removeParentNode('para') ]]</para>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="120.0,410.0" style="Table1">
- <tr>
- <td>
- <para style="terp_default_Bold_9"><b>Fiscal Position Remark : </b></para>
- </td>
- <td>
- <para style="terp_default_9">[[ (o.fiscal_position and o.fiscal_position.note and format(o.fiscal_position.note)) or removeParentNode('blockTable') ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_2">
- <font color="white"> </font>
- </para>
- </pto>
- </story>
-</document>
diff --git a/addons/account/report/account_print_overdue.py b/addons/account/report/account_print_overdue.py
index e135f41309d..26192d39949 100644
--- a/addons/account/report/account_print_overdue.py
+++ b/addons/account/report/account_print_overdue.py
@@ -22,15 +22,36 @@
import time
from openerp.report import report_sxw
+from openerp.osv import osv
+
class Overdue(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(Overdue, self).__init__(cr, uid, name, context=context)
- self.localcontext.update( {
+ ids = context.get('active_ids')
+ partner_obj = self.pool['res.partner']
+ docs = partner_obj.browse(cr, uid, ids, context)
+
+ due = {}
+ paid = {}
+ mat = {}
+
+ for partner in docs:
+ due[partner.id] = reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['debit'] or 0) or (y['account_id']['type'] == 'payable' and y['credit'] * -1 or 0)), self._lines_get(partner), 0)
+ paid[partner.id] = reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['credit'] or 0) or (y['account_id']['type'] == 'payable' and y['debit'] * -1 or 0)), self._lines_get(partner), 0)
+ mat[partner.id] = reduce(lambda x, y: x + (y['debit'] - y['credit']), filter(lambda x: x['date_maturity'] < time.strftime('%Y-%m-%d'), self._lines_get(partner)), 0)
+
+ addresses = self.pool['res.partner']._address_display(cr, uid, ids, None, None)
+ self.localcontext.update({
+ 'docs': docs,
'time': time,
'getLines': self._lines_get,
'tel_get': self._tel_get,
'message': self._message,
+ 'due': due,
+ 'paid': paid,
+ 'mat': mat,
+ 'addresses': addresses
})
self.context = context
@@ -41,7 +62,7 @@ class Overdue(report_sxw.rml_parse):
addresses = res_partner.address_get(self.cr, self.uid, [partner.id], ['invoice'])
adr_id = addresses and addresses['invoice'] or False
if adr_id:
- adr=res_partner_address.read(self.cr, self.uid, [adr_id])[0]
+ adr=res_partner.read(self.cr, self.uid, [adr_id])[0]
return adr['phone']
else:
return partner.phone or False
@@ -62,5 +83,10 @@ class Overdue(report_sxw.rml_parse):
return message.split('\n')
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+class report_overdue(osv.AbstractModel):
+ _name = 'report.account.report_overdue'
+ _inherit = 'report.abstract_report'
+ _template = 'account.report_overdue'
+ _wrapped_report_class = Overdue
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/report/account_print_overdue.rml b/addons/account/report/account_print_overdue.rml
deleted file mode 100644
index 9d1898572ba..00000000000
--- a/addons/account/report/account_print_overdue.rml
+++ /dev/null
@@ -1,290 +0,0 @@
-<?xml version="1.0"?>
-<document filename="Overdue Payments.pdf">
- <template title="Overdue Payments" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
- <pageTemplate id="first">
- <frame id="first" x1="42.0" y1="28.0" width="511" height="786"/>
- </pageTemplate>
- </template>
- <stylesheet>
- <blockTableStyle id="Standard_Outline">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Tableau2">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table1">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="7,-1" stop="7,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table3">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="7,-1" stop="7,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table2">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="3,0" stop="3,0"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="4,0" stop="4,0"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="5,0" stop="5,0"/>
- </blockTableStyle>
- <blockTableStyle id="Table4">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="3,0" stop="3,0"/>
- </blockTableStyle>
- <initialize>
- <paraStyle name="all" alignment="justify"/>
- </initialize>
- <paraStyle name="Standard" fontName="Helvetica"/>
- <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Table Contents" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Caption" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="Index" fontName="Helvetica"/>
- <paraStyle name="Heading" fontName="Helvetica" fontSize="15.0" leading="19" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Footer" fontName="Helvetica"/>
- <paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
- <paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_10" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="2.0"/>
- <paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <images/>
- </stylesheet>
- <story>
- <pto>
- <pto_header>
- <blockTable colWidths="57.0,136.0,51.0,72.0,54.0,56.0,66.0,18.0" style="Table1">
- <tr>
- <td>
- <para style="terp_tblheader_Details">Date</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Description</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Ref</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Maturity date</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Due</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Paid</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Maturity</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Li.</para>
- </td>
- </tr>
- </blockTable>
- </pto_header>
- <para style="terp_default_8">[[ repeatIn(objects,'o') ]]</para>
- <para style="terp_default_8">[[ setLang(o.lang) ]]</para>
- <blockTable colWidths="286.0,224.0" style="Tableau2">
- <tr>
- <td>
- </td>
- <td>
- <para style="terp_default_9">[[ o.title.name or '' ]] [[ o.name ]]</para>
- <para style="terp_default_9">[[ display_address(o) ]]</para>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- <para style="terp_default_9">VAT: [[ o.vat or removeParentNode('para') ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <para style="terp_default_9">Document: Customer account statement</para>
- <para style="terp_default_9">Date: [[ formatLang(time.strftime('%Y-%m-%d'),date=True) ]]</para>
- <para style="terp_default_9">Customer Ref: [[ o.ref or ' ']]</para>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- <section>
- <para style="terp_default_8">[[ not getLines(o) and removeParentNode('section')]]</para>
- <section>
- <para>[[repeatIn(message(o, company), 'message_line') ]]</para>
- <para style="terp_default_9">[[ message_line ]]</para>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- </section>
- <blockTable colWidths="56.0,136.0,51.0,72.0,54.0,56.0,66.0,18.0" style="Table1">
- <tr>
- <td>
- <para style="terp_tblheader_Details">Date</para>
- </td>
- <td>
- <para style="terp_tblheader_Details">Description</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Ref</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Maturity date</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Due</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Paid</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Maturity</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Li.</para>
- </td>
- </tr>
- </blockTable>
- <section>[[repeatIn(getLines(o), 'line') ]]
- <blockTable colWidths="56.0,136.0,52.0,71.0,55.0,56.0,66.0,17.0" style="Table3">
- <tr>
- <td>
- <para style="terp_default_9">[[ formatLang(line['date'],date=True) ]]</para>
- </td>
- <td>
- <para style="terp_default_9">[[ line['name'] ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_9">[[ line['ref'] ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_9">[[ line['date_maturity'] and formatLang(line['date_maturity'],date=True) or '' ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ (line['account_id']['type'] == 'receivable' and formatLang(line['debit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['credit'] * -1) or ' ') ]] </para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ (line['account_id']['type'] == 'receivable' and formatLang(line['credit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['debit'] * -1) or 0) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ (time.strftime('%Y-%m-%d') &gt; line['date_maturity']) and formatLang(line['debit'] - line['credit'], currency_obj = company.currency_id) ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_9">[[ line['blocked'] and 'X' or '' ]]</para>
- </td>
- </tr>
- </blockTable>
- </section>
- <blockTable colWidths="244.0,71.0,56.0,56.0,66.0,17.0" style="Table2">
- <tr>
- <td>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_Bold_9">Sub-Total :</para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['debit'] or 0) or (y['account_id']['type'] == 'payable' and y['credit'] * -1 or 0)), getLines(o), 0))) ]] </para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['credit'] or 0) or (y['account_id']['type'] == 'payable' and y['debit'] * -1 or 0)), getLines(o), 0))) ]] </para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x + (y['debit'] - y['credit']), filter(lambda x: x['date_maturity'] &lt; time.strftime('%Y-%m-%d'), getLines(o)), 0)), currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="244.0,71.0,62.0,132.0" style="Table4">
- <tr>
- <td>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_Bold_9">Balance :</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">[[ formatLang((reduce(lambda x, y: x +(y['debit'] - y['credit']), getLines(o), 0)), currency_obj = company.currency_id) ]]</para>
- </td>
- <td>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- <para style="terp_default_9">Total amount due: [[ formatLang((reduce(lambda x, y: x + (y['debit'] - y['credit']), getLines(o), 0)), currency_obj=company.currency_id) ]]</para>
- </section>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- <section>
- <para style="terp_default_Bold_9">[[ getLines(o) and removeParentNode('section')]]There is nothing due with this customer.</para>
- </section>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- </pto>
- </story>
-</document>
diff --git a/addons/account/report/report_vat.py b/addons/account/report/report_vat.py
index 3a0950ac62f..be2b6244f7d 100644
--- a/addons/account/report/report_vat.py
+++ b/addons/account/report/report_vat.py
@@ -19,24 +19,16 @@
#
##############################################################################
+import time
from openerp.osv import osv
-from openerp.addons.web import http
-from openerp.addons.web.http import request
+from openerp.report import report_sxw
from common_report_header import common_report_header
-try:
- import cStringIO as StringIO
-except ImportError:
- import StringIO
-import xlwt
-class tax_report(osv.AbstractModel, common_report_header):
- _name = 'report.account.report_vat'
-
- def render_html(self, cr, uid, ids, data=None, context=None):
- report_obj = request.registry['report']
- self.cr, self.uid, self.context = cr, uid, context
+class tax_report(report_sxw.rml_parse, common_report_header):
+ def set_context(self, objects, data, ids, report_type=None):
+ new_ids = ids
res = {}
self.period_ids = []
period_obj = self.pool.get('account.period')
@@ -46,30 +38,42 @@ class tax_report(osv.AbstractModel, common_report_header):
if data['form'].get('period_from', False) and data['form'].get('period_to', False):
self.period_ids = period_obj.build_ctx_periods(self.cr, self.uid, data['form']['period_from'], data['form']['period_to'])
-
- docargs = {
- 'fiscalyear': self._get_fiscalyear(data),
- 'account': self._get_account(data),
- 'based_on': self._get_basedon(data),
- 'period_from': self.get_start_period(data),
- 'period_to': self.get_end_period(data),
- 'taxlines': self._get_lines(self._get_basedon(data), company_id=data['form']['company_id'], cr=cr, uid=uid),
- }
- return report_obj.render(self.cr, self.uid, [], 'account.report_vat', docargs, context=context)
+ periods_l = period_obj.read(self.cr, self.uid, self.period_ids, ['name'])
+ for period in periods_l:
+ if res['periods'] == '':
+ res['periods'] = period['name']
+ else:
+ res['periods'] += ", "+ period['name']
+ return super(tax_report, self).set_context(objects, data, new_ids, report_type=report_type)
+
+ def __init__(self, cr, uid, name, context=None):
+ super(tax_report, self).__init__(cr, uid, name, context=context)
+ self.localcontext.update({
+ 'time': time,
+ 'get_codes': self._get_codes,
+ 'get_general': self._get_general,
+ 'get_currency': self._get_currency,
+ 'get_lines': self._get_lines,
+ 'get_fiscalyear': self._get_fiscalyear,
+ 'get_account': self._get_account,
+ 'get_start_period': self.get_start_period,
+ 'get_end_period': self.get_end_period,
+ 'get_basedon': self._get_basedon,
+ })
def _get_basedon(self, form):
return form['form']['based_on']
- def _get_lines(self, based_on, company_id=False, parent=False, level=0, context=None, cr=None, uid=None):
+ def _get_lines(self, based_on, company_id=False, parent=False, level=0, context=None):
period_list = self.period_ids
- res = self._get_codes(based_on, company_id, parent, level, period_list, cr=cr, uid=uid, context=context)
+ res = self._get_codes(based_on, company_id, parent, level, period_list, context=context)
if period_list:
res = self._add_codes(based_on, res, period_list, context=context)
else:
- cr.execute ("select id from account_fiscalyear")
- fy = cr.fetchall()
- cr.execute ("select id from account_period where fiscalyear_id = %s",(fy[0][0],))
- periods = cr.fetchall()
+ self.cr.execute ("select id from account_fiscalyear")
+ fy = self.cr.fetchall()
+ self.cr.execute ("select id from account_period where fiscalyear_id = %s",(fy[0][0],))
+ periods = self.cr.fetchall()
for p in periods:
period_list.append(p[0])
res = self._add_codes(based_on, res, period_list, context=context)
@@ -89,7 +93,7 @@ class tax_report(osv.AbstractModel, common_report_header):
}
top_result.append(res_dict)
- res_general = self._get_general(res[i][1].id, period_list, company_id, based_on, cr=cr, uid=uid, context=context)
+ res_general = self._get_general(res[i][1].id, period_list, company_id, based_on, context=context)
ind_general = 0
while ind_general < len(res_general):
res_general[ind_general]['type'] = 2
@@ -100,14 +104,14 @@ class tax_report(osv.AbstractModel, common_report_header):
i+=1
return top_result
- def _get_general(self, tax_code_id, period_list, company_id, based_on, cr=None, uid=None, context=None):
+ def _get_general(self, tax_code_id, period_list, company_id, based_on, context=None):
if not self.display_detail:
return []
res = []
obj_account = self.pool.get('account.account')
periods_ids = tuple(period_list)
if based_on == 'payments':
- cr.execute('SELECT SUM(line.tax_amount) AS tax_amount, \
+ self.cr.execute('SELECT SUM(line.tax_amount) AS tax_amount, \
SUM(line.debit) AS debit, \
SUM(line.credit) AS credit, \
COUNT(*) AS count, \
@@ -131,7 +135,7 @@ class tax_report(osv.AbstractModel, common_report_header):
company_id, periods_ids, 'paid',))
else:
- cr.execute('SELECT SUM(line.tax_amount) AS tax_amount, \
+ self.cr.execute('SELECT SUM(line.tax_amount) AS tax_amount, \
SUM(line.debit) AS debit, \
SUM(line.credit) AS credit, \
COUNT(*) AS count, \
@@ -148,21 +152,23 @@ class tax_report(osv.AbstractModel, common_report_header):
AND account.active \
GROUP BY account.id,account.name,account.code', ('draft', tax_code_id,
company_id, periods_ids,))
- res = cr.dictfetchall()
+ res = self.cr.dictfetchall()
i = 0
while i<len(res):
- res[i]['account'] = obj_account.browse(cr, uid, res[i]['account_id'], context=context)
+ res[i]['account'] = obj_account.browse(self.cr, self.uid, res[i]['account_id'], context=context)
i+=1
return res
- def _get_codes(self, based_on, company_id, parent=False, level=0, period_list=None, cr=None, uid=None, context=None):
+ def _get_codes(self, based_on, company_id, parent=False, level=0, period_list=None, context=None):
obj_tc = self.pool.get('account.tax.code')
- ids = obj_tc.search(cr, uid, [('parent_id', '=', parent), ('company_id', '=', company_id)], order='sequence', context=context)
+ ids = obj_tc.search(self.cr, self.uid, [('parent_id','=',parent),('company_id','=',company_id)], order='sequence', context=context)
+
res = []
- for code in obj_tc.browse(cr, uid, ids, {'based_on': based_on}):
+ for code in obj_tc.browse(self.cr, self.uid, ids, {'based_on': based_on}):
res.append(('.'*2*level, code))
- res += self._get_codes(based_on, company_id, code.id, level+1, cr=cr, uid=uid, context=context)
+
+ res += self._get_codes(based_on, company_id, code.id, level+1, context=context)
return res
def _add_codes(self, based_on, account_list=None, period_list=None, context=None):
@@ -184,7 +190,11 @@ class tax_report(osv.AbstractModel, common_report_header):
res.append((account[0], code))
return res
+ def _get_currency(self, form, context=None):
+ return self.pool.get('res.company').browse(self.cr, self.uid, form['company_id'], context=context).currency_id.name
+
def sort_result(self, accounts, context=None):
+ # On boucle sur notre rapport
result_accounts = []
ind=0
old_level=0
@@ -200,8 +210,7 @@ class tax_report(osv.AbstractModel, common_report_header):
bcl_rup_ind = ind - 1
while (bcl_current_level >= int(accounts[bcl_rup_ind]['level']) and bcl_rup_ind >= 0 ):
- res_tot = {
- 'code': accounts[bcl_rup_ind]['code'],
+ res_tot = { 'code': accounts[bcl_rup_ind]['code'],
'name': '',
'debit': 0,
'credit': 0,
@@ -225,40 +234,10 @@ class tax_report(osv.AbstractModel, common_report_header):
return result_accounts
-class tax_report_xls(http.Controller):
-
- @http.route(['/report/account.report_vat_xls'], type='http', auth='user', website=True, multilang=True)
- def report_account_tax_xls(self, **data):
-
- # Very ugly lines, only for the proof of concept of 'controller' report
- taxreport_obj = request.registry['report.account.report_vat']
- from openerp.addons.report.controllers.main import ReportController
- eval_params = ReportController()._eval_params
-
- cr, uid = request.cr, request.uid
- data = eval_params(data)
- data = {'form': data}
-
- taxreport_obj.render_html(cr, uid, [], data=data)
- lines = taxreport_obj._get_lines(taxreport_obj._get_basedon(data), company_id=data['form']['company_id'], cr=cr, uid=uid)
-
- if lines:
- xls = StringIO.StringIO()
- xls_workbook = xlwt.Workbook()
- vat_sheet = xls_workbook.add_sheet('report_vat')
-
- for x in range(0, len(lines)):
- for y in range(0, len(lines[0])):
- vat_sheet.write(x, y, lines[x].values()[y])
-
- xls_workbook.save(xls)
- xls.seek(0)
- content = xls.read()
-
- response = request.make_response(content, headers=[
- ('Content-Type', 'application/vnd.ms-excel'),
- ('Content-Disposition', 'attachment; filename=report_vat.xls;')
- ])
- return response
+class report_vat(osv.AbstractModel):
+ _name = 'report.account.report_vat'
+ _inherit = 'report.abstract_report'
+ _template = 'account.report_vat'
+ _wrapped_report_class = tax_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/test/account_report.yml b/addons/account/test/account_report.yml
index 7a2d09486e4..9173c37b61e 100644
--- a/addons/account/test/account_report.yml
+++ b/addons/account/test/account_report.yml
@@ -16,10 +16,9 @@
import os
import openerp.report
from openerp import tools
- data, format = openerp.report.render_report(cr, uid, [ref('account.account_invoice_customer0')], 'account.invoice', {}, {})
+ data, format = openerp.report.render_report(cr, uid, [ref('account.account_invoice_customer0')], 'account.report_invoice', {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'account-invoice.'+format), 'wb+').write(data)
-
-
In order to test the PDF reports defined on a partner, we will print the Overdue Report
-
@@ -27,7 +26,7 @@
import os
import openerp.report
from openerp import tools
- data, format = openerp.report.render_report(cr, uid, [ref('base.res_partner_1'),ref('base.res_partner_2'),ref('base.res_partner_12')], 'account.overdue', {}, {})
+ data, format = openerp.report.render_report(cr, uid, [ref('base.res_partner_1'),ref('base.res_partner_2'),ref('base.res_partner_12')], 'account.report_overdue', {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'account-report_overdue.'+format), 'wb+').write(data)
-
@@ -86,8 +85,8 @@
Print the General Ledger Report in Landscape Mode
-
!python {model: account.account}: |
- ctx={}
- data_dict = {'chart_account_id':ref('account.chart0'),'landscape':True}
+ ctx={'landscape': True}
+ data_dict = {'chart_account_id':ref('account.chart0')}
from openerp.tools import test_reports
test_reports.try_report_action(cr, uid, 'action_account_general_ledger_menu',wiz_data=data_dict, context=ctx, our_module='account')
-
diff --git a/addons/account/views/report_agedpartnerbalance.xml b/addons/account/views/report_agedpartnerbalance.xml
new file mode 100644
index 00000000000..019f32a35de
--- /dev/null
+++ b/addons/account/views/report_agedpartnerbalance.xml
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+<template id="report_agedpartnerbalance">
+ <t t-call="report.html_container">
+ <t t-call="report.internal_layout">
+ <div class="page">
+ <h2>Aged Trial Balance</h2>
+
+ <div class="row mt32">
+ <div class="col-xs-3">
+ <strong>Chart of Accounts:</strong>
+ <p t-esc="get_account(data)"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Fiscal Year:</strong>
+ <p t-esc="get_fiscalyear(data)"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Start Date:</strong>
+ <p t-esc="formatLang(data['form']['date_from'], date=True)"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Period Length (days)</strong>
+ <p t-esc="data['form']['period_length']"/>
+ </div>
+ </div>
+ <div class="row mb32">
+ <div class="col-xs-3">
+ <strong>Partner's:</strong>
+ <p>
+ <span t-if="data['form']['result_selection'] == 'customer'">Receivable Accounts</span>
+ <span t-if="data['form']['result_selection'] == 'supplier'">Payable Accounts</span>
+ <span t-if="data['form']['result_selection'] == 'customer_supplier'">Receivable and Payable Accounts</span>
+ </p>
+ </div>
+ <div class="col-xs-3">
+ <strong>Analysis Direction:</strong>
+ <p t-esc="data['form']['direction_selection']"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Target Moves:</strong>
+ <p t-esc="get_target_move(data)"/>
+ </div>
+ </div>
+
+ <table class="table table-condensed">
+ <thead>
+ <tr>
+ <th>Partners</th>
+ <th class="text-right">
+ <span t-if="data['form']['direction_selection'] == 'future'">Due</span>
+ <span t-if="data['form']['direction_selection'] != 'future'">Not due</span>
+ </th>
+ <th class="text-right"><span t-esc="data['form']['4']['name']"/></th>
+ <th class="text-right"><span t-esc="data['form']['3']['name']"/></th>
+ <th class="text-right"><span t-esc="data['form']['2']['name']"/></th>
+ <th class="text-right"><span t-esc="data['form']['1']['name']"/></th>
+ <th class="text-right"><span t-esc="data['form']['0']['name']"/></th>
+ <th class="text-right">Total</th>
+ </tr>
+ <tr t-if="get_lines(data['form']) or get_lines_with_out_partner(data['form'])">
+ <th>Account Total</th>
+ <th class="text-right"><span t-esc="formatLang(get_direction(6), currency_obj=res_company.currency_id)"/></th>
+ <th class="text-right"><span t-esc="formatLang(get_for_period(4), currency_obj=res_company.currency_id)"/></th>
+ <th class="text-right"><span t-esc="formatLang(get_for_period(3), currency_obj=res_company.currency_id)"/></th>
+ <th class="text-right"><span t-esc="formatLang(get_for_period(2), currency_obj=res_company.currency_id)"/></th>
+ <th class="text-right"><span t-esc="formatLang(get_for_period(1), currency_obj=res_company.currency_id)"/></th>
+ <th class="text-right"><span t-esc="formatLang(get_for_period(0), currency_obj=res_company.currency_id)"/></th>
+ <th class="text-right"><span t-esc="formatLang(get_for_period(5), currency_obj=res_company.currency_id)"/></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr t-foreach="get_lines(data['form'])" t-as="partner">
+ <td>
+ <span t-esc="partner['name']"/>
+ </td>
+ <td class="text-right">
+ <span t-esc="formatLang(partner['direction'], currency_obj=res_company.currency_id)"/>
+ </td>
+ <td class="text-right">
+ <span t-esc="formatLang(partner['4'], currency_obj=res_company.currency_id)"/>
+ </td>
+ <td class="text-right">
+ <span t-esc="formatLang(partner['3'], currency_obj=res_company.currency_id)"/>
+ </td>
+ <td class="text-right">
+ <span t-esc="formatLang(partner['2'], currency_obj=res_company.currency_id)"/>
+ </td>
+ <td class="text-right">
+ <span t-esc="formatLang(partner['1'], currency_obj=res_company.currency_id)"/>
+ </td>
+ <td class="text-right">
+ <span t-esc="formatLang(partner['0'], currency_obj=res_company.currency_id)"/>
+ </td>
+ <td class="text-right">
+ <span t-esc="formatLang(partner['total'], currency_obj=res_company.currency_id)"/>
+ </td>
+ </tr>
+ <tr t-foreach="get_lines_with_out_partner(data['form'])" t-as="not_partner">
+ <td>
+ <span t-esc="partner['name']"/>
+ </td>
+ <td class="text-right">
+ <span t-esc="formatLang(not_partner['direction'], currency_obj=res_company.currency_id)"/>
+ </td>
+ <td class="text-right">
+ <span t-esc="formatLang(not_partner['4'], currency_obj=res_company.currency_id)"/>
+ </td>
+ <td class="text-right">
+ <span t-esc="formatLang(not_partner['3'], currency_obj=res_company.currency_id)"/>
+ </td>
+ <td class="text-right">
+ <span t-esc="formatLang(not_partner['2'], currency_obj=res_company.currency_id)"/>
+ </td>
+ <td class="text-right">
+ <span t-esc="formatLang(not_partner['1'], currency_obj=res_company.currency_id)"/>
+ </td>
+ <td class="text-right">
+ <span t-esc="formatLang(not_partner['0'], currency_obj=res_company.currency_id)"/>
+ </td>
+ <td class="text-right">
+ <span t-esc="formatLang(not_partner['total'], currency_obj=res_company.currency_id)"/>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </t>
+ </t>
+</template>
+</data>
+</openerp>
diff --git a/addons/account/views/report_centraljournal.xml b/addons/account/views/report_centraljournal.xml
new file mode 100644
index 00000000000..e939fa98fc3
--- /dev/null
+++ b/addons/account/views/report_centraljournal.xml
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+<template id="report_centraljournal">
+ <t t-call="report.html_container">
+ <t t-foreach="docs" t-as="o">
+ <t t-call="report.internal_layout">
+ <div class="page">
+ <h2>Centralized Journal</h2>
+
+ <div class="row mt32">
+ <div class="col-xs-3">
+ <strong>Chart of Accounts:</strong>
+ <p t-esc="get_account(data)"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Fiscal Year:</strong>
+ <p t-esc="get_fiscalyear(data)"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Journals:</strong>
+ <p t-field="o.journal_id" />
+ </div>
+ <div class="col-xs-3">
+ <strong>Filter By:</strong>
+ <p>
+ <span t-if="data['form']['filter'] == 'filter_no'">Not filtered</span>
+ <span t-if="data['form']['filter'] == 'filter_period'">Filtered by period</span>
+ <span t-if="data['form']['filter'] == 'filter_date'">Filtered by date</span>
+ <p t-if="data['form']['filter'] == 'filter_period'">
+ Start Period: <span t-esc="get_start_period(data)"/><br/>
+ End Period: <span t-esc="get_end_period(data)"/>
+ </p>
+ <p t-if="data['form']['filter'] == 'filter_date'">
+ Date from : <span t-esc="formatLang(get_start_date(data), date=True)"/><br />
+ Date to : <span t-esc="formatLang(get_end_date(data), date=True)"/>
+ </p>
+ </p>
+ </div>
+ </div>
+
+ <div class="row mb32">
+ <div class="col-xs-3">
+ <strong>Target Moves:</strong>
+ <p t-esc="get_target_move(data)"/>
+ </div>
+ </div>
+
+ <table class="table table-condensed">
+ <thead>
+ <tr>
+ <th>A/C No.</th>
+ <th>Account Name</th>
+ <th class="text-right">Debit</th>
+ <th class="text-right">Credit</th>
+ <th class="text-right">Balance</th>
+ <th t-if="display_currency(data)" class="text-right">Currency</th>
+ </tr>
+ <tr>
+ <th colspan="2">Total:</th>
+ <th class="text-right">
+ <span t-esc="sum_debit(o.period_id.id, o.journal_id.id)"></span>
+ </th>
+ <th class="text-right">
+ <span t-esc="sum_credit(o.period_id.id, o.journal_id.id)"></span>
+ </th>
+ <th class="text-right">
+ <span t-esc="formatLang(sum_credit(o.period_id.id, o.journal_id.id) - sum_debit(o.period_id.id, o.journal_id.id), currency_obj=res_company.currency_id)" class="text-right"></span>
+ </th>
+ <th t-if="display_currency(data)"/>
+ </tr>
+ </thead>
+ <tbody>
+ <tr t-foreach="lines(o.period_id.id, o.journal_id.id)" t-as="line">
+ <td><span t-esc="line['code']"/></td>
+ <td><span t-esc="line['name']"/></td>
+ <td class="text-right"><span t-esc="line['debit']"/></td>
+ <td class="text-right"><span t-esc="line['credit']"/></td>
+ <td class="text-right"><span t-esc="formatLang(line['credit'] - line['debit'], currency_obj=res_company.currency_id)"/></td>
+ <td t-if="display_currency(data)" class="text-right">
+ <span t-esc="line['amount_currency'] if line['amount_currency'] != 0 else ''"/>
+ <span t-esc="line['currency_code']"/>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </t>
+ </t>
+ </t>
+</template>
+</data>
+</openerp>
diff --git a/addons/account/views/report_financial.xml b/addons/account/views/report_financial.xml
new file mode 100644
index 00000000000..69802331a5b
--- /dev/null
+++ b/addons/account/views/report_financial.xml
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+<template id="report_financial">
+ <t t-call="report.html_container">
+ <t t-foreach="docs" t-as="o">
+ <t t-call="report.internal_layout">
+ <div class="page">
+ <h2 t-esc="data['form']['account_report_id'][1]"/>
+
+ <div class="row mt32 mb32">
+ <div class="col-xs-3">
+ <strong>Chart of Accounts:</strong>
+ <p t-esc="get_account(data)"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Fiscal Year:</strong>
+ <p t-esc="get_fiscalyear(data)"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Filter By:</strong>
+ <p>
+ <span t-if="data['form']['filter'] == 'filter_no'">Not filtered</span>
+ <span t-if="data['form']['filter'] == 'filter_period'">Filtered by period</span>
+ <span t-if="data['form']['filter'] == 'filter_date'">Filtered by date</span>
+ <p t-if="data['form']['filter'] == 'filter_period'">
+ Start Period: <span t-esc="get_start_period(data)"/>
+ End Period: <span t-esc="get_end_period(data)"/>
+ </p>
+ <p t-if="data['form']['filter'] == 'filter_date'">
+ Date from : <span t-esc="formatLang(get_start_date(data), date=True)"/><br />
+ Date to : <span t-esc="formatLang(get_end_date(data), date=True)"/>
+ </p>
+ </p>
+ </div>
+ <div class="col-xs-3">
+ <strong>Target Moves:</strong>
+ <p t-esc="get_target_move(data)"/>
+ </div>
+ </div>
+
+ <table class="table table-condensed" t-if="data['form']['debit_credit'] == 1">
+ <thead>
+ <tr>
+ <th>Name</th>
+ <th class="text-right">Debit</th>
+ <th class="text-right">Credit</th>
+ <th class="text-right">Balance</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr t-foreach="get_lines(data)" t-as="a">
+ <t t-if="a['level'] != 0">
+ <t t-if="a.get('level') &gt; 3"><t t-set="style" t-value="'font-weight: normal;'"/></t>
+ <t t-if="not a.get('level') &gt; 3"><t t-set="style" t-value="'font-weight: bold;'"/></t>
+
+ <td>
+ <span style="color: white;" t-esc="'..' * a.get('level', 0)"/>
+ <span t-att-style="style" t-esc="a.get('name')"/>
+ </td>
+ <td class="text-right" style="white-space: nowrap;">
+ <span t-att-style="style" t-esc="formatLang(a.get('debit'), currency_obj=res_company.currency_id)"/>
+ </td>
+ <td class="text-right" style="white-space: nowrap;">
+ <span t-att-style="style" t-esc="formatLang(a.get('credit'), currency_obj=res_company.currency_id)"/>
+ </td>
+ <td class="text-right" style="white-space: nowrap;">
+ <span t-att-style="style" t-esc="formatLang(a.get('balance'), currency_obj=res_company.currency_id)"/>
+ </td>
+ </t>
+ </tr>
+ </tbody>
+ </table>
+
+ <table class="table table-condensed" t-if="not data['form']['enable_filter'] and not data['form']['debit_credit']">
+ <thead>
+ <tr>
+ <th>Name</th>
+ <th class="text-right">Balance</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr t-foreach="get_lines(data)" t-as="a">
+ <t t-if="a['level'] != 0">
+ <t t-if="a.get('level') &gt; 3"><t t-set="style" t-value="'font-weight: normal;'"/></t>
+ <t t-if="not a.get('level') &gt; 3"><t t-set="style" t-value="'font-weight: bold;'"/></t>
+
+ <td>
+ <span style="color: white;" t-esc="'..' * a.get('level', 0)"/>
+ <span t-att-style="style" t-esc="a.get('name')"/>
+ </td>
+ <td class="text-right"><span t-att-style="style" t-esc="formatLang(a.get('balance'), currency_obj=res_company.currency_id)"/></td>
+ </t>
+ </tr>
+ </tbody>
+ </table>
+
+ <table class="table table-condensed" t-if="data['form']['enable_filter'] == 1 and not data['form']['debit_credit']">
+ <thead>
+ <tr>
+ <th>Name</th>
+ <th class="text-right">Balance</th>
+ <th class="text-right"><span t-esc="data['form']['label_filter']"/></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr t-foreach="get_lines(data)" t-as="a">
+ <t t-if="a['level'] != 0">
+ <t t-if="a.get('level') &gt; 3"><t t-set="style" t-value="'font-weight: normal;'"/></t>
+ <t t-if="not a.get('level') &gt; 3"><t t-set="style" t-value="'font-weight: bold;'"/></t>
+
+ <td>
+ <span style="color: white;" t-esc="'..' * a.get('level', 0)"/>
+ <span t-att-style="style" t-esc="a.get('name')"/>
+ </td>
+ <td class="text-right"><span t-att-style="style" t-esc="formatLang(a.get('balance'), currency_obj=res_company.currency_id)"/></td>
+ <td class="text-right"><span t-att-style="style" t-esc="formatLang(a.get('balance_cmp'), currency_obj=res_company.currency_id)"/></td>
+ </t>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </t>
+ </t>
+ </t>
+</template>
+</data>
+</openerp>
diff --git a/addons/account/views/report_generaljournal.xml b/addons/account/views/report_generaljournal.xml
new file mode 100644
index 00000000000..062c9ec2554
--- /dev/null
+++ b/addons/account/views/report_generaljournal.xml
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+<template id="report_generaljournal">
+ <t t-call="report.html_container">
+ <t t-foreach="periods(docs)" t-as="o">
+ <t t-call="report.internal_layout">
+ <div class="page">
+ <h2>General Journal</h2>
+
+ <div class="row mt32">
+ <div class="col-xs-3">
+ <strong>Chart of Accounts:</strong>
+ <p t-esc="get_account(data)"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Fiscal Year:</strong>
+ <p t-esc="get_fiscalyear(data)"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Journals:</strong>
+ <p t-esc="', '.join([ lt or '' for lt in get_journal(data)])"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Filter By:</strong>
+ <p>
+ <span t-if="data['form']['filter'] == 'filter_no'">Not filtered</span>
+ <span t-if="data['form']['filter'] == 'filter_period'">Filtered by period</span>
+ <span t-if="data['form']['filter'] == 'filter_date'">Filtered by date</span>
+ <p t-if="data['form']['filter'] == 'filter_period'">
+ Start Period: <span t-esc="get_start_period(data)"/>
+ End Period: <span t-esc="get_end_period(data)"/>
+ </p>
+ <p t-if="data['form']['filter'] == 'filter_date'">
+ Date from : <span t-esc="formatLang(get_start_date(data), date=True)"/><br />
+ Date to : <span t-esc="formatLang(get_end_date(data), date=True)"/>
+ </p>
+ </p>
+ </div>
+ </div>
+ <div class="row mb32">
+ <div class="col-xs-3">
+ <strong>Target Moves:</strong>
+ <p t-esc="get_target_move(data)"/>
+ </div>
+ </div>
+
+ <table class="table table-condensed">
+ <thead>
+ <tr>
+ <th>Code</th>
+ <th>Journal Name</th>
+ <th>Debit</th>
+ <th>Credit</th>
+ <th>Balance</th>
+ <th t-if="display_currency(data)">Currency</th>
+ </tr>
+ <tr>
+ <th>Total:</th>
+ <th></th>
+ <th><span t-esc="formatLang(sum_debit())"/></th>
+ <th><span t-esc="formatLang(sum_credit())"/></th>
+ <th><span t-esc="formatLang(sum_credit() - sum_debit(), currency_obj=res_company.currency_id)"/></th>
+ <th t-if="display_currency(data)"></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr style="font-weight: bold;">
+ <td><span t-field="o.name"/>:</td>
+ <td></td>
+ <td><span t-esc="formatLang(sum_debit_period(o.id))"/></td>
+ <td><span t-esc="formatLang(sum_credit_period(o.id))"/></td>
+ <td><span t-esc="formatLang(sum_credit_period(o.id) - sum_debit_period(o.id), currency_obj=res_company.currency_id)"/></td>
+ <td t-if="display_currency(data)"></td>
+ </tr>
+ <tr t-foreach="lines(o.id)" t-as="line">
+ <td><span t-esc="line['code']"/></td>
+ <td><span t-esc="line['name']"/></td>
+ <td><span t-esc="line['debit']"/></td>
+ <td><span t-esc="line['credit']"/></td>
+ <td><span t-esc="formatLang(line['credit'] - line['debit'], currency_obj=res_company.currency_id)"/></td>
+
+ <td t-if="display_currency(data)">
+ <t t-if="line['amount_currency']">
+ <span t-esc="formatLang(line['amount_currency'])"/>
+ <span t-esc="line['currency_code']"/>
+ </t>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </t>
+ </t>
+ </t>
+</template>
+</data>
+</openerp>
diff --git a/addons/account/views/report_generalledger.xml b/addons/account/views/report_generalledger.xml
new file mode 100644
index 00000000000..d873571dee3
--- /dev/null
+++ b/addons/account/views/report_generalledger.xml
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+
+<template id="report_generalledger">
+ <t t-call="report.html_container">
+ <t t-set="data_report_margin_top" t-value="12"/>
+ <t t-set="data_report_header_spacing" t-value="9"/>
+ <t t-set="data_report_dpi" t-value="110"/>
+
+ <t t-foreach="docs" t-as="o">
+ <t t-call="report.internal_layout">
+ <div class="page">
+ <h2><span t-esc="res_company.name"/>: General ledger</h2>
+
+ <div class="row mt32">
+ <div class="col-xs-3">
+ <strong>Chart of Accounts:</strong>
+ <p t-esc="get_account(data)"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Fiscal Year:</strong>
+ <p t-esc="get_fiscalyear(data)"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Journals:</strong>
+ <p t-esc="', '.join([ lt or '' for lt in get_journal(data) ])"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Display Account</strong>
+ <p>
+ <span t-if="data['form']['display_account'] == 'all'">All accounts'</span>
+ <span t-if="data['form']['display_account'] == 'movement'">With movements</span>
+ <span t-if="data['form']['display_account'] == 'not_zero'">With balance not equal to zero</span>
+ </p>
+ </div>
+ </div>
+ <div class="row mb32">
+ <div class="col-xs-3">
+ <strong>Filter By:</strong>
+ <p>
+ <span t-if="data['form']['filter'] == 'filter_no'">Not filtered</span>
+ <span t-if="data['form']['filter'] == 'filter_period'">Filtered by period</span>
+ <span t-if="data['form']['filter'] == 'filter_date'">Filtered by date</span>
+ <p t-if="data['form']['filter'] == 'filter_period'">
+ Start Period: <span t-esc="get_start_period(data)"/>
+ End Period: <span t-esc="get_end_period(data)"/>
+ </p>
+ <p t-if="data['form']['filter'] == 'filter_date'">
+ Date from : <span t-esc="formatLang(get_start_date(data), date=True)"/><br />
+ Date to : <span t-esc="formatLang(get_end_date(data), date=True)"/>
+ </p>
+ </p>
+ </div>
+ <div class="col-xs-3">
+ <strong>Sorted By:</strong>
+ <p t-esc="get_sortby(data)"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Target Moves:</strong>
+ <p t-esc="get_target_move(data)"/>
+ </div>
+ </div>
+
+ <table class="table table-condensed">
+ <thead>
+ <tr class="text-center">
+ <th>Date</th>
+ <th>JRNL</th>
+ <th>Partner</th>
+ <th>Ref</th>
+ <th>Move</th>
+ <th>Entry Label</th>
+ <th>Counterpart</th>
+ <th>Debit</th>
+ <th>Credit</th>
+ <th>Progress</th>
+ <th t-if="data['form']['amount_currency']">Currency</th>
+ </tr>
+ </thead>
+ <tbody>
+ <t t-foreach="get_children_accounts(o)" t-as="childrenaccount">
+ <tr style="font-weight: bold;">
+ <td colspan="7">
+ <span style="color: white;" t-esc="'..'* (childrenaccount['level'] - 1)"/>
+ <span t-esc="childrenaccount['code']"/>
+ <span t-esc="childrenaccount['name']"/>
+ </td>
+ <td class="text-right">
+ <span t-esc="formatLang(sum_debit_account(childrenaccount), digits=get_digits(dp='Account'), currency_obj=res_company.currency_id)"/>
+ </td>
+ <td class="text-right">
+ <span t-esc="formatLang(sum_credit_account(childrenaccount), digits=get_digits(dp='Account'), currency_obj=res_company.currency_id)"/>
+ </td>
+ <td class="text-right">
+ <span t-esc="formatLang(sum_balance_account(childrenaccount), digits=get_digits(dp='Account'), currency_obj=res_company.currency_id)"/>
+ </td>
+ <td class="text-right" t-if="data['form']['amount_currency']">
+ <span t-esc="formatLang(sum_currency_amount_account(childrenaccount), digits=get_digits(dp='Account'), currency_obj=res_company.currency_id) if sum_currency_amount_account(childrenaccount) > 0.00 else ''"/>
+ </td>
+ </tr>
+ <tr t-foreach="lines(childrenaccount)" t-as="line">
+ <td><span t-esc="formatLang(line['ldate'], date=True)"/></td>
+ <td><span t-esc="line['lcode']"/></td>
+ <td><span t-esc="line['partner_name']"/></td>
+ <td><span t-if="line['lref']" t-esc="line['lref']"/></td>
+ <td><span t-esc="line['move']"/></td>
+ <td><span t-esc="line['lname']"/></td>
+ <td><span t-esc="line['line_corresp'].replace(',',', ')"/></td>
+ <td class="text-right">
+ <span t-esc="formatLang(line['debit'], digits=get_digits(dp='Account'), currency_obj=res_company.currency_id)"/>
+ </td>
+ <td class="text-right">
+ <span t-esc="formatLang(line['credit'], digits=get_digits(dp='Account'), currency_obj=res_company.currency_id)"/>
+ </td>
+ <td class="text-right">
+ <span t-esc="formatLang(line['progress'], digits=get_digits(dp='Account'), currency_obj=res_company.currency_id)"/>
+ </td>
+ <td class="text-right" t-if="data['form']['amount_currency']">
+ <span t-esc="formatLang(line['amount_currency'], currency_obj=res_company.currency_id) if line['amount_currency'] > 0.00 else ''"/>
+ <span t-esc="line['currency_code'] if line['amount_currency'] > 0.00 else ''"/>
+ </td>
+ </tr>
+ </t>
+ </tbody>
+ </table>
+ </div>
+ </t>
+ </t>
+ </t>
+</template>
+</data>
+</openerp>
diff --git a/addons/account/views/report_invoice.xml b/addons/account/views/report_invoice.xml
new file mode 100644
index 00000000000..6757095a7d4
--- /dev/null
+++ b/addons/account/views/report_invoice.xml
@@ -0,0 +1,153 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+<template id="report_invoice_document">
+ <t t-call="report.external_layout">
+ <div class="page">
+ <div class="row">
+ <div class="col-xs-4 col-xs-offset-8">
+ <address t-field="o.partner_id"
+ t-field-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}' />
+ <span t-field="o.partner_id.vat"/>
+ </div>
+ </div>
+
+ <h2>
+ <span t-if="o.type == 'out_invoice' and (o.state == 'open' or o.state == 'paid')">Invoice</span>
+ <span t-if="o.type == 'out_invoice' and o.state == 'proforma2'">PRO-FORMA</span>
+ <span t-if="o.type == 'out_invoice' and o.state == 'draft'">Draft Invoice</span>
+ <span t-if="o.type == 'out_invoice' and o.state == 'cancel'">Cancelled Invoice</span>
+ <span t-if="o.type == 'out_refund'">Refund</span>
+ <span t-if="o.type == 'in_refund'">Supplier Refund</span>
+ <span t-if="o.type == 'in_invoice'">Supplier Invoice</span>
+ <span t-field="o.number"/>
+ </h2>
+
+ <div class="row mt32 mb32">
+ <div class="col-xs-3" t-if="o.name">
+ <strong>Description:</strong>
+ <p t-field="o.name"/>
+ </div>
+ <div class="col-xs-3" t-if="o.date_invoice">
+ <strong>Invoice Date:</strong>
+ <p t-field="o.date_invoice"/>
+ </div>
+ <div class="col-xs-3" t-if="o.origin">
+ <strong>Source:</strong>
+ <p t-field="o.origin"/>
+ </div>
+ <div class="col-xs-3" t-if="o.partner_id.ref">
+ <strong>Customer Code:</strong>
+ <p t-field="o.partner_id.ref"/>
+ </div>
+ </div>
+
+ <table class="table table-condensed">
+ <thead>
+ <tr>
+ <th>Description</th>
+ <th>Quantity</th>
+ <th groups="product.group_uom">Unit of measure</th>
+ <th class="text-right">Unit Price</th>
+ <th class="text-right" groups="sale.group_discount_per_so_line">Discount (%)</th>
+ <th class="text-right">Taxes</th>
+ <th class="text-right">Amount</th>
+ </tr>
+ </thead>
+ <tbody class="invoice_tbody">
+ <tr t-foreach="o.invoice_line" t-as="l">
+ <td><span t-field="l.name"/></td>
+ <td><span t-field="l.quantity"/></td>
+ <td groups="product.group_uom"><span t-field="l.uos_id"/></td>
+ <td class="text-right">
+ <span t-field="l.price_unit"/>
+ </td>
+ <td groups="sale.group_discount_per_so_line"><span t-field="l.discount"/></td>
+ <td class="text-right">
+ <span t-esc="', '.join(map(lambda x: x.name, l.invoice_line_tax_id))"/>
+ </td>
+ <td class="text-right">
+ <span t-field="l.price_subtotal"
+ t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+ <div class="row">
+ <div class="col-xs-4 pull-right">
+ <table class="table table-condensed">
+ <tr class="border-black">
+ <td><strong>Total Without Taxes</strong></td>
+ <td class="text-right">
+ <span t-field="o.amount_untaxed" t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
+ </td>
+ </tr>
+ <tr>
+ <td>Taxes</td>
+ <td class="text-right">
+ <span t-field="o.amount_tax" t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
+ </td>
+ </tr>
+ <tr class="border-black">
+ <td><strong>Total</strong></td>
+ <td class="text-right">
+ <span t-field="o.amount_total" t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+
+ <div class="row" t-if="o.tax_line">
+ <div class="col-xs-3">
+ <table class="table table-condensed">
+ <thead>
+ <tr>
+ <th>Tax</th>
+ <th class="text-right">Base</th>
+ <th class="text-right">Amount</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr t-foreach="o.tax_line" t-as="t">
+ <td><span t-field="t.name"/></td>
+ <td class="text-right">
+ <span t-field="t.base"
+ t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
+ </td>
+ <td class="text-right">
+ <span t-field="t.amount"
+ t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </div>
+
+ <p t-if="o.comment">
+ <strong>Comment:</strong>
+ <span t-field="o.comment"/>
+ </p>
+ <p t-if="o.payment_term">
+ <strong>Payment Term:</strong>
+ <span t-field="o.payment_term"/>
+ </p>
+ <p t-if="o.fiscal_position">
+ <strong>Fiscal Position:</strong>
+ <span t-field="o.fiscal_position.note"/>
+ </p>
+ </div>
+ </t>
+</template>
+
+<template id="report_invoice">
+ <t t-call="report.html_container">
+ <t t-foreach="doc_ids" t-as="doc_id">
+ <t t-raw="translate_doc(doc_id, doc_model, 'partner_id.lang', 'account.report_invoice_document')"/>
+ </t>
+ </t>
+</template>
+</data>
+</openerp>
diff --git a/addons/account/views/report_journal.xml b/addons/account/views/report_journal.xml
new file mode 100644
index 00000000000..0771b5f5fe9
--- /dev/null
+++ b/addons/account/views/report_journal.xml
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+<template id="report_journal">
+ <t t-call="report.html_container">
+ <t t-foreach="docs" t-as="o">
+ <t t-call="report.internal_layout">
+ <div class="page">
+ <h2>Journal</h2>
+
+ <div class="row mt32">
+ <div class="col-xs-3">
+ <strong>Chart of Accounts:</strong>
+ <p t-esc="get_account(data)"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Fiscal Year:</strong>
+ <p t-esc="get_fiscalyear(data)"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Journal:</strong>
+ <p t-field="o.journal_id.name"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Period:</strong>
+ <p t-field="o.period_id.name"/>
+ </div>
+ </div>
+ <div class="row mb32">
+ <div class="col-xs-3">
+ <strong>Entries Sorted By:</strong>
+ <p t-if="data['form'].get('sort_selection') == 'l.date'">Date</p>
+ <p t-if="data['form'].get('sort_selection') == 'am.name'">Journal Entry Number</p>
+ </div>
+ <div class="col-xs-3">
+ <strong>Target Moves:</strong>
+ <p t-esc="get_target_move(data)"/>
+ </div>
+ </div>
+
+ <table class="table table-condensed">
+ <thead>
+ <tr>
+ <th>Move</th>
+ <th>Date</th>
+ <th>Account</th>
+ <th>Partner</th>
+ <th>Label</th>
+ <th>Debit</th>
+ <th>Credit</th>
+ <th t-if="display_currency(data)">Currency</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr t-foreach="lines(o.period_id.id, o.journal_id.id)" t-as="line">
+ <td><t t-esc="line.move_id.name &lt;&gt; '/' and line.move_id.name or ('*'+str(line.move_id.id))"/></td>
+ <td><t t-esc="formatLang(line.date,date=True)"/></td>
+ <td><span t-field="line.account_id.code"/></td>
+ <td><t t-esc="line.partner_id and line.partner_id.name[:23]"/></td>
+ <td><t t-esc="line.name[:35]"/></td>
+ <td><t t-esc="formatLang(line.debit, currency_obj=res_company.currency_id)"/></td>
+ <td><t t-esc="formatLang(line.credit, currency_obj=res_company.currency_id)"/></td>
+ <td t-if="display_currency(data)">
+ <span t-esc="formatLang(line.amount_currency, currency_obj=line.currency_id) if line.amount_currency else ''"/>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+ <div class="row">
+ <div class="col-xs-4 pull-right">
+ <table class="table table-condensed">
+ <tr>
+ <td><strong>Total</strong></td>
+ <td><strong t-esc="formatLang(sum_debit(o.period_id.id, o.journal_id.id), currency_obj=res_company.currency_id)"/></td>
+ <td><strong t-esc="formatLang(sum_credit(o.period_id.id, o.journal_id.id), currency_obj=res_company.currency_id)"/></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+
+ </div>
+ </t>
+ </t>
+ </t>
+</template>
+</data>
+</openerp>
diff --git a/addons/account/views/report_overdue.xml b/addons/account/views/report_overdue.xml
new file mode 100644
index 00000000000..bc522aa8b9d
--- /dev/null
+++ b/addons/account/views/report_overdue.xml
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+<template id="account.report_overdue_document">
+ <t t-call="report.external_layout">
+ <div class="page">
+ <div class="row">
+ <div class="col-xs-4 col-xs-offset-6">
+ <span t-field="o.name"/><br/>
+ <span t-raw="addresses[o.id].replace('\n\n', '\n').replace('\n', '&lt;br&gt;')"/>
+ <span t-field="o.vat"/>
+ </div>
+ </div>
+
+ <p>
+ Document: Customer account statement<br/>
+ Date: <span t-esc="formatLang(time.strftime('%Y-%m-%d'), date=True)"/><br/>
+ Customer ref: <span t-field="o.ref"/>
+ </p>
+
+ <p t-if="getLines(o)">
+ <t t-foreach="message(o, res_company)" t-as="messageline">
+ <span t-esc="messageline"/>
+ </t>
+ </p>
+
+ <table class="table table-condensed" t-if="getLines(o)">
+ <thead>
+ <tr>
+ <th>Date</th>
+ <th>Description</th>
+ <th class="text-center">Ref</th>
+ <th class="text-center">Maturity Date</th>
+ <th class="text-right">Due</th>
+ <th class="text-right">Paid</th>
+ <th class="text-right">Maturity</th>
+ <th class="text-center">Li.</th>
+ </tr>
+ </thead>
+ <tr t-foreach="getLines(o)" t-as="line">
+ <td>
+ <span t-field="line.date"/>
+ </td>
+ <td>
+ <span t-field="line.name"/>
+ </td>
+ <td>
+ <span t-field="line.ref"/>
+ </td>
+ <td>
+ <span t-field="line.date_maturity"/>
+ </td>
+ <td class="text-right">
+ <t t-if="line.account_id.type == 'receivable'">
+ <span t-esc="formatLang(line.debit)"/>
+ </t>
+ <t t-if="line.account_id.type == 'payable'">
+ <span t-esc="formatLang(line['credit'] * -1)"/>
+ </t>
+ </td>
+ <td class="text-right">
+ <t t-if="line.account_id.type == 'receivable'">
+ <span t-esc="formatLang(line.credit)"/>
+ </t>
+ <t t-if="line.account_id.type == 'payable'">
+ <span t-esc="formatLang(line.debit * -1)"/>
+ </t>
+ </td>
+ <td class="text-right">
+ <t t-if="time.strftime('%Y-%m-%d') &gt; line['date_maturity']">
+ <span t-esc="formatLang(line.debit - line.credit, currency_obj=res_company.currency_id)"/>
+ </t>
+ </td>
+ <td>
+ <span t-if="line.blocked">x</span>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="3"></td>
+ <td><strong>Sub-Total :</strong></td>
+ <td class="text-right"><span t-esc="formatLang(due[o.id])"/></td>
+ <td class="text-right"><span t-esc="formatLang(paid[o.id])"/></td>
+ <td class="text-right"><span t-esc="formatLang(mat[o.id])"/></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td colspan="3"></td>
+ <td><strong>Balance :</strong></td>
+ <td class="text-right">
+ <span t-esc="formatLang(due[o.id] - paid[o.id], currency_obj=res_company.currency_id)"/>
+ </td>
+ <td></td>
+ <td></td>
+ <td></td>
+ </tr>
+ </table>
+
+ <p t-if="getLines(o)">
+ Total amount due:
+ <span t-esc="formatLang((reduce(lambda x, y: x + (y['debit'] - y['credit']), getLines(o), 0)), currency_obj=res_company.currency_id)"/>
+ </p>
+
+ <p t-if="not getLines(o)">
+ <strong>There is nothing due with this customer.</strong>
+ </p>
+ </div>
+ </t>
+</template>
+
+<template id="report_overdue">
+ <t t-call="report.html_container">
+ <t t-foreach="doc_ids" t-as="doc_id">
+ <t t-raw="translate_doc(doc_id, doc_model, 'lang', 'account.report_overdue_document')"/>
+ </t>
+ </t>
+</template>
+</data>
+</openerp>
diff --git a/addons/account/views/report_partnerbalance.xml b/addons/account/views/report_partnerbalance.xml
new file mode 100644
index 00000000000..11948905fe9
--- /dev/null
+++ b/addons/account/views/report_partnerbalance.xml
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+<template id="report_partnerbalance">
+ <t t-call="report.html_container">
+ <t t-call="report.internal_layout">
+ <div class="page">
+ <h2>Partner Balance</h2>
+
+ <div class="row">
+ <div class="col-xs-3">
+ <strong>Chart of Accounts:</strong>
+ <p t-esc="get_account(data)"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Fiscal Year:</strong>
+ <p t-esc="get_fiscalyear(data)"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Journals:</strong>
+ <p t-esc="', '.join([ lt or '' for lt in get_journal(data) ])"/>
+ </div>
+ <div class="col-xs-3" t-if="get_partners()">
+ <strong>Partner's</strong>
+ <p t-esc="get_partners()"/>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-xs-3">
+ <strong>Filter By:</strong>
+ <p>
+ <span t-if="data['form']['filter'] == 'filter_no'">Not filtered</span>
+ <span t-if="data['form']['filter'] == 'filter_period'">Filtered by period</span>
+ <span t-if="data['form']['filter'] == 'filter_date'">Filtered by date</span>
+ <p t-if="data['form']['filter'] == 'filter_period'">
+ Start Period: <span t-esc="get_start_period(data)"/>
+ End Period: <span t-esc="get_end_period(data)"/>
+ </p>
+ <p t-if="data['form']['filter'] == 'filter_date'">
+ Date from : <span t-esc="formatLang(get_start_date(data), date=True)"/><br />
+ Date to : <span t-esc="formatLang(get_end_date(data), date=True)"/>
+ </p>
+ </p>
+ </div>
+ <div class="col-xs-3">
+ <strong>Target Moves:</strong>
+ <p t-esc="get_target_move(data)"/>
+ </div>
+ </div>
+
+ <table class="table table-condensed">
+ <thead>
+ <tr>
+ <th>Code</th>
+ <th>(Account/Partner) Name</th>
+ <th class="text-right">Debit</th>
+ <th class="text-right">Credit</th>
+ <th class="text-right">Balance</th>
+ <th class="text-right">In dispute</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td><strong>Total:</strong></td>
+ <td></td>
+ <td class="text-right">
+ <strong t-esc="formatLang(sum_debit())"/>
+ </td>
+ <td class="text-right">
+ <strong t-esc="formatLang(sum_credit())"/>
+ </td>
+ <td class="text-right">
+ <strong t-esc="formatLang(sum_debit()-sum_credit(), currency_obj=res_company.currency_id)"/>
+ </td>
+ <td class="text-right">
+ <strong t-esc="formatLang(sum_litige(), currency_obj=res_company.currency_id)"/>
+ </td>
+ </tr>
+ <tr t-foreach="lines()" t-as="line">
+ <td t-if="line['type'] == 3">
+ <strong t-esc="line['ref']"/>
+ <span t-esc="line['code']"/>
+ </td>
+ <td t-if="line['type'] != 3">
+ <span t-esc="line['ref']"/>
+ </td>
+ <td t-if="line['type'] == 3">
+ <strong t-esc="line['name']"/>
+ </td>
+ <td t-if="line['type'] != 3">
+ <span t-esc="line['name']"/>
+ </td>
+ <td t-if="line['type'] == 3" class="text-right">
+ <strong t-esc="formatLang(line['debit'])"/>
+ </td>
+ <td t-if="line['type']!=3" class="text-right">
+ <span t-esc="formatLang(line['debit'])"/>
+ </td>
+ <td t-if="line['type']==3" class="text-right">
+ <strong t-esc="formatLang(line['credit'])"/>
+ </td>
+ <td t-if="line['type']!=3" class="text-right">
+ <span t-esc="formatLang(line['credit'])"/>
+ </td>
+ <td t-if="line['type']==3" class="text-right">
+ <strong t-esc="formatLang(line['balance'], currency_obj=res_company.currency_id)"/>
+ </td>
+ <td t-if="line['type']!=3" class="text-right">
+ <span t-esc="formatLang(line['balance'], currency_obj=res_company.currency_id)"/>
+ </td>
+ <td t-if="line['type'] == 3" class="text-right">
+ <strong t-esc="formatLang(line['enlitige'] or 0.0, currency_obj=res_company.currency_id)"/>
+ </td>
+ <td t-if="line['type']!=3" class="text-right">
+ <span t-esc="formatLang(line['enlitige'] or 0.0, currency_obj=res_company.currency_id)"/>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </t>
+ </t>
+</template>
+</data>
+</openerp>
diff --git a/addons/account/views/report_partnerledger.xml b/addons/account/views/report_partnerledger.xml
new file mode 100644
index 00000000000..333fab7aa5c
--- /dev/null
+++ b/addons/account/views/report_partnerledger.xml
@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+<template id="report_partnerledger">
+ <t t-call="report.html_container">
+ <t t-call="report.internal_layout">
+ <div class="page">
+ <h2>Partner Ledger</h2>
+
+ <div class="row">
+ <div class="col-xs-3">
+ <strong>Chart of Accounts:</strong>
+ <p t-esc="get_account(data)"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Fiscal Year:</strong>
+ <p t-esc="get_fiscalyear(data)"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Journals:</strong>
+ <p t-esc="', '.join([ lt or '' for lt in get_journal(data) ])"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Partner's</strong>
+ <p t-esc="get_partners()"/>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-xs-3">
+ <strong>Filter By:</strong>
+ <p>
+ <span t-if="data['form']['filter'] == 'filter_no'">Not filtered</span>
+ <span t-if="data['form']['filter'] == 'filter_period'">Filtered by period</span>
+ <span t-if="data['form']['filter'] == 'filter_date'">Filtered by date</span>
+ <p t-if="data['form']['filter'] == 'filter_period'">
+ Start Period: <span t-esc="get_start_period(data)"/>
+ End Period: <span t-esc="get_end_period(data)"/>
+ </p>
+ <p t-if="data['form']['filter'] == 'filter_date'">
+ Date from : <span t-esc="formatLang(get_start_date(data), date=True)"/><br />
+ Date to : <span t-esc="formatLang(get_end_date(data), date=True)"/>
+ </p>
+ </p>
+ </div>
+ <div class="col-xs-3">
+ <strong>Target Moves:</strong>
+ <p t-esc="get_target_move(data)"/>
+ </div>
+ </div>
+
+ <table class="table table-condensed">
+ <thead>
+ <tr>
+ <th>Date</th>
+ <th>JRNL</th>
+ <th>Ref</th>
+ <th>Account</th>
+ <th>Entry Label</th>
+ <th>Debit</th>
+ <th>Credit</th>
+ <th>Balance</th>
+ <th t-if="amount_currency">Currency</th>
+ </tr>
+ </thead>
+ <tbody>
+ <t t-foreach="docs" t-as="partner">
+ <tr>
+ <td colspan="5">
+ <strong t-esc="partner.ref"/>
+ - <strong t-esc="partner.name"/>
+ </td>
+ <td class="text-right">
+ <strong t-esc="sum_debit_partner(partner)"/>
+ </td>
+ <td class="text-right">
+ <strong t-esc="sum_credit_partner(partner)"/>
+ </td>
+ <td class="text-right">
+ <strong t-esc="formatLang((sum_debit_partner(partner) - sum_credit_partner(partner)), currency_obj=res_company.currency_id)"/>
+ </td>
+ </tr>
+ <tr t-if="initial_balance">
+ <td colspan="5">Initial Balance</td>
+ <td>
+ <span t-esc="formatLang(get_intial_balance(partner)[0][0])"/>
+ </td>
+ <td>
+ <span t-esc="formatLang(get_intial_balance(partner)[0][1])"/>
+ </td>
+ <td>
+ <span t-esc="formatLang(get_intial_balance(partner)[0][2], currency_obj=res_company.currency_id)"/>
+ </td>
+ </tr>
+ <tr t-foreach="lines(partner)" t-as="line">
+ <td>
+ <span t-esc="formatLang(line['date'], date=True)"/>
+ </td>
+ <td>
+ <span t-esc="line['code']"/>
+ </td>
+ <td>
+ <span t-esc="line['move_name']"/>
+ </td>
+ <td>
+ <span t-esc="line['a_code']"/>
+ </td>
+ <td>
+ <span t-esc="line['ref']"/>-<span t-esc="line['name']"/>
+ </td>
+ <td class="text-right">
+ <span t-esc="formatLang((line['debit']))"/>
+ </td>
+ <td class="text-right">
+ <span t-esc="formatLang((line['credit']))"/>
+ </td>
+ <td class="text-right">
+ <span t-esc="formatLang(line['progress'], currency_obj=res_company.currency_id)"/>
+ </td>
+ <td t-if="amount_currency">
+ <span t-esc="formatLang(line['amount_currency'])"/>
+ </td>
+ </tr>
+ </t>
+ </tbody>
+ </table>
+ </div>
+ </t>
+ </t>
+</template>
+</data>
+</openerp>
diff --git a/addons/account/views/report_partnerledgerother.xml b/addons/account/views/report_partnerledgerother.xml
new file mode 100644
index 00000000000..b8f3d525f51
--- /dev/null
+++ b/addons/account/views/report_partnerledgerother.xml
@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+<template id="report_partnerledgerother">
+ <t t-call="report.html_container">
+ <t t-foreach="docs" t-as="partner">
+ <t t-call="report.internal_layout">
+ <div class="page">
+ <h2>Partner Ledger</h2>
+
+ <div class="row">
+ <div class="col-xs-3">
+ <strong>Chart of Accounts:</strong>
+ <p t-esc="get_account(data)"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Fiscal Year:</strong>
+ <p t-esc="get_fiscalyear(data)"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Journals:</strong>
+ <p t-esc="', '.join([ lt or '' for lt in get_journal(data) ])"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Partner's</strong>
+ <p t-esc="get_partners()"/>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-xs-3">
+ <strong>Filter By:</strong>
+ <p>
+ <span t-if="data['form']['filter'] == 'filter_no'">Not filtered</span>
+ <span t-if="data['form']['filter'] == 'filter_period'">Filtered by period</span>
+ <span t-if="data['form']['filter'] == 'filter_date'">Filtered by date</span>
+ <p t-if="data['form']['filter'] == 'filter_period'">
+ Start Period: <span t-esc="get_start_period(data)"/>
+ End Period: <span t-esc="get_end_period(data)"/>
+ </p>
+ <p t-if="data['form']['filter'] == 'filter_date'">
+ Date from : <span t-esc="formatLang(get_start_date(data), date=True)"/><br />
+ Date to : <span t-esc="formatLang(get_end_date(data), date=True)"/>
+ </p>
+ </p>
+ </div>
+ <div class="col-xs-3">
+ <strong>Target Moves:</strong>
+ <p t-esc="get_target_move(data)"/>
+ </div>
+ </div>
+
+ <table class="table table-condensed">
+ <thead>
+ <tr>
+ <th>Date</th>
+ <th>JRNL</th>
+ <th>Ref</th>
+ <th>Account</th>
+ <th>Entry Label</th>
+ <th>Debit</th>
+ <th>Credit</th>
+ <th>Balance</th>
+ <th t-if="amount_currency">Currency</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td colspan="5">
+ <strong t-esc="partner.ref"/>
+ - <strong t-esc="partner.name"/>
+ </td>
+ <td class="text-right">
+ <strong t-esc="sum_debit_partner(partner)"/>
+ </td>
+ <td class="text-right">
+ <strong t-esc="sum_credit_partner(partner)"/>
+ </td>
+ <td class="text-right">
+ <strong t-esc="formatLang((sum_debit_partner(partner) - sum_credit_partner(partner)), currency_obj=res_company.currency_id)"/>
+ </td>
+ </tr>
+ <tr t-if="initial_balance">
+ <td colspan="5">Initial Balance</td>
+ <td>
+ <span t-esc="formatLang(get_intial_balance(partner)[0][0])"/>
+ </td>
+ <td>
+ <span t-esc="formatLang(get_intial_balance(partner)[0][1])"/>
+ </td>
+ <td>
+ <span t-esc="formatLang(get_intial_balance(partner)[0][2], currency_obj=res_company.currency_id)"/>
+ </td>
+ </tr>
+ <tr t-foreach="lines(partner)" t-as="line">
+ <td>
+ <span t-esc="formatLang(line['date'], date=True)"/>
+ </td>
+ <td>
+ <span t-esc="line['code']"/>
+ </td>
+ <td>
+ <span t-esc="line['move_name']"/>
+ </td>
+ <td>
+ <span t-esc="line['a_code']"/>
+ </td>
+ <td>
+ <span t-esc="line['ref']"/>-<span t-esc="line['name']"/>
+ </td>
+ <td class="text-right">
+ <span t-esc="formatLang((line['debit']))"/>
+ </td>
+ <td class="text-right">
+ <span t-esc="formatLang((line['credit']))"/>
+ </td>
+ <td class="text-right">
+ <span t-esc="formatLang(line['progress'], currency_obj=res_company.currency_id)"/>
+ </td>
+ <td t-if="amount_currency">
+ <span t-esc="formatLang(line['amount_currency'])"/>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </t>
+ </t>
+ </t>
+</template>
+</data>
+</openerp>
diff --git a/addons/account/views/report_salepurchasejournal.xml b/addons/account/views/report_salepurchasejournal.xml
new file mode 100644
index 00000000000..f1d8724f285
--- /dev/null
+++ b/addons/account/views/report_salepurchasejournal.xml
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+<template id="report_salepurchasejournal">
+ <t t-call="report.html_container">
+ <t t-foreach="docs" t-as="o">
+ <t t-call="report.internal_layout">
+ <div class="page">
+ <h2>Sale/Purchase Journal</h2>
+
+ <div class="row mt32">
+ <div class="col-xs-3">
+ <strong>Chart of Accounts:</strong>
+ <p t-esc="get_account(data)"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Fiscal Year:</strong>
+ <p t-esc="get_fiscalyear(data)"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Journal:</strong>
+ <p t-field="o.journal_id.name"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Period:</strong>
+ <p t-field="o.period_id.name"/>
+ </div>
+ </div>
+ <div class="row mb32">
+ <div class="col-xs-3">
+ <strong>Entries Sorted By:</strong>
+ <p t-if="data['form'].get('sort_selection') == 'am.name'">Journal Entry Number</p>
+ <p t-if="data['form'].get('sort_selection') == 'l.date'">Date</p>
+ </div>
+ <div class="col-xs-3">
+ <strong>Target Moves:</strong>
+ <p t-esc="get_target_move(data)"/>
+ </div>
+ </div>
+
+ <table class="table table-condensed">
+ <thead>
+ <tr>
+ <th>Move</th>
+ <th>Date</th>
+ <th>Account</th>
+ <th>Partner</th>
+ <th>Label</th>
+ <th>Tax</th>
+ <th>Debit</th>
+ <th>Credit</th>
+ <th t-if="display_currency(data)">Currency</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr t-foreach="lines(o.period_id.id, o.journal_id.id)" t-as="line">
+ <td><span t-esc="line.move_id.name &lt;&gt; '/' and line.move_id.name or ('*'+str(line.move_id.id))"/></td>
+ <td><span t-esc="formatLang(line.date,date=True)"/></td>
+ <td><span t-field="line.account_id.code"/></td>
+ <td><span t-esc="line.partner_id and line.partner_id.name[:23]"/></td>
+ <td><span t-esc="line.name[:35]"/></td>
+ <td><span t-esc="line.tax_amount and formatLang(line.tax_amount, currency_obj=res_company.currency_id)"/></td>
+ <td><span t-esc="formatLang(line.debit, currency_obj=res_company.currency_id)"/></td>
+ <td><span t-esc="formatLang(line.credit, currency_obj=res_company.currency_id)"/></td>
+ <td t-if="display_currency(data)">
+ <span t-esc="formatLang(line.amount_currency, currency_obj=line.currency_id) if line.amount_currency else ''"/>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+ <div class="row">
+ <div class="col-xs-4 pull-right">
+ <table class="table table-condensed">
+ <tr>
+ <td><strong>Total</strong></td>
+ <td><strong t-esc="formatLang(sum_debit(o.period_id.id, o.journal_id.id), currency_obj=res_company.currency_id)"/></td>
+ <td><strong t-esc="formatLang(sum_credit(o.period_id.id, o.journal_id.id), currency_obj=res_company.currency_id)"/></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+
+ <div class="row">
+ <div class="col-xs-4">
+ <table class="table table-condensed">
+ <thead>
+ <tr><th colspan="3">Tax Declaration</th></tr>
+ </thead>
+ <tbody>
+ <tr t-foreach="tax_codes(o.period_id.id ,o.journal_id.id)" t-as="tax">
+ <td><span t-esc="tax.code"/> : </td>
+ <td><span t-esc="formatLang(sum_vat(o.period_id.id, o.journal_id.id, tax.id))"/></td>
+ <td><span t-esc="tax.name"/></td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </div>
+
+ </div>
+ </t>
+ </t>
+ </t>
+</template>
+</data>
+</openerp>
diff --git a/addons/account/views/report_trialbalance.xml b/addons/account/views/report_trialbalance.xml
new file mode 100644
index 00000000000..6a27b957971
--- /dev/null
+++ b/addons/account/views/report_trialbalance.xml
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+<template id="report_trialbalance">
+ <t t-call="report.html_container">
+ <t t-call="report.internal_layout">
+ <div class="page">
+ <h2><span t-esc="res_company.name"/>: Trial Balance</h2>
+
+ <div class="row mt32">
+ <div class="col-xs-3">
+ <strong>Chart of Accounts:</strong>
+ <p t-esc="get_account(data)"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Fiscal Year:</strong>
+ <p t-esc="get_fiscalyear(data)"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Display Account:</strong>
+ <p>
+ <span t-if="data['form']['display_account'] == 'all'">All accounts</span>
+ <span t-if="data['form']['display_account'] == 'movement'">With movements</span>
+ <span t-if="data['form']['display_account'] == 'not_zero'">With balance not equal to zero</span>
+ </p>
+ </div>
+ <div class="col-xs-3">
+ <strong>Filter By:</strong>
+ <p>
+ <span t-if="data['form']['filter'] == 'filter_no'">Not filtered</span>
+ <span t-if="data['form']['filter'] == 'filter_period'">Filtered by period</span>
+ <span t-if="data['form']['filter'] == 'filter_date'">Filtered by date</span>
+ <p t-if="data['form']['filter'] == 'filter_period'">
+ Start Period: <span t-esc="get_start_period(data)"/>
+ End Period: <span t-esc="get_end_period(data)"/>
+ </p>
+ <p t-if="data['form']['filter'] == 'filter_date'">
+ Date from : <span t-esc="formatLang(get_start_date(data), date=True)"/><br />
+ Date to : <span t-esc="formatLang(get_end_date(data), date=True)"/>
+ </p>
+ </p>
+ </div>
+ </div>
+ <div class="row mb32">
+ <div class="col-xs-3">
+ <strong>Target Moves:</strong>
+ <p t-esc="get_target_move(data)"/>
+ </div>
+ </div>
+
+ <table class="table table-condensed">
+ <thead>
+ <tr>
+ <th>Code</th>
+ <th>Account</th>
+ <th class="text-right">Debit</th>
+ <th class="text-right">Credit</th>
+ <th class="text-right">Balance</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr t-foreach="lines(data['form'])" t-as="childrenaccount">
+ <t t-if="childrenaccount['type'] == 'view'">
+ <t t-set="style" t-value="'font-weight:bold;'"/>
+ </t>
+ <t t-if="childrenaccount['type'] != 'view'">
+ <t t-set="style" t-value="'font-weight:normal;'"/>
+ </t>
+
+ <td>
+ <span t-att-style="style" t-esc="childrenaccount['code']"/>
+ </td>
+ <td>
+ <span style="color: white;" t-esc="'.' * (childrenaccount['level'] - 1)"/>
+ <span t-att-style="style" t-esc="childrenaccount['name']"/>
+ </td>
+ <td class="text-right">
+ <span t-att-style="style" t-esc="childrenaccount['debit']"/>
+ </td>
+ <td class="text-right">
+ <span t-att-style="style" t-esc="childrenaccount['credit']"/>
+ </td>
+ <td class="text-right">
+ <span t-att-style="style" t-esc="formatLang(childrenaccount['balance'], currency_obj=res_company.currency_id)"/>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </t>
+ </t>
+</template>
+</data>
+</openerp>
diff --git a/addons/account/views/report_vat.xml b/addons/account/views/report_vat.xml
index 03664045ef4..f88d45e5c44 100644
--- a/addons/account/views/report_vat.xml
+++ b/addons/account/views/report_vat.xml
@@ -39,7 +39,7 @@
</tr>
</thead>
<tbody>
- <tr t-foreach="taxlines" t-as="taxline">
+ <tr t-foreach="get_lines(data['form']['based_on'], data['form']['company_id'])" t-as="taxline">
<t t-if="len(taxline['level']) > 5">
<t t-set="style" t-value="'font-weight:normal;'"/>
</t>
diff --git a/addons/account/wizard/account_financial_report.py b/addons/account/wizard/account_financial_report.py
index 48bdfd33081..6c1b57fa428 100644
--- a/addons/account/wizard/account_financial_report.py
+++ b/addons/account/wizard/account_financial_report.py
@@ -21,6 +21,7 @@
from openerp.osv import fields, osv
+
class accounting_report(osv.osv_memory):
_name = "accounting.report"
_inherit = "account.common.report"
@@ -83,16 +84,11 @@ class accounting_report(osv.osv_memory):
if isinstance(data['form'][field], tuple):
data['form'][field] = data['form'][field][0]
comparison_context = self._build_comparison_context(cr, uid, ids, data, context=context)
- res['datas']['form']['comparison_context'] = comparison_context
+ res['data']['form']['comparison_context'] = comparison_context
return res
def _print_report(self, cr, uid, ids, data, context=None):
data['form'].update(self.read(cr, uid, ids, ['date_from_cmp', 'debit_credit', 'date_to_cmp', 'fiscalyear_id_cmp', 'period_from_cmp', 'period_to_cmp', 'filter_cmp', 'account_report_id', 'enable_filter', 'label_filter','target_move'], context=context)[0])
- return {
- 'type': 'ir.actions.report.xml',
- 'report_name': 'account.financial.report',
- 'datas': data,
- }
-
+ return self.pool['report'].get_action(cr, uid, ids, 'account.report_financial', data=data, context=context)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/account_report_account_balance.py b/addons/account/wizard/account_report_account_balance.py
index fd3c966e306..3b9d3c21777 100644
--- a/addons/account/wizard/account_report_account_balance.py
+++ b/addons/account/wizard/account_report_account_balance.py
@@ -36,7 +36,6 @@ class account_balance_report(osv.osv_memory):
def _print_report(self, cr, uid, ids, data, context=None):
data = self.pre_print_report(cr, uid, ids, data, context=context)
- return {'type': 'ir.actions.report.xml', 'report_name': 'account.account.balance', 'datas': data}
-
+ return self.pool['report'].get_action(cr, uid, ids, 'account.report_trialbalance', data=data, context=context)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/account_report_aged_partner_balance.py b/addons/account/wizard/account_report_aged_partner_balance.py
index c483487b78f..c918a1119fd 100644
--- a/addons/account/wizard/account_report_aged_partner_balance.py
+++ b/addons/account/wizard/account_report_aged_partner_balance.py
@@ -25,6 +25,7 @@ from dateutil.relativedelta import relativedelta
from openerp.osv import fields, osv
from openerp.tools.translate import _
+
class account_aged_trial_balance(osv.osv_memory):
_inherit = 'account.common.partner.report'
_name = 'account.aged.trial.balance'
@@ -80,11 +81,6 @@ class account_aged_trial_balance(osv.osv_memory):
data['form'].update(res)
if data.get('form',False):
data['ids']=[data['form'].get('chart_account_id',False)]
- return {
- 'type': 'ir.actions.report.xml',
- 'report_name': 'account.aged_trial_balance',
- 'datas': data
- }
-
+ return self.pool['report'].get_action(cr, uid, ids, 'account.report_agedpartnerbalance', data=data, context=context)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/account_report_central_journal.py b/addons/account/wizard/account_report_central_journal.py
index a6bc111fa35..9f22d49afac 100644
--- a/addons/account/wizard/account_report_central_journal.py
+++ b/addons/account/wizard/account_report_central_journal.py
@@ -32,13 +32,6 @@ class account_central_journal(osv.osv_memory):
def _print_report(self, cr, uid, ids, data, context=None):
data = self.pre_print_report(cr, uid, ids, data, context=context)
- return {
- 'type': 'ir.actions.report.xml',
- 'report_name': 'account.central.journal',
- 'datas': data,
- }
-
-
-#vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+ return self.pool['report'].get_action(cr, uid, ids, 'account.report_centraljournal', data=data, context=context)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/account_report_general_journal.py b/addons/account/wizard/account_report_general_journal.py
index e5e516b1f38..3d9d55b19c1 100644
--- a/addons/account/wizard/account_report_general_journal.py
+++ b/addons/account/wizard/account_report_general_journal.py
@@ -32,9 +32,6 @@ class account_general_journal(osv.osv_memory):
def _print_report(self, cr, uid, ids, data, context=None):
data = self.pre_print_report(cr, uid, ids, data, context=context)
- return {'type': 'ir.actions.report.xml', 'report_name': 'account.general.journal', 'datas': data}
-
-
-#vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+ return self.pool['report'].get_action(cr, uid, ids, 'account.report_generaljournal', data=data, context=context)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/account_report_general_ledger.py b/addons/account/wizard/account_report_general_ledger.py
index fae60df63fb..c75477da40a 100644
--- a/addons/account/wizard/account_report_general_ledger.py
+++ b/addons/account/wizard/account_report_general_ledger.py
@@ -21,6 +21,7 @@
from openerp.osv import fields, osv
+
class account_report_general_ledger(osv.osv_memory):
_inherit = "account.common.account.report"
_name = "account.report.general.ledger"
@@ -54,9 +55,10 @@ class account_report_general_ledger(osv.osv_memory):
data['form'].update(self.read(cr, uid, ids, ['landscape', 'initial_balance', 'amount_currency', 'sortby'])[0])
if not data['form']['fiscalyear_id']:# GTK client problem onchange does not consider in save record
data['form'].update({'initial_balance': False})
- if data['form']['landscape']:
- return { 'type': 'ir.actions.report.xml', 'report_name': 'account.general.ledger_landscape', 'datas': data}
- return { 'type': 'ir.actions.report.xml', 'report_name': 'account.general.ledger', 'datas': data}
+ if data['form']['landscape'] is False:
+ data['form'].pop('landscape')
+
+ return self.pool['report'].get_action(cr, uid, ids, 'account.report_generalledger', data=data, context=context)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/account_report_partner_balance.py b/addons/account/wizard/account_report_partner_balance.py
index fbe18f27d69..d4b5fb27d14 100644
--- a/addons/account/wizard/account_report_partner_balance.py
+++ b/addons/account/wizard/account_report_partner_balance.py
@@ -21,6 +21,7 @@
from openerp.osv import fields, osv
+
class account_partner_balance(osv.osv_memory):
"""
This wizard will provide the partner balance report by periods, between any two dates.
@@ -35,7 +36,6 @@ class account_partner_balance(osv.osv_memory):
}
_defaults = {
-# 'initial_balance': True,
'display_partner': 'non-zero_balance',
}
@@ -44,11 +44,6 @@ class account_partner_balance(osv.osv_memory):
context = {}
data = self.pre_print_report(cr, uid, ids, data, context=context)
data['form'].update(self.read(cr, uid, ids, ['display_partner'])[0])
- return {
- 'type': 'ir.actions.report.xml',
- 'report_name': 'account.partner.balance',
- 'datas': data,
- }
-
+ return self.pool['report'].get_action(cr, uid, ids, 'account.report_partnerbalance', data=data, context=context)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/account_report_partner_ledger.py b/addons/account/wizard/account_report_partner_ledger.py
index fdabe49ff17..eb743e32e4f 100644
--- a/addons/account/wizard/account_report_partner_ledger.py
+++ b/addons/account/wizard/account_report_partner_ledger.py
@@ -21,6 +21,7 @@
from openerp.osv import fields, osv
+
class account_partner_ledger(osv.osv_memory):
"""
This wizard will provide the partner Ledger report by periods, between any two dates.
@@ -37,6 +38,7 @@ class account_partner_ledger(osv.osv_memory):
'amount_currency': fields.boolean("With Currency", help="It adds the currency column on report if the currency differs from the company currency."),
'journal_ids': fields.many2many('account.journal', 'account_partner_ledger_journal_rel', 'account_id', 'journal_id', 'Journals', required=True),
}
+
_defaults = {
'initial_balance': False,
'page_split': False,
@@ -45,8 +47,8 @@ class account_partner_ledger(osv.osv_memory):
def onchange_filter(self, cr, uid, ids, filter='filter_no', fiscalyear_id=False, context=None):
res = super(account_partner_ledger, self).onchange_filter(cr, uid, ids, filter=filter, fiscalyear_id=fiscalyear_id, context=context)
if filter in ['filter_no', 'unreconciled']:
- if filter == 'unreconciled':
- res['value'].update({'fiscalyear_id': False})
+ if filter == 'unreconciled':
+ res['value'].update({'fiscalyear_id': False})
res['value'].update({'initial_balance': False, 'period_from': False, 'period_to': False, 'date_from': False ,'date_to': False})
return res
@@ -55,17 +57,8 @@ class account_partner_ledger(osv.osv_memory):
context = {}
data = self.pre_print_report(cr, uid, ids, data, context=context)
data['form'].update(self.read(cr, uid, ids, ['initial_balance', 'filter', 'page_split', 'amount_currency'])[0])
- if data['form']['page_split']:
- return {
- 'type': 'ir.actions.report.xml',
- 'report_name': 'account.third_party_ledger',
- 'datas': data,
- }
- return {
- 'type': 'ir.actions.report.xml',
- 'report_name': 'account.third_party_ledger_other',
- 'datas': data,
- }
-
+ if data['form'].get('page_split') is True:
+ return self.pool['report'].get_action(cr, uid, ids, 'account.report_partnerledgerother', data=data, context=context)
+ return self.pool['report'].get_action(cr, uid, ids, 'account.report_partnerledger', data=data, context=context)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/account_report_print_journal.py b/addons/account/wizard/account_report_print_journal.py
index 3ad45268248..3aafc63acf4 100644
--- a/addons/account/wizard/account_report_print_journal.py
+++ b/addons/account/wizard/account_report_print_journal.py
@@ -22,6 +22,7 @@
from openerp.osv import fields, osv
from lxml import etree
+
class account_print_journal(osv.osv_memory):
_inherit = "account.common.journal.report"
_name = 'account.print.journal'
@@ -60,19 +61,14 @@ class account_print_journal(osv.osv_memory):
res['arch'] = etree.tostring(doc)
return res
-
def _print_report(self, cr, uid, ids, data, context=None):
if context is None:
context = {}
data = self.pre_print_report(cr, uid, ids, data, context=context)
data['form'].update(self.read(cr, uid, ids, ['sort_selection'], context=context)[0])
if context.get('sale_purchase_only'):
- report_name = 'account.journal.period.print.sale.purchase'
+ return self.pool['report'].get_action(cr, uid, ids, 'account.report_salepurchasejournal', data=data, context=context)
else:
- report_name = 'account.journal.period.print'
- return {'type': 'ir.actions.report.xml', 'report_name': report_name, 'datas': data}
-
-
-#vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+ return self.pool['report'].get_action(cr, uid, ids, 'account.report_journal', data=data, context=context)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/account_vat.py b/addons/account/wizard/account_vat.py
index 6fbfcc9ddf5..5cc5c678df1 100644
--- a/addons/account/wizard/account_vat.py
+++ b/addons/account/wizard/account_vat.py
@@ -21,6 +21,7 @@
from openerp.osv import fields, osv
+
class account_vat_declaration(osv.osv_memory):
_name = 'account.vat.declaration'
_description = 'Account Vat Declaration'
@@ -60,6 +61,6 @@ class account_vat_declaration(osv.osv_memory):
taxcode = taxcode_obj.browse(cr, uid, [taxcode_id], context=context)[0]
datas['form']['company_id'] = taxcode.company_id.id
- return self.pool['report'].get_action(cr, uid, ids, 'account.report_vat', datas=datas, context=context)
+ return self.pool['report'].get_action(cr, uid, ids, 'account.report_vat', data=datas, context=context)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_analytic_plans/__openerp__.py b/addons/account_analytic_plans/__openerp__.py
index af5b5654b99..7ca7c00e6c0 100644
--- a/addons/account_analytic_plans/__openerp__.py
+++ b/addons/account_analytic_plans/__openerp__.py
@@ -19,7 +19,6 @@
#
##############################################################################
-
{
'name': 'Multiple Analytic Plans',
'version': '1.0',
@@ -74,6 +73,7 @@ The analytic plan validates the minimum and maximum percentage at the time of cr
'account_analytic_plans_report.xml',
'wizard/analytic_plan_create_model_view.xml',
'wizard/account_crossovered_analytic_view.xml',
+ 'views/report_crossoveredanalyticplans.xml',
],
'demo': [],
'test': ['test/acount_analytic_plans_report.yml'],
diff --git a/addons/account_analytic_plans/account_analytic_plans_report.xml b/addons/account_analytic_plans/account_analytic_plans_report.xml
index 05d4c5b445c..608a22d1d96 100644
--- a/addons/account_analytic_plans/account_analytic_plans_report.xml
+++ b/addons/account_analytic_plans/account_analytic_plans_report.xml
@@ -1,16 +1,15 @@
<?xml version="1.0"?>
<openerp>
<data>
-
<report
- id="account_analytic_account_crossovered_analytic"
+ id="action_account_analytic_account_crossovered_analytic"
string="Crossovered Analytic"
model="account.analytic.account"
- name="account.analytic.account.crossovered.analytic"
- rml="account_analytic_plans/report/crossovered_analytic.rml"
- auto="False"
- menu="False"/>
-
+ report_type="qweb-pdf"
+ name="account_analytic_plans.report_crossoveredanalyticplans"
+ file="account_analytic_plans.report_crossoveredanalyticplans"
+ menu="False"
+ />
</data>
</openerp>
diff --git a/addons/account_analytic_plans/report/crossovered_analytic.py b/addons/account_analytic_plans/report/crossovered_analytic.py
index b1a8f965d6b..ef7589fda8e 100644
--- a/addons/account_analytic_plans/report/crossovered_analytic.py
+++ b/addons/account_analytic_plans/report/crossovered_analytic.py
@@ -20,9 +20,10 @@
##############################################################################
import time
-
+from openerp.osv import osv
from openerp.report import report_sxw
+
class crossovered_analytic(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(crossovered_analytic, self).__init__(cr, uid, name, context = context)
@@ -173,7 +174,11 @@ class crossovered_analytic(report_sxw.rml_parse):
final.append(item)
return final
-report_sxw.report_sxw('report.account.analytic.account.crossovered.analytic', 'account.analytic.account', 'addons/account_analytic_plans/report/crossovered_analytic.rml',parser = crossovered_analytic, header='internal')
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+class report_crossoveredanalyticplans(osv.AbstractModel):
+ _name = 'report.account_analytic_plans.report_crossoveredanalyticplans'
+ _inherit = 'report.abstract_report'
+ _template = 'account_analytic_plans.report_crossoveredanalyticplans'
+ _wrapped_report_class = crossovered_analytic
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_analytic_plans/report/crossovered_analytic.rml b/addons/account_analytic_plans/report/crossovered_analytic.rml
deleted file mode 100644
index 48e7c13b0a1..00000000000
--- a/addons/account_analytic_plans/report/crossovered_analytic.rml
+++ /dev/null
@@ -1,304 +0,0 @@
-<?xml version="1.0"?>
-<document filename="test.pdf">
- <template title="Crossovered Analytic" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
- <pageTemplate id="first">
- <frame id="first" x1="28.0" y1="28.0" width="539" height="786"/>
- </pageTemplate>
- </template>
- <stylesheet>
- <blockTableStyle id="Standard_Outline">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table1">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="4,0" stop="4,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="4,0" stop="4,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="4,0" stop="4,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table2">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="4,0" stop="4,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="4,0" stop="4,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="4,0" stop="4,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table5">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
- <blockBackground colorName="#ffffff" start="0,0" stop="0,-1"/>
- <blockBackground colorName="#ffffff" start="1,0" stop="1,-1"/>
- <blockBackground colorName="#ffffff" start="2,0" stop="2,-1"/>
- <blockBackground colorName="#ffffff" start="3,0" stop="3,-1"/>
- <blockBackground colorName="#ffffff" start="4,0" stop="4,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table6">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table3">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
- <blockBackground colorName="#ffffff" start="0,0" stop="0,-1"/>
- <blockBackground colorName="#ffffff" start="1,0" stop="1,-1"/>
- <blockBackground colorName="#ffffff" start="2,0" stop="2,-1"/>
- <blockBackground colorName="#ffffff" start="3,0" stop="3,-1"/>
- <blockBackground colorName="#ffffff" start="4,0" stop="4,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table4">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
- </blockTableStyle>
- <initialize>
- <paraStyle name="all" alignment="justify"/>
- </initialize>
- <paraStyle name="Standard" fontName="Helvetica"/>
- <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Table Contents" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Caption" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="Index" fontName="Helvetica"/>
- <paraStyle name="Heading" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Footer" fontName="Helvetica"/>
- <paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
- <paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="11.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_space_0.5" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="9.0" spaceAfter="0.0"/>
- <images/>
- </stylesheet>
- <story>
- <pto>
- <pto_header>
- <blockTable colWidths="292.0,63.0,57.0,71.0,57.0" repeatRows="1" style="Table3">
- <tr>
- <td>
- <para style="terp_tblheader_Details">Account Name</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Code</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Quantity</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Amount</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Perc(%)</para>
- </td>
- </tr>
- </blockTable>
- </pto_header>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <para style="terp_header_Centre">Crossovered Analytic</para>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="108.0,108.0,108.0,108.0,108.0" style="Table1">
- <tr>
- <td>
- <para style="terp_tblheader_General_Centre">From Date</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">To Date</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Company</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Currency</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Printing date</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="108.0,108.0,108.0,108.0,108.0" style="Table2">
- <tr>
- <td>
- <para style="terp_default_Centre_8">[[ formatLang(data['form']['date1'],date=True) ]] </para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ formatLang(data['form']['date2'],date=True) ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ company.name ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ company.currency_id.name ]] </para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ formatLang(time.strftime('%Y-%m-%d'),date=True) ]] at [[ time.strftime('%H:%M:%S') ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_header">
- <font color="white"> </font>
- </para>
- <para style="terp_header">Analytic Account Reference:</para>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="292.0,63.0,57.0,71.0,57.0" style="Table5">
- <tr>
- <td>
- <para style="terp_tblheader_Details">Account Name</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Code</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Quantity</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Amount</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Perc(%)</para>
- </td>
- </tr>
- </blockTable>
- <section>
- <para style="terp_default_8">[[ repeatIn(ref_lines(data['form']),'a') ]]</para>
- <blockTable colWidths="292.0,63.0,57.0,71.0,57.0" style="Table6">
- <tr>
- <td>
- <para style="terp_default_9">[[ a['ref_name'] ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_9">[[ a['ref_code'] ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ a['ref_qty'] and formatLang(a['ref_qty']) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ a['ref_amt'] and formatLang(a['ref_amt'], currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9">100.00%</para>
- </td>
- </tr>
- </blockTable>
- </section>
- <para style="terp_header">
- <font color="white"> </font>
- </para>
- <para style="terp_header">Analytic Account :</para>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="292.0,63.0,57.0,71.0,57.0" repeatRows="1" style="Table3">
- <tr>
- <td>
- <para style="terp_tblheader_Details">Account Name</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Code</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Quantity</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Amount</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Percentage</para>
- </td>
- </tr>
- </blockTable>
- <section>
- <para style="terp_default_8">[[ repeatIn(lines(data['form']),'a') ]]</para>
- <blockTable colWidths="292.0,63.0,57.0,71.0,57.0" style="Table4">
- <tr>
- <td>
- <para style="terp_default_9">[[ a['acc_name'] ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_9">[[ a['code'] ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[formatLang(a['qty']) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang(a['amt'], currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang(a['perc']) ]]%</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_2">
- <font color="white"> </font>
- </para>
- </section>
- </pto>
- </story>
-</document>
diff --git a/addons/account_analytic_plans/test/acount_analytic_plans_report.yml b/addons/account_analytic_plans/test/acount_analytic_plans_report.yml
index 6aa67a3052a..cae58583793 100644
--- a/addons/account_analytic_plans/test/acount_analytic_plans_report.yml
+++ b/addons/account_analytic_plans/test/acount_analytic_plans_report.yml
@@ -6,6 +6,6 @@
import openerp.report
from openerp import tools
data_dict = {'model': 'account.analytic.account', 'form': {'date1':time.strftime("%Y-01-01"),'date2':time.strftime('%Y-%m-%d'),'journal_ids':[6,0,(ref('account.cose_journal_sale'))],'ref':ref('account.analytic_root'),'empty_line':True,'id':ref('account.analytic_root'),'context':{}}}
- data, format = openerp.report.render_report(cr, uid, [ref('account.analytic_root')], 'account.analytic.account.crossovered.analytic', data_dict, {})
+ data, format = openerp.report.render_report(cr, uid, [ref('account.analytic_root')], 'account_analytic_plans.report_crossoveredanalyticplans', data_dict, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'account_analytic_plans-crossovered_analyitic.'+format), 'wb+').write(data)
diff --git a/addons/account_analytic_plans/views/report_crossoveredanalyticplans.xml b/addons/account_analytic_plans/views/report_crossoveredanalyticplans.xml
new file mode 100644
index 00000000000..b4470ea2913
--- /dev/null
+++ b/addons/account_analytic_plans/views/report_crossoveredanalyticplans.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+<template id="report_crossoveredanalyticplans">
+ <t t-call="report.html_container">
+ <t t-call="report.internal_layout">
+ <div class="page">
+ <div class="oe_structure"/>
+ <h2>Crossovered Analytic</h2>
+
+ <div class="row mt32 mb32">
+ <div class="col-xs-3">
+ <strong>From Date:</strong>
+ <p t-esc="formatLang(data['form']['date1'], date=True)"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>To Date:</strong>
+ <p t-esc="formatLang(data['form']['date2'], date=True)"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Company:</strong>
+ <p t-esc="res_company.name"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Printing Date:</strong>
+ <p t-esc="formatLang(time.strftime('%Y-%m-%d'), date=True)"/>
+ </div>
+ </div>
+
+ <h3>Analytic Account Reference</h3>
+
+ <table class="table table-condensed">
+ <thead>
+ <tr>
+ <th>Account Name</th>
+ <th class="text-center">Code</th>
+ <th class="text-right">Quantity</th>
+ <th class="text-right">Amount</th>
+ <th class="text-right">Perc(%)</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr t-foreach="ref_lines(data['form'])" t-as="line">
+ <td><span t-esc="line['ref_name']"/></td>
+ <td class="text-center"> <span t-esc="line['ref_code']"/> </td>
+ <td class="text-right">
+ <p t-if="line['ref_qty']">
+ <span t-esc="formatLang(line['ref_qty'])"/>
+ </p>
+ </td>
+ <td class="text-right">
+ <p t-if="line['ref_amt']">
+ <span t-esc="formatLang(line['ref_amt'], currency_obj = res_company.currency_id)"/>
+ </p>
+ </td>
+ <td class="text-right">100.00%</td>
+ </tr>
+ </tbody>
+ </table>
+ <div class="oe_structure"/>
+ </div>
+ </t>
+ </t>
+</template>
+</data>
+</openerp>
diff --git a/addons/account_analytic_plans/wizard/account_crossovered_analytic.py b/addons/account_analytic_plans/wizard/account_crossovered_analytic.py
index d3581d6c457..ccac123c681 100644
--- a/addons/account_analytic_plans/wizard/account_crossovered_analytic.py
+++ b/addons/account_analytic_plans/wizard/account_crossovered_analytic.py
@@ -65,11 +65,6 @@ class account_crossovered_analytic(osv.osv_memory):
'model': 'account.analytic.account',
'form': data
}
- return {
- 'type': 'ir.actions.report.xml',
- 'report_name': 'account.analytic.account.crossovered.analytic',
- 'datas': datas,
- }
-
+ return self.pool['report'].get_action(cr, uid, ids, 'account_analytic_plans.report_crossoveredanalyticplans', data=datas, context=context)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_bank_statement_extensions/__openerp__.py b/addons/account_bank_statement_extensions/__openerp__.py
index 7571eef3e54..203011c46c5 100644
--- a/addons/account_bank_statement_extensions/__openerp__.py
+++ b/addons/account_bank_statement_extensions/__openerp__.py
@@ -50,6 +50,7 @@ This module adds:
'wizard/confirm_statement_line_wizard.xml',
'wizard/cancel_statement_line_wizard.xml',
'data/account_bank_statement_extensions_data.xml',
+ 'views/report_bankstatementbalance.xml',
],
'auto_install': False,
'installable': True,
diff --git a/addons/account_bank_statement_extensions/account_bank_statement_report.xml b/addons/account_bank_statement_extensions/account_bank_statement_report.xml
index b4dafbfd9a7..861c3822520 100644
--- a/addons/account_bank_statement_extensions/account_bank_statement_report.xml
+++ b/addons/account_bank_statement_extensions/account_bank_statement_report.xml
@@ -1,16 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
- <data>
-
- <report
- auto="False"
- id="bank_statement_balance_report"
- model="account.bank.statement"
- name="bank.statement.balance.report"
- rml="account_bank_statement_extensions/report/bank_statement_balance_report.rml"
- header="True"
- string="Bank Statement Balances Report"
- multi="True"/>
-
- </data>
+ <data>
+ <report
+ id="action_bank_statement_balance_report"
+ model="account.bank.statement"
+ string="Bank Statement Balances"
+ report_type="qweb-pdf"
+ name="account_bank_statement_extensions.report_bankstatementbalance"
+ file="account_bank_statement_extensions.report_bankstatementbalance"
+ />
+ </data>
</openerp>
diff --git a/addons/account_bank_statement_extensions/report/bank_statement_balance_report.py b/addons/account_bank_statement_extensions/report/bank_statement_balance_report.py
index 59b8efb23e1..f0b63bf148c 100644
--- a/addons/account_bank_statement_extensions/report/bank_statement_balance_report.py
+++ b/addons/account_bank_statement_extensions/report/bank_statement_balance_report.py
@@ -21,15 +21,14 @@
##############################################################################
import time
-
+from openerp.osv import osv
from openerp.report import report_sxw
+
class bank_statement_balance_report(report_sxw.rml_parse):
def set_context(self, objects, data, ids, report_type=None):
cr = self.cr
- uid = self.uid
- context = self.context
cr.execute('SELECT s.name as s_name, s.date AS s_date, j.code as j_code, s.balance_end_real as s_balance ' \
'FROM account_bank_statement s ' \
@@ -46,7 +45,6 @@ class bank_statement_balance_report(report_sxw.rml_parse):
})
super(bank_statement_balance_report, self).set_context(objects, data, ids, report_type=report_type)
-
def __init__(self, cr, uid, name, context):
if context is None:
context = {}
@@ -56,12 +54,11 @@ class bank_statement_balance_report(report_sxw.rml_parse):
})
self.context = context
-report_sxw.report_sxw(
- 'report.bank.statement.balance.report',
- 'account.bank.statement',
- 'addons/account_bank_statement_extensions/report/bank_statement_balance_report.rml',
- parser=bank_statement_balance_report,
- header='internal'
-)
+
+class report_bankstatementbalance(osv.AbstractModel):
+ _name = 'report.account_bank_statement_extensions.report_bankstatementbalance'
+ _inherit = 'report.abstract_report'
+ _template = 'account_bank_statement_extensions.report_bankstatementbalance'
+ _wrapped_report_class = bank_statement_balance_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_bank_statement_extensions/report/bank_statement_balance_report.rml b/addons/account_bank_statement_extensions/report/bank_statement_balance_report.rml
deleted file mode 100644
index 963b5d9dd68..00000000000
--- a/addons/account_bank_statement_extensions/report/bank_statement_balance_report.rml
+++ /dev/null
@@ -1,145 +0,0 @@
-<document filename="test.pdf">
- <template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
- <pageTemplate id="first">
- <frame id="first" x1="28.0" y1="28.0" width="539" height="786"/>
- </pageTemplate>
- </template>
- <stylesheet>
- <blockTableStyle id="Standard_Outline">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table4">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table1">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#666666" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#666666" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#666666" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#666666" start="3,-1" stop="3,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table2">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- </blockTableStyle>
- <initialize>
- <paraStyle name="all" alignment="justify"/>
- </initialize>
- <paraStyle name="P1" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="CENTER"/>
- <paraStyle name="P2" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT"/>
- <paraStyle name="P3" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT"/>
- <paraStyle name="P4" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P5" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P6" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica-Bold" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P7" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P8" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P9" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P10" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P11" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P12" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT"/>
- <paraStyle name="Standard" fontName="Helvetica"/>
- <paraStyle name="Heading" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Text_20_body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Caption" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="Index" fontName="Helvetica" fontSize="9.0" leading="11"/>
- <paraStyle name="Footer" fontName="Helvetica"/>
- <paraStyle name="Table_20_Contents" fontName="Helvetica"/>
- <paraStyle name="Table_20_Heading" fontName="Helvetica" alignment="CENTER"/>
- <paraStyle name="Horizontal_20_Line" fontName="Helvetica" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
- <paraStyle name="terp_5f_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Heading_20_9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_5f_tblheader_5f_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_5f_tblheader_5f_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_5f_default_5f_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_5f_default_5f_Bold_5f_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_5f_tblheader_5f_General_5f_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_5f_tblheader_5f_General_5f_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_5f_tblheader_5f_Details_5f_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_5f_tblheader_5f_Details_5f_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_5f_default_5f_Right_5f_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_5f_default_5f_Centre_5f_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_5f_header_5f_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_5f_header_5f_Centre" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_5f_default_5f_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_5f_default_5f_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_5f_default_5f_Bold_5f_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_5f_default_5f_Centre_5f_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_5f_default_5f_Right_5f_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_5f_default_5f_Right_5f_9_5f_Bold" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_5f_default_5f_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_5f_default_5f_Bold_5f_Right_5f_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- </stylesheet>
- <images/>
- <story>
- <para style="P8">[[ ]]</para>
- <blockTable colWidths="539.0" style="Table4">
- <tr>
- <td>
- <para style="P1">
- <font color="white"> </font>
- </para>
- <para style="P1">Bank Statement Balances Report</para>
- </td>
- </tr>
- </blockTable>
- <para style="P7">
- <font color="white"> </font>
- </para>
- <para style="P7">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="163.0,146.0,103.0,127.0" style="Table1">
- <tr>
- <td>
- <para style="P9">Name</para>
- </td>
- <td>
- <para style="P9">Date</para>
- </td>
- <td>
- <para style="P11">Journal</para>
- </td>
- <td>
- <para style="P10">Closing Balance</para>
- </td>
- </tr>
- </blockTable>
- <para style="P6">
- <font color="white"> </font>
- </para>
- <section>
- <para style="P4">[[ repeatIn(lines, 'l') ]]</para>
- <blockTable colWidths="163.0,146.0,103.0,127.0" style="Table2">
- <tr>
- <td>
- <para style="P2">[[ l['s_name'] ]]</para>
- </td>
- <td>
- <para style="P2">[[ l['s_date'] ]]</para>
- </td>
- <td>
- <para style="P2">[[ l['j_code'] ]]</para>
- </td>
- <td>
- <para style="P3">[[ formatLang(l['s_balance']) ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="P6">
- <font color="white"> </font>
- </para>
- </section>
- <para style="P5">
- <font color="white"> </font>
- </para>
- </story>
-</document>
-
diff --git a/addons/account_bank_statement_extensions/views/report_bankstatementbalance.xml b/addons/account_bank_statement_extensions/views/report_bankstatementbalance.xml
new file mode 100644
index 00000000000..111912a7507
--- /dev/null
+++ b/addons/account_bank_statement_extensions/views/report_bankstatementbalance.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+<template id="report_bankstatementbalance">
+ <t t-call="report.html_container">
+ <t t-call="report.internal_layout">
+ <div class="page">
+ <h2>Bank Statement Balances Report</h2>
+
+ <table class="table table-condensed">
+ <thead>
+ <tr>
+ <th>Name</th>
+ <th>Date</th>
+ <th>Journal</th>
+ <th class="text-right">Closing Balance</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr t-foreach="lines" t-as="line">
+ <td><span t-esc="line['s_name']"/></td>
+ <td><span t-esc="line['s_date']"/></td>
+ <td><span t-esc="line['j_code']"/></td>
+ <td class="text-right">
+ <span t-esc="formatLang(line['s_balance'] or 0, digits=2)"/>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </t>
+ </t>
+</template>
+</data>
+</openerp>
diff --git a/addons/account_budget/__openerp__.py b/addons/account_budget/__openerp__.py
index 222178b940c..695fd794b9f 100644
--- a/addons/account_budget/__openerp__.py
+++ b/addons/account_budget/__openerp__.py
@@ -19,7 +19,6 @@
#
##############################################################################
-
{
'name': 'Budgets Management',
'version': '1.0',
@@ -61,13 +60,18 @@ Three reports are available:
'wizard/account_budget_report_view.xml',
'wizard/account_budget_crossovered_summary_report_view.xml',
'wizard/account_budget_crossovered_report_view.xml',
+
+ 'views/report_analyticaccountbudget.xml',
+ 'views/report_budget.xml',
+ 'views/report_crossoveredbudget.xml',
],
'demo': ['account_budget_demo.xml'],
- 'test':[
+ 'test': [
'test/account_budget.yml',
'test/account_budget_report.yml',
],
'installable': True,
'auto_install': False,
}
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_budget/account_budget_report.xml b/addons/account_budget/account_budget_report.xml
index 9cc38154ef9..7855deb9ccc 100644
--- a/addons/account_budget/account_budget_report.xml
+++ b/addons/account_budget/account_budget_report.xml
@@ -1,24 +1,34 @@
<?xml version="1.0"?>
<openerp>
<data>
-
- <!-- Reports on crossovered.budget -->
- <report id="report_crossovered_budget"
- string="Budgets"
- model="crossovered.budget"
- name="crossovered.budget.report"
- rml="account_budget/report/crossovered_budget_report.rml"
- auto="False"
- menu="False" />
-
- <!-- moved from account module -->
- <report auto="False"
- id="account_budget"
+ <report
+ id="action_report_crossovered_budget"
+ model="crossovered.budget"
+ string="Budgets"
+ report_type="qweb-pdf"
+ name="account_budget.report_crossoveredbudget"
+ file="account_budget.report_crossoveredbudget"
menu="False"
- model="account.budget.post"
- name="account.budget"
- rml="account_budget/report/budget_report.rml"
- string="Budget"/>
-
+ />
+
+ <report
+ id="action_report_budget"
+ model="account.budget.post"
+ string="Budget"
+ report_type="qweb-pdf"
+ name="account_budget.report_budget"
+ file="account_budget.report_budget"
+ menu="False"
+ />
+
+ <report
+ id="action_report_analytic_account_budget"
+ model="account.analytic.account"
+ string="Budgets"
+ report_type="qweb-pdf"
+ name="account_budget.report_analyticaccountbudget"
+ file="account_budget.report_analyticaccountbudget"
+ menu="False"
+ />
</data>
-</openerp> \ No newline at end of file
+</openerp>
diff --git a/addons/account_budget/report/analytic_account_budget_report.py b/addons/account_budget/report/analytic_account_budget_report.py
index 6701fc06a2b..4e3feaf06b7 100644
--- a/addons/account_budget/report/analytic_account_budget_report.py
+++ b/addons/account_budget/report/analytic_account_budget_report.py
@@ -20,10 +20,10 @@
##############################################################################
import time
-import datetime
-
+from openerp.osv import osv
from openerp.report import report_sxw
+
class analytic_account_budget_report(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(analytic_account_budget_report, self).__init__(cr, uid, name, context=context)
@@ -166,6 +166,11 @@ class analytic_account_budget_report(report_sxw.rml_parse):
result.append(res)
return result
-report_sxw.report_sxw('report.account.analytic.account.budget', 'account.analytic.account', 'addons/account_budget/report/analytic_account_budget_report.rml',parser=analytic_account_budget_report,header='internal')
+
+class report_analyticaccountbudget(osv.AbstractModel):
+ _name = 'report.account_budget.report_analyticaccountbudget'
+ _inherit = 'report.abstract_report'
+ _template = 'account_budget.report_analyticaccountbudget'
+ _wrapped_report_class = analytic_account_budget_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_budget/report/analytic_account_budget_report.rml b/addons/account_budget/report/analytic_account_budget_report.rml
deleted file mode 100644
index 15fddebd02d..00000000000
--- a/addons/account_budget/report/analytic_account_budget_report.rml
+++ /dev/null
@@ -1,226 +0,0 @@
-<?xml version="1.0"?>
-<document filename="Analytic Budget.pdf">
- <template title="Analytic Budget" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
- <pageTemplate id="first">
- <frame id="first" x1="35.0" y1="25.0" width="528" height="793"/>
- </pageTemplate>
- </template>
- <stylesheet>
- <blockTableStyle id="Standard_Outline">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table1">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table8">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table3">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table4">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table5">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="3,0" stop="3,0"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="4,0" stop="4,0"/>
- </blockTableStyle>
- <initialize>
- <paraStyle name="all" alignment="justify"/>
- </initialize>
- <paraStyle name="Standard" fontName="Helvetica"/>
- <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Heading" fontName="Helvetica" fontSize="15.0" leading="19" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Footer" fontName="Helvetica"/>
- <paraStyle name="Table Contents" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Caption" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="Index" fontName="Helvetica"/>
- <paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
- <paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_right_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <images/>
- </stylesheet>
- <story>
- <pto>
- <pto_header>
- <blockTable colWidths="221.0,82.0,83.0,85.0,57.0" style="Table3">
- <tr>
- <td>
- <para style="terp_tblheader_Details">Description</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Theoretical Amt</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Planned Amt</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Practical Amt</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Perc(%)</para>
- </td>
- </tr>
- </blockTable>
- </pto_header>
- <para style="terp_default_8">[[repeatIn(objects,'o')]]</para>
- <para style="terp_header_Centre">Analytic Budget</para>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="206.0,223.0,99.0" style="Table1">
- <tr>
- <td>
- <para style="terp_tblheader_General_Centre">Analysis from</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Analytic Account</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Currency</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="206.0,223.0,99.0" style="Table8">
- <tr>
- <td>
- <para style="terp_default_Centre_8">[[ formatLang(data['form']['date_from'],date=True) ]] to [[ formatLang(data['form']['date_to'],date=True) ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ o.name ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ company.currency_id.name ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="Standard">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="221.0,82.0,83.0,85.0,57.0" style="Table3">
- <tr>
- <td>
- <para style="terp_tblheader_Details">Description</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Theoretical Amt</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Planned Amt</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Practical Amt</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Perc(%)</para>
- </td>
- </tr>
- </blockTable>
- <section>
- <para style="terp_default_8">[[ repeatIn(funct(o,data['form']),'a') ]]</para>
- <blockTable colWidths="221.0,82.0,83.0,85.0,57.0" style="Table4">
- <tr>
- <td>
- <para style="terp_default_9"><font face="Helvetica" size="9.0" color="white">[['.....' *(a['status']-1) ]]</font><font face="Helvetica" size="8.0"> [[ (a['status']==1 and (setTag('para','para',{'fontName':'Helvetica-Bold'}))) or removeParentNode('font') ]]</font> [[ a['name'] ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9"><font face="Helvetica" size="8.0">[[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-Bold'}))) or removeParentNode('font') ]]</font> [[ formatLang(a['theo'], currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9"><font face="Helvetica" size="8.0">[[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-Bold'}))) or removeParentNode('font') ]]</font> [[ formatLang(a['pln'], currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9"><font face="Helvetica" size="8.0">[[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-Bold'}))) or removeParentNode('font') ]]</font> [[ formatLang(a['prac'], currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_9"><font face="Helvetica" size="8.0">[[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-Bold'}))) or removeParentNode('font') ]]</font> [[ formatLang(a['perc']) ]]%</para>
- </td>
- </tr>
- </blockTable>
- </section>
- <blockTable colWidths="221.0,82.0,83.0,85.0,57.0" style="Table5">
- <tr>
- <td>
- <para style="terp_tblheader_Details">[[ repeatIn(funct_total(data['form']),'b') ]] Total:</para>
- </td>
- <td>
- <para style="terp_default_Bold_right_9">[[ formatLang(b['tot_theo'], currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_right_9">[[ formatLang(b['tot_pln'], currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_right_9">[[ formatLang(b['tot_prac'], currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">[[ formatLang(b['tot_perc']) ]]%</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- </pto>
- </story>
-</document>
diff --git a/addons/account_budget/report/budget_report.py b/addons/account_budget/report/budget_report.py
index f00eb8a3713..f8f812639b0 100644
--- a/addons/account_budget/report/budget_report.py
+++ b/addons/account_budget/report/budget_report.py
@@ -20,6 +20,7 @@
##############################################################################
import time
+from openerp.osv import osv
from openerp.report import report_sxw
tot = {}
@@ -187,6 +188,11 @@ class budget_report(report_sxw.rml_parse):
result.append(res)
return result
-report_sxw.report_sxw('report.account.budget', 'account.budget.post', 'addons/account_budget/report/budget_report.rml', parser=budget_report, header='internal')
+
+class report_budget(osv.AbstractModel):
+ _name = 'report.account_budget.report_budget'
+ _inherit = 'report.abstract_report'
+ _template = 'account_budget.report_budget'
+ _wrapped_report_class = budget_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_budget/report/budget_report.rml b/addons/account_budget/report/budget_report.rml
deleted file mode 100644
index 789c3ed1ffb..00000000000
--- a/addons/account_budget/report/budget_report.rml
+++ /dev/null
@@ -1,188 +0,0 @@
-<?xml version="1.0"?>
-<document filename="Budgets.pdf">
- <template title="Budgets" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
- <pageTemplate id="first">
- <frame id="first" x1="57.0" y1="57.0" width="481" height="728"/>
- </pageTemplate>
- </template>
- <stylesheet>
- <blockTableStyle id="Standard_Outline">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table2">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="0,-1" stop="0,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table1">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table3">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="4,0" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table4">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table5">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="3,0" stop="3,0"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="4,0" stop="4,0"/>
- </blockTableStyle>
- <initialize>
- <paraStyle name="all" alignment="justify"/>
- </initialize>
- <paraStyle name="Standard" fontName="Helvetica"/>
- <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Heading" fontName="Helvetica" fontSize="15.0" leading="19" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Footer" fontName="Helvetica"/>
- <paraStyle name="Table Contents" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Caption" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="Index" fontName="Helvetica"/>
- <paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
- <paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_right_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <images/>
- </stylesheet>
- <story>
- <para style="terp_default_8">[[ repeatIn(objects,'o') ]]</para>
- <blockTable colWidths="482.0" style="Table2">
- <tr>
- <td>
- <para style="terp_header_Centre">Budget</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="241.0,241.0" style="Table1">
- <tr>
- <td>
- <para style="terp_default_9"><font face="Helvetica-Bold">Currency: </font>[[ company.currency_id.name ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9">Printed at: [[ formatLang(time.strftime('%Y-%m-%d'),date=True) ]] at [[ time.strftime('%H:%M:%S')]]</para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="terp_default_9"><font face="Helvetica-Bold">Analysis from</font> [[ formatLang(data['form']['date_from'],date=True) ]] to [[ formatLang(data['form']['date_to'],date=True) ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_right_9">Budget : <font color="Blue">[[ o.name ]]</font></para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="191.0,82.0,81.0,83.0,62.0" style="Table3">
- <tr>
- <td>
- <para style="terp_tblheader_Details">Description</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Theoretical Amt</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Planned Amt</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Practical Amt</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Perc(%)</para>
- </td>
- </tr>
- </blockTable>
- <section>
- <para style="terp_default_8">[[ repeatIn(funct(o,data['form']),'a') ]]</para>
- <blockTable colWidths="185.0,79.0,78.0,81.0,59.0" style="Table4">
- <tr>
- <td>
- <para style="terp_default_9"><font color="white">[['.....' *(a['status']-1) ]]</font><font face="Helvetica">[[ (a['status']==1 and (setTag('para','para',{'fontName':'Helvetica-Bold'}))) or removeParentNode('font') ]] </font>[[ a['name'] ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9"><font face="Helvetica">[[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-Bold'}))) or removeParentNode('font') ]]</font> [[ formatLang(a['theo'], digits=get_digits(dp='Account'), currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9"><font face="Helvetica">[[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-Bold'}))) or removeParentNode('font') ]] </font>[[ formatLang(a['pln'], digits=get_digits(dp='Account'), currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9"><font face="Helvetica">[[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-Bold'}))) or removeParentNode('font') ]] </font>[[ formatLang(a['prac'], digits=get_digits(dp='Account'), currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9"><font face="Helvetica">[[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-Bold'}))) or removeParentNode('font') ]] </font>[[ formatLang(a['perc'], digits=2) ]]%</para>
- </td>
- </tr>
- </blockTable>
- </section>
- <blockTable colWidths="185.0,82.0,80.0,81.0,60.0" style="Table5">
- <tr>
- <td>
- <para style="terp_default_Bold_9"><font face="Helvetica">[[ repeatIn(funct_total(data['form']),'b') ]]</font>Total:</para>
- </td>
- <td>
- <para style="terp_default_Bold_right_9">[[ formatLang(b['tot_theo'], digits=get_digits(dp='Account'), currency_obj=company.currency_id) ]] </para>
- </td>
- <td>
- <para style="terp_default_Bold_right_9">[[ formatLang(b['tot_pln'], digits=get_digits(dp='Account'), currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_right_9">[[ formatLang(b['tot_prac'], digits=get_digits(dp='Account'), currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_right_9">[[ formatLang(b['tot_perc'], digits=2) ]]%</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- </story>
-</document>
diff --git a/addons/account_budget/report/crossovered_budget_report.py b/addons/account_budget/report/crossovered_budget_report.py
index 70cbdecb713..8a001aafb39 100644
--- a/addons/account_budget/report/crossovered_budget_report.py
+++ b/addons/account_budget/report/crossovered_budget_report.py
@@ -20,11 +20,9 @@
##############################################################################
import time
-import datetime
-
+from openerp.osv import osv
from openerp.report import report_sxw
-import operator
-from openerp import osv
+
class budget_report(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
@@ -191,7 +189,11 @@ class budget_report(report_sxw.rml_parse):
result.append(res)
return result
-report_sxw.report_sxw('report.crossovered.budget.report', 'crossovered.budget', 'addons/account_budget/report/crossovered_budget_report.rml',parser=budget_report,header='internal')
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+class report_crossoveredbudget(osv.AbstractModel):
+ _name = 'report.account_budget.report_crossoveredbudget'
+ _inherit = 'report.abstract_report'
+ _template = 'account_budget.report_crossoveredbudget'
+ _wrapped_report_class = budget_report
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_budget/report/crossovered_budget_report.rml b/addons/account_budget/report/crossovered_budget_report.rml
deleted file mode 100644
index a63920a4c9f..00000000000
--- a/addons/account_budget/report/crossovered_budget_report.rml
+++ /dev/null
@@ -1,203 +0,0 @@
-<?xml version="1.0"?>
-<document filename="Budget.pdf">
- <template title="Budget" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
- <pageTemplate id="first">
- <frame id="first" x1="28.0" y1="33.0" width="535" height="778"/>
- </pageTemplate>
- </template>
- <stylesheet>
- <blockTableStyle id="Standard_Outline">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table6">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table7">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table3">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table4">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table5">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="3,0" stop="3,0"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="4,0" stop="4,0"/>
- </blockTableStyle>
- <initialize>
- <paraStyle name="all" alignment="justify"/>
- </initialize>
- <paraStyle name="Standard" fontName="Helvetica"/>
- <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Heading" fontName="Helvetica" fontSize="15.0" leading="19" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Footer" fontName="Helvetica"/>
- <paraStyle name="Table Contents" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Caption" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="Index" fontName="Helvetica"/>
- <paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
- <paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_right_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <images/>
- </stylesheet>
- <story>
- <para style="terp_default_8">[[ repeatIn(objects,'o') ]]</para>
- <para style="terp_header_Centre">Budget</para>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="198.0,252.0,85.0" style="Table6">
- <tr>
- <td>
- <para style="terp_tblheader_General_Centre">Analysis from</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Budget</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Currency</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="198.0,252.0,85.0" style="Table7">
- <tr>
- <td>
- <para style="terp_default_Centre_8">[[ formatLang(data['form']['date_from'],date=True) ]] to [[ formatLang(data['form']['date_to'],date=True) ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ o.name ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ company.currency_id.name ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="205.0,88.0,87.0,89.0,67.0" style="Table3">
- <tr>
- <td>
- <para style="terp_tblheader_Details">Description</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Theoretical Amt</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Planned Amt</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Practical Amt</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Perc(%)</para>
- </td>
- </tr>
- </blockTable>
- <section>
- <para style="terp_default_8">[[ repeatIn(funct(o,data['form']),'a') ]]</para>
- <blockTable colWidths="205.0,88.0,87.0,90.0,66.0" style="Table4">
- <tr>
- <td>
- <para style="terp_default_9"><font face="Helvetica" size="10.0" color="white">[['.....' *(a['status']-1) ]]</font><font face="Helvetica" size="8.0">[[ (a['status']==1 and (setTag('para','para',{'fontName':'Helvetica-Bold'}))) or removeParentNode('font') ]]</font> [[ a['name'] ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9"><font face="Helvetica" size="8.0">[[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-Bold'}))) or removeParentNode('font') ]]</font> [[ formatLang(a['theo'], dp='Account', currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9"><font face="Helvetica" size="8.0">[[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-Bold'}))) or removeParentNode('font') ]]</font> [[ formatLang(a['pln'], dp='Account', currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9"><font face="Helvetica" size="8.0">[[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-Bold'}))) or removeParentNode('font') ]]</font> [[ formatLang(a['prac'], dp='Account', currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_9"><font face="Helvetica" size="8.0">[[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-Bold'}))) or removeParentNode('font') ]]</font> [[ formatLang(a['perc'],digits=2) ]]%</para>
- </td>
- </tr>
- </blockTable>
- </section>
- <blockTable colWidths="203.0,90.0,88.0,89.0,66.0" style="Table5">
- <tr>
- <td>
- <para style="terp_tblheader_Details">[[ repeatIn(funct_total(data['form']),'b') ]] Total :</para>
- </td>
- <td>
- <para style="terp_default_Bold_right_9">[[ formatLang(b['tot_theo'], dp='Account', currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_right_9">[[ formatLang(b['tot_pln'], dp='Account', currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_right_9">[[ formatLang(b['tot_prac'], dp='Account', currency_obj=company.currency_id) ]]</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">[[ formatLang(b['tot_perc'],digits=2) ]]%</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- </story>
-</document>
diff --git a/addons/account_budget/test/account_budget_report.yml b/addons/account_budget/test/account_budget_report.yml
index 80ab9b36b34..a36c2d87d04 100644
--- a/addons/account_budget/test/account_budget_report.yml
+++ b/addons/account_budget/test/account_budget_report.yml
@@ -2,35 +2,22 @@
Print the Analytic Budget Report through wizard
-
!python {model: account.analytic.account}: |
- import os, time
- from openerp import netsvc, tools
- ctx={}
- ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root')]})
- data_dict = {}
+ ctx = {'model': 'account.analytic.account','active_ids': [ref('account.analytic_root')]}
from openerp.tools import test_reports
- test_reports.try_report_action(cr, uid, 'action_account_budget_analytic',wiz_data=data_dict, context=ctx, our_module='account_budget')
+ test_reports.try_report_action(cr, uid, 'action_account_budget_analytic',wiz_data={}, context=ctx, our_module='account_budget')
-
Print the Budget Report through wizard
-
!python {model: account.budget.post}: |
- import os, time
- from openerp import netsvc, tools
- ctx={}
- ctx.update({'model': 'account.budget.post','active_ids': [ref('account_budget.account_budget_post_sales0')]})
- data_dict = {}
+ ctx = {'model': 'account.budget.post','active_ids': [ref('account_budget.account_budget_post_sales0')]}
from openerp.tools import test_reports
- test_reports.try_report_action(cr, uid, 'action_account_budget_report',wiz_data=data_dict, context=ctx, our_module='account_budget')
+ test_reports.try_report_action(cr, uid, 'action_account_budget_report',wiz_data={}, context=ctx, our_module='account_budget')
-
Print the CrossOvered Budget Report mode through wizard
-
!python {model: crossovered.budget}: |
- import os, time
- from openerp import netsvc, tools
- ctx={}
- ctx.update({'model': 'account.budget.post','active_ids': [ref('account_budget.crossovered_budget_budgetoptimistic0')]})
- data_dict = {}
+ ctx = {'model': 'account.budget.post','active_ids': [ref('account_budget.crossovered_budget_budgetoptimistic0')]}
from openerp.tools import test_reports
- test_reports.try_report_action(cr, uid, 'action_account_budget_crossvered_report',wiz_data=data_dict, context=ctx, our_module='account_budget')
-
+ test_reports.try_report_action(cr, uid, 'action_account_budget_crossvered_report',wiz_data={}, context=ctx, our_module='account_budget')
diff --git a/addons/account_budget/views/report_analyticaccountbudget.xml b/addons/account_budget/views/report_analyticaccountbudget.xml
new file mode 100644
index 00000000000..dab987d6099
--- /dev/null
+++ b/addons/account_budget/views/report_analyticaccountbudget.xml
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+<template id="report_analyticaccountbudget">
+ <t t-call="report.html_container">
+ <t t-foreach="docs" t-as="o">
+ <t t-call="report.internal_layout">
+ <div class="page">
+ <h2>Analytic Budget</h2>
+
+ <div class="row mt32">
+ <div class="col-xs-3">
+ <strong>Analysis from</strong>
+ <p><span t-esc="formatLang(data['form']['date_from'], date=True)"/> to
+ <span t-esc="formatLang(data['form']['date_to'], date=True)"/></p>
+ </div>
+ <div class="col-xs-3">
+ <strong>Analytic Account</strong>
+ <p t-field="o.name"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Currency</strong>
+ <p t-esc="res_company.currency_id.name"/>
+ </div>
+ </div>
+
+ <table class="table table-condensed">
+ <thead>
+ <tr>
+ <th>Description</th>
+ <th class="text-right">Theoretical Amt</th>
+ <th class="text-right">Planned Amt</th>
+ <th class="text-right">Practical Amt</th>
+ <th class="text-right">Perc(%)</th>
+ </tr>
+ </thead>
+ <tbody>
+ <t t-foreach="funct(o, data['form'])" t-as="line">
+ <tr t-if="line['status'] == 1">
+ <td><strong t-esc="line['name']"/></td>
+ <td class="text-right"><strong t-esc="formatLang(line['theo'], dp='Account', currency_obj=res_company.currency_id)"/></td>
+ <td class="text-right"><strong t-esc="formatLang(line['pln'], dp='Account', currency_obj=res_company.currency_id)"/></td>
+ <td class="text-right"><strong t-esc="formatLang(line['prac'], dp='Account', currency_obj=res_company.currency_id)"/></td>
+ <td class="text-right"><strong t-esc="formatLang(line['perc'], digits=2)"/> %</td>
+ </tr>
+ <tr t-if="line['status'] != 1">
+ <td><span style="color: white;" t-esc="'.....'*(line['status'] - 1)"/><span t-esc="line['name']"/></td>
+ <td class="text-right"><span t-esc="formatLang(line['theo'], dp='Account', currency_obj=res_company.currency_id)"/></td>
+ <td class="text-right"><span t-esc="formatLang(line['pln'], dp='Account', currency_obj=res_company.currency_id)"/></td>
+ <td class="text-right"><span t-esc="formatLang(line['prac'], dp='Account', currency_obj=res_company.currency_id)"/></td>
+ <td class="text-right"><span t-esc="formatLang(line['perc'],digits=2)"/> %</td>
+ </tr>
+ </t>
+ <tr t-foreach="funct_total(data['form'])" t-as="tot">
+ <td><strong>Total:</strong></td>
+ <td class="text-right"><strong t-esc="formatLang(tot['tot_theo'], dp='Account', currency_obj=res_company.currency_id)"/></td>
+ <td class="text-right"><strong t-esc="formatLang(tot['tot_pln'], dp='Account', currency_obj=res_company.currency_id)"/></td>
+ <td class="text-right"><strong t-esc="formatLang(tot['tot_prac'], dp='Account', currency_obj=res_company.currency_id)"/></td>
+ <td class="text-right"><strong t-esc="formatLang(tot['tot_perc'], digits=2)"/> %</td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </t>
+ </t>
+ </t>
+</template>
+</data>
+</openerp> \ No newline at end of file
diff --git a/addons/account_budget/views/report_budget.xml b/addons/account_budget/views/report_budget.xml
new file mode 100644
index 00000000000..6bc72fc9dca
--- /dev/null
+++ b/addons/account_budget/views/report_budget.xml
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+<template id="report_budget">
+ <t t-call="report.html_container">
+ <t t-foreach="docs" t-as="o">
+ <t t-call="report.internal_layout">
+ <div class="page">
+ <h2>Budget</h2>
+ <div class="row mt32">
+ <div class="col-xs-3">
+ <strong>Currency:</strong>
+ <p t-esc="res_company.currency_id.name"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Printed at:</strong>
+ <p><span t-esc="formatLang(time.strftime('%Y-%m-%d'), date=True)"/> at
+ <span t-esc="time.strftime('%H:%M:%S')"/></p>
+ </div>
+ <div class="col-xs-3">
+ <strong>Analysis from:</strong>
+ <p><span t-esc="formatLang(data['form']['date_from'], date=True)"/> to
+ <span t-esc="formatLang(data['form']['date_to'], date=True)"/></p>
+ </div>
+ <div class="col-xs-3">
+ <strong>Budget:</strong>
+ <p t-field="o.name"/>
+ </div>
+ </div>
+
+ <table class="table table-condensed">
+ <thead>
+ <tr>
+ <th>Description</th>
+ <th class="text-right">Theoretical Amount</th>
+ <th class="text-right">Planned Amount</th>
+ <th class="text-right">Practical Amount</th>
+ <th class="text-right">Perc(%)</th>
+ </tr>
+ </thead>
+ <tbody>
+ <t t-foreach="funct(o, data['form'])" t-as="line">
+ <t t-if="line['status'] == 1">
+ <tr>
+ <td><strong t-esc="line['name']"/></td>
+ <td class="text-right">
+ <strong t-esc="formatLang(line['theo'], dp='Account', currency_obj = res_company.currency_id)"/>
+ </td>
+ <td class="text-right"><strong t-esc="formatLang(line['pln'], dp='Account', currency_obj=res_company.currency_id)"/></td>
+ <td class="text-right"><strong t-esc="formatLang(line['prac'], dp='Account', currency_obj=res_company.currency_id)"/></td>
+ <td class="text-right"><strong t-esc="formatLang(line['perc'],digits=2)"/> %</td>
+ </tr>
+ </t>
+ <tr t-if="line['status'] != 1">
+ <td><span style="color: white;" t-esc="'.....'*(line['status'] - 1)"/><span t-esc="line['name']"/></td>
+ <td class="text-right"><span t-esc="formatLang(line['theo'], dp='Account', currency_obj=res_company.currency_id)"/></td>
+ <td class="text-right"><span t-esc="formatLang(line['pln'], dp='Account', currency_obj=res_company.currency_id)"/></td>
+ <td class="text-right"><span t-esc="formatLang(line['prac'], dp='Account', currency_obj=res_company.currency_id)"/></td>
+ <td class="text-right"><span t-esc="formatLang(line['perc'],digits=2)"/> % </td>
+ </tr>
+ </t>
+ <tr t-foreach="funct_total(data['form'])" t-as="tot">
+ <td><strong>Total:</strong></td>
+ <td class="text-right"><strong t-esc="formatLang(tot['tot_theo'], dp='Account', currency_obj = res_company.currency_id)"/></td>
+ <td class="text-right"><strong t-esc="formatLang(tot['tot_pln'], dp='Account', currency_obj = res_company.currency_id)"/></td>
+ <td class="text-right"><strong t-esc="formatLang(tot['tot_prac'], dp='Account', currency_obj=res_company.currency_id)"/></td>
+ <td class="text-right"><strong t-esc="formatLang(tot['tot_perc'], digits=2)"/> %</td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </t>
+ </t>
+ </t>
+</template>
+</data>
+</openerp>
diff --git a/addons/account_budget/views/report_crossoveredbudget.xml b/addons/account_budget/views/report_crossoveredbudget.xml
new file mode 100644
index 00000000000..412c2aac8ed
--- /dev/null
+++ b/addons/account_budget/views/report_crossoveredbudget.xml
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+<template id="report_crossoveredbudget">
+ <t t-call="report.html_container">
+ <t t-foreach="docs" t-as="o">
+ <t t-call="report.internal_layout">
+ <div class="page">
+ <h2>Budget</h2>
+
+ <div class="row mt32">
+ <div class="col-xs-3">
+ <strong>Analysis from:</strong>
+ <p><span t-esc="formatLang(data['form']['date_from'], date=True)"/> to
+ <span t-esc="formatLang(data['form']['date_to'], date=True)"/></p>
+ </div>
+ <div class="col-xs-3">
+ <strong>Budget:</strong>
+ <p t-esc="o.name"/>
+ </div>
+ <div class="col-xs-3">
+ <strong>Currency:</strong>
+ <p t-esc="res_company.currency_id.name"/>
+ </div>
+ </div>
+
+ <table class="table table-condensed">
+ <thead>
+ <tr>
+ <th>Description</th>
+ <th class="text-right">Theoretical Amt</th>
+ <th class="text-right">Planned Amt</th>
+ <th class="text-right">Practical Amt</th>
+ <th class="text-center">Perc(%)</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr t-foreach="funct(o, data['form'])" t-as="line">
+ <td>
+ <span style="color: white;" t-esc="'... '*(line['status'] - 1)"/>
+ <span t-esc="line['name']"/>
+ </td>
+ <td class="text-right">
+ <span t-esc="formatLang(line['theo'], dp='Account', currency_obj=res_company.currency_id)"/>
+ </td>
+ <td class="text-right">
+ <span t-esc="formatLang(line['pln'], dp='Account', currency_obj=res_company.currency_id)"/>
+ </td>
+ <td class="text-right">
+ <span t-esc="formatLang(line['prac'], dp='Account', currency_obj=res_company.currency_id)"/>
+ </td>
+ <td class="text-center">
+ <span t-esc="formatLang(line['perc'],digits=2)"/> %
+ </td>
+ </tr>
+ <tr t-foreach="funct_total(data['form'])" t-as="tot">
+ <td>
+ <strong>Total:</strong>
+ </td>
+ <td class="text-right">
+ <strong t-esc="formatLang(tot['tot_theo'], dp='Account', currency_obj=res_company.currency_id)"/>
+ </td>
+ <td class="text-right">
+ <strong t-esc="formatLang(tot['tot_pln'], dp='Account', currency_obj=res_company.currency_id)"/>
+ </td>
+ <td class="text-right">
+ <strong t-esc="formatLang(tot['tot_prac'], dp='Account', currency_obj=res_company.currency_id)"/>
+ </td>
+ <td class="text-center">
+ <strong t-esc="formatLang(tot['tot_perc'], digits=2)"/> %
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </t>
+ </t>
+ </t>
+</template>
+</data>
+</openerp>
diff --git a/addons/account_budget/wizard/account_budget_analytic.py b/addons/account_budget/wizard/account_budget_analytic.py
index 90285b90d1e..a58b804ebbf 100644
--- a/addons/account_budget/wizard/account_budget_analytic.py
+++ b/addons/account_budget/wizard/account_budget_analytic.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+ # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
@@ -18,10 +18,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
-import time
+import time
from openerp.osv import fields, osv
+
class account_budget_analytic(osv.osv_memory):
_name = 'account.budget.analytic'
@@ -30,7 +31,7 @@ class account_budget_analytic(osv.osv_memory):
'date_from': fields.date('Start of period', required=True),
'date_to': fields.date('End of period', required=True),
}
- _defaults= {
+ _defaults = {
'date_from': lambda *a: time.strftime('%Y-01-01'),
'date_to': lambda *a: time.strftime('%Y-%m-%d'),
}
@@ -40,15 +41,11 @@ class account_budget_analytic(osv.osv_memory):
context = {}
data = self.read(cr, uid, ids, context=context)[0]
datas = {
- 'ids': context.get('active_ids',[]),
- 'model': 'account.analytic.account',
- 'form': data
+ 'ids': context.get('active_ids', []),
+ 'model': 'account.analytic.account',
+ 'form': data
}
- return {
- 'type': 'ir.actions.report.xml',
- 'report_name': 'account.analytic.account.budget',
- 'datas': datas,
- }
-
+ datas['form']['ids'] = datas['ids']
+ return self.pool['report'].get_action(cr, uid, ids, 'account_budget.report_analyticaccountbudget', data=datas, context=context)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_budget/wizard/account_budget_crossovered_report.py b/addons/account_budget/wizard/account_budget_crossovered_report.py
index 6f89a3cd95c..96561df5af0 100644
--- a/addons/account_budget/wizard/account_budget_crossovered_report.py
+++ b/addons/account_budget/wizard/account_budget_crossovered_report.py
@@ -18,10 +18,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
-import time
+import time
from openerp.osv import fields, osv
+
class account_budget_crossvered_report(osv.osv_memory):
_name = "account.budget.crossvered.report"
@@ -40,16 +41,12 @@ class account_budget_crossvered_report(osv.osv_memory):
context = {}
data = self.read(cr, uid, ids, context=context)[0]
datas = {
- 'ids': context.get('active_ids',[]),
- 'model': 'crossovered.budget',
- 'form': data
+ 'ids': context.get('active_ids', []),
+ 'model': 'crossovered.budget',
+ 'form': data
}
+ datas['form']['ids'] = datas['ids']
datas['form']['report'] = 'analytic-full'
- return {
- 'type': 'ir.actions.report.xml',
- 'report_name': 'crossovered.budget.report',
- 'datas': datas,
- }
-
+ return self.pool['report'].get_action(cr, uid, ids, 'account_budget.report_crossoveredbudget', data=datas, context=context)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_budget/wizard/account_budget_crossovered_summary_report.py b/addons/account_budget/wizard/account_budget_crossovered_summary_report.py
index 6e3131b584c..6b676ecc684 100644
--- a/addons/account_budget/wizard/account_budget_crossovered_summary_report.py
+++ b/addons/account_budget/wizard/account_budget_crossovered_summary_report.py
@@ -18,10 +18,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
-import time
+import time
from openerp.osv import fields, osv
+
class account_budget_crossvered_summary_report(osv.osv_memory):
"""
This wizard provides the crossovered budget summary report'
@@ -32,7 +33,7 @@ class account_budget_crossvered_summary_report(osv.osv_memory):
'date_from': fields.date('Start of period', required=True),
'date_to': fields.date('End of period', required=True),
}
- _defaults= {
+ _defaults = {
'date_from': lambda *a: time.strftime('%Y-01-01'),
'date_to': lambda *a: time.strftime('%Y-%m-%d'),
}
@@ -42,17 +43,12 @@ class account_budget_crossvered_summary_report(osv.osv_memory):
context = {}
data = self.read(cr, uid, ids, context=context)[0]
datas = {
- 'ids': context.get('active_ids',[]),
- 'model': 'crossovered.budge',
- 'form': data
+ 'ids': context.get('active_ids',[]),
+ 'model': 'crossovered.budge',
+ 'form': data
}
+ datas['form']['ids'] = datas['ids']
datas['form']['report'] = 'analytic-one'
- return {
- 'type': 'ir.actions.report.xml',
- 'report_name': 'crossovered.budget.report',
- 'datas': datas,
- }
-
+ return self.pool['report'].get_action(cr, uid, ids, 'account_budget.report_crossoveredbudget', data=datas, context=context)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account_budget/wizard/account_budget_report.py b/addons/account_budget/wizard/account_budget_report.py
index 54c3180ee0d..2308b5ff9ac 100644
--- a/addons/account_budget/wizard/account_budget_report.py
+++ b/addons/account_budget/wizard/account_budget_report.py
@@ -18,8 +18,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
-import time
+import time
from openerp.osv import fields, osv
@@ -31,7 +31,7 @@ class account_budget_report(osv.osv_memory):
'date_from': fields.date('Start of period', required=True),
'date_to': fields.date('End of period', required=True),
}
- _defaults= {
+ _defaults = {
'date_from': lambda *a: time.strftime('%Y-01-01'),
'date_to': lambda *a: time.strftime('%Y-%m-%d'),
}
@@ -41,16 +41,12 @@ class account_budget_report(osv.osv_memory):
context = {}
data = self.read(cr, uid, ids, context=context)[0]
datas = {
- 'ids': context.get('active_ids',[]),
- 'model': 'account.budget.post',
- 'form': data
+ 'ids': context.get('active_ids', []),
+ 'model': 'account.budget.post',
+ 'form': data
}
- datas['form']['report']='analytic-full'
- return {
- 'type': 'ir.actions.report.xml',
- 'report_name': 'account.budget',
- 'datas': datas,
- }
-
+ datas['form']['ids'] = datas['ids']
+ datas['form']['report'] = 'analytic-full'
+ return self.pool['report'].get_action(cr, uid, ids, 'account_budget.report_budget', data=datas, context=context)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_check_writing/__openerp__.py b/addons/account_check_writing/__openerp__.py
index e01c17d66a7..3311a7c03b3 100644
--- a/addons/account_check_writing/__openerp__.py
+++ b/addons/account_check_writing/__openerp__.py
@@ -31,10 +31,12 @@ Module for the Check Writing and Check Printing.
'depends' : ['account_voucher'],
'data': [
'wizard/account_check_batch_printing_view.xml',
- 'account_check_writing_report.xml',
'account_view.xml',
'account_voucher_view.xml',
'account_check_writing_data.xml',
+ 'data/report_paperformat.xml',
+ 'views/report_check.xml',
+ 'account_check_writing_report.xml',
],
'demo': ['account_demo.xml'],
'test': [],
diff --git a/addons/account_check_writing/account_check_writing_report.xml b/addons/account_check_writing/account_check_writing_report.xml
index eece4e4a5da..d32dd77bc8f 100644
--- a/addons/account_check_writing/account_check_writing_report.xml
+++ b/addons/account_check_writing/account_check_writing_report.xml
@@ -1,29 +1,17 @@
<?xml version="1.0"?>
<openerp>
<data>
- <report id="account_print_check_top"
- string="Print Check (Top)"
- model="account.voucher"
- name="account.print.check.top"
- rml="account_check_writing/report/check_print_top.rml"
- multi="True"
- auto="False"/>
+ <report
+ id="action_report_check"
+ model="account.voucher"
+ string="Check"
+ report_type="qweb-pdf"
+ name="account_check_writing.report_check"
+ file="account_check_writing.report_check"
+ />
- <report id="account_print_check_middle"
- string="Print Check (Middle)"
- model="account.voucher"
- name="account.print.check.middle"
- rml="account_check_writing/report/check_print_middle.rml"
- multi="True"
- auto="False"/>
-
- <report id="account_print_check_bottom"
- string="Print Check (Bottom)"
- model="account.voucher"
- name="account.print.check.bottom"
- rml="account_check_writing/report/check_print_bottom.rml"
- multi="True"
- auto="False"/>
-
- </data>
+ <record id="action_report_check" model="ir.actions.report.xml">
+ <field name="paperformat_id" ref="account_check_writing.paperformat_frenchcheck"/>
+ </record>
+ </data>
</openerp>
diff --git a/addons/account_check_writing/data/report_paperformat.xml b/addons/account_check_writing/data/report_paperformat.xml
new file mode 100644
index 00000000000..3782b8bde40
--- /dev/null
+++ b/addons/account_check_writing/data/report_paperformat.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <record id="paperformat_frenchcheck" model="report.paperformat">
+ <field name="name">French Bank Check</field>
+ <field name="default" eval="True"/>
+ <field name="format">custom</field>
+ <field name="page_height">80</field>
+ <field name="page_width">175</field>
+ <field name="orientation">Portrait</field>
+ <field name="margin_top">3</field>
+ <field name="margin_bottom">3</field>
+ <field name="margin_left">3</field>
+ <field name="margin_right">3</field>
+ <field name="header_line" eval="False" />
+ <field name="header_spacing">3</field>
+ <field name="dpi">80</field>
+ </record>
+ </data>
+</openerp>
diff --git a/addons/account_check_writing/report/check_print.py b/addons/account_check_writing/report/check_print.py
index add79fcc35a..be5feb4662b 100644
--- a/addons/account_check_writing/report/check_print.py
+++ b/addons/account_check_writing/report/check_print.py
@@ -20,8 +20,9 @@
##############################################################################
import time
+from openerp.osv import osv
from openerp.report import report_sxw
-from openerp.tools import amount_to_text_en
+
class report_print_check(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
@@ -33,13 +34,14 @@ class report_print_check(report_sxw.rml_parse):
'get_lines': self.get_lines,
'fill_stars' : self.fill_stars,
})
+
def fill_stars(self, amount):
if len(amount) < 100:
stars = 100 - len(amount)
return ' '.join([amount,'*'*stars])
else: return amount
-
+
def get_lines(self, voucher_lines):
result = []
self.number_lines = len(voucher_lines)
@@ -63,24 +65,11 @@ class report_print_check(report_sxw.rml_parse):
result.append(res)
return result
-report_sxw.report_sxw(
- 'report.account.print.check.top',
- 'account.voucher',
- 'addons/account_check_writing/report/check_print_top.rml',
- parser=report_print_check,header=False
-)
-report_sxw.report_sxw(
- 'report.account.print.check.middle',
- 'account.voucher',
- 'addons/account_check_writing/report/check_print_middle.rml',
- parser=report_print_check,header=False
-)
+class report_check(osv.AbstractModel):
+ _name = 'report.account_check_writing.report_check'
+ _inherit = 'report.abstract_report'
+ _template = 'account_check_writing.report_check'
+ _wrapped_report_class = report_print_check
-report_sxw.report_sxw(
- 'report.account.print.check.bottom',
- 'account.voucher',
- 'addons/account_check_writing/report/check_print_bottom.rml',
- parser=report_print_check,header=False
-)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_check_writing/report/check_print_bottom.rml b/addons/account_check_writing/report/check_print_bottom.rml
deleted file mode 100644
index f9add2fe60b..00000000000
--- a/addons/account_check_writing/report/check_print_bottom.rml
+++ /dev/null
@@ -1,318 +0,0 @@
-<?xml version="1.0"?>
-<document filename="test.pdf">
- <template pageSize="(595, 842)" title="Test" author="Martin Simon" allowSplitting="20">
- <pageTemplate id="first">
- <frame id="first" x1="13.0" y1="0.0" width="567" height="765"/>
- </pageTemplate>
- </template>
- <stylesheet>
- <blockTableStyle id="Standard_Outline">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table1">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table4">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table5">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table12">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table2">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table6">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table10">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table11">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table3">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table7">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table8">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table9">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <initialize>
- <paraStyle name="all" alignment="justify"/>
- </initialize>
- <paraStyle name="P1" rightIndent="-1.0" leftIndent="0.0" fontName="Helvetica"/>
- <paraStyle name="P2" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica"/>
- <paraStyle name="P3" fontName="Helvetica"/>
- <paraStyle name="P4" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT"/>
- <paraStyle name="P5" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT"/>
- <paraStyle name="P6" fontName="Helvetica-Bold" fontSize="9.0" leading="11"/>
- <paraStyle name="P7" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/>
- <paraStyle name="P8" fontName="Helvetica" fontSize="9.0" leading="11"/>
- <paraStyle name="P9" fontName="Helvetica" fontSize="10.0" leading="13"/>
- <paraStyle name="P10" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT"/>
- <paraStyle name="P11" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT"/>
- <paraStyle name="P12" fontName="Helvetica" fontSize="12.0" leading="15"/>
- <paraStyle name="P13" fontName="Helvetica"/>
- <paraStyle name="P14" fontName="Helvetica" fontSize="10.0" leading="13"/>
- <paraStyle name="P15" fontName="Helvetica" fontSize="10.0" leading="13"/>
- <paraStyle name="P16" fontName="Helvetica-Bold" fontSize="9.0" leading="11"/>
- <paraStyle name="P17" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/>
- <paraStyle name="P18" fontName="Helvetica" fontSize="9.0" leading="11"/>
- <paraStyle name="P19" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT"/>
- <paraStyle name="P20" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT"/>
- <paraStyle name="P21" fontName="Helvetica" fontSize="8.0" leading="10"/>
- <paraStyle name="P22" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT"/>
- <paraStyle name="P23" fontName="Helvetica-Bold" fontSize="8.0" leading="10"/>
- <paraStyle name="P24" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT"/>
- <paraStyle name="Standard" fontName="Helvetica"/>
- <paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Caption" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="Index" fontName="Helvetica"/>
- <paraStyle name="Table Contents" fontName="Helvetica"/>
- <paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER"/>
- <images/>
- </stylesheet>
- <story>
- <para style="P1">[[repeatIn(objects,'voucher')]]</para>
- <blockTable colWidths="568.0" style="Table2" rowHeights="285">
- <tr>
- <td>
- <blockTable colWidths="445.0,117.0" style="Table6">
- <tr>
- <td>
- <para style="P16">[[voucher.partner_id.name]]</para>
- </td>
- <td>
- <para style="P16">[[ formatLang(voucher.date , date=True) or '' ]] [[ voucher.journal_id.use_preprint_check and voucher.chk_seq or '' ]]</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="81.0,186.0,83.0,81.0,54.0,78.0" style="Table10">
- <tr>
- <td>
- <para style="P4">Due Date</para>
- </td>
- <td>
- <para style="P4">Description</para>
- </td>
- <td>
- <para style="P4">Original Amount</para>
- </td>
- <td>
- <para style="P4">Balance Due</para>
- </td>
- <td>
- <para style="P4">Discount</para>
- </td>
- <td>
- <para style="P4">Payment</para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="P19">[[ repeatIn(get_lines(voucher.line_dr_ids),'l') ]] [[ formatLang(l['date_original'] ,date=True) or '' ]]</para>
- </td>
- <td>
- <para style="P19">[[ l['name'] ]]</para>
- </td>
- <td>
- <para style="P19">[[formatLang( l['amount_original']) ]]</para>
- </td>
- <td>
- <para style="P19">[[ formatLang( l['amount_due']) ]]</para>
- </td>
- <td>
- <para style="P19">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="P19">[[ formatLang (l['amount']) ]]</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="485.0,77.0" style="Table11">
- <tr>
- <td>
- <para style="P24">Check Amount</para>
- </td>
- <td>
- <para style="P23">[[ formatLang (voucher.amount) ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="P3">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="568.0" style="Table3">
- <tr>
- <td>
- <blockTable colWidths="446.0,116.0" style="Table7">
- <tr>
- <td>
- <para style="P16">[[voucher.partner_id.name]]</para>
- </td>
- <td>
- <para style="P16">[[ formatLang(voucher.date , date=True) or '' ]] [[ voucher.journal_id.use_preprint_check and voucher.chk_seq or '' ]]</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="82.0,185.0,89.0,76.0,52.0,78.0" style="Table8">
- <tr>
- <td>
- <para style="P4">Due Date</para>
- </td>
- <td>
- <para style="P4">Description</para>
- </td>
- <td>
- <para style="P4">Original Amount</para>
- </td>
- <td>
- <para style="P4">Balance Due</para>
- </td>
- <td>
- <para style="P4">Discount</para>
- </td>
- <td>
- <para style="P4">Payment</para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="P19">[[ repeatIn(get_lines(voucher.line_dr_ids),'l') ]] [[ formatLang(l['date_original'] ,date=True) or '' ]]</para>
- </td>
- <td>
- <para style="P19">[[ l['name'] ]]</para>
- </td>
- <td>
- <para style="P19">[[ formatLang (l['amount_original']) ]]</para>
- </td>
- <td>
- <para style="P19">[[ formatLang (l['amount_due']) ]]</para>
- </td>
- <td>
- <para style="P19">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="P19">[[ formatLang (l['amount']) ]]</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="485.0,77.0" style="Table9" rowHeights="40.5">
- <tr>
- <td>
- <para style="P17">Check Amount</para>
- </td>
- <td>
- <para style="P16">[[ formatLang (voucher.amount) ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="P3">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- </blockTable>
- <para style="P2">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="568.0" style="Table1">
- <tr>
- <td>
- <blockTable colWidths="370.0,130.0,75.0" rowHeights="65.5,30" style="Table5">
- <tr>
- <td>
- <para style="P9"></para>
- </td>
- <td>
- </td>
- <td>
- <para style="P9">[[ voucher.journal_id.use_preprint_check and voucher.chk_seq or '' ]]</para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="P9"></para>
- </td>
- <td>
- <para style="P9">[[ formatLang(voucher.date , date=True) or '' ]]</para>
- </td>
- <td>
- <para style="P9">[[ formatLang (voucher.amount) ]]</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="54.0,500.0" rowHeights="65" style="Table12">
- <tr>
- <td>
- <para style="P3">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="P15">[[ voucher.partner_id.name ]]</para>
- <para style="P15">[[ display_address(voucher.partner_id) or removeParentNode('para') ]]</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="550.0" rowHeights="93" style="Table5">
- <tr>
- <td>
- <para style="P9">[[ fill_stars(voucher.amount_in_word) ]]</para>
- </td>
- </tr>
- </blockTable>
-
- <blockTable colWidths="25.0,500" style="Table12">
- <tr>
- <td>
- <para style="P3">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="P3">
- <font color="white"> </font>
- </para>
- <!--para style="P15">[[ voucher.name ]]</para-->
- </td>
- </tr>
- </blockTable>
- <para style="P3">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- </blockTable>
- </story>
-</document>
diff --git a/addons/account_check_writing/report/check_print_middle.rml b/addons/account_check_writing/report/check_print_middle.rml
deleted file mode 100644
index b1fffca662d..00000000000
--- a/addons/account_check_writing/report/check_print_middle.rml
+++ /dev/null
@@ -1,356 +0,0 @@
-<?xml version="1.0"?>
-<document filename="test.pdf">
- <template pageSize="(595, 842)" title="Test" author="Martin Simon" allowSplitting="20">
- <!-- Letter 612.0, 792.0 A4 595, 842 -->
- <pageTemplate id="first">
- <frame id="first" x1="13.0" y1="0.0" width="567" height="785"/>
- </pageTemplate>
- </template>
- <stylesheet>
- <blockTableStyle id="Standard_Outline">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table1">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table4">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table5">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table12">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table2">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table6">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table10">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table11">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table3">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table7">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table8">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table9">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <initialize>
- <paraStyle name="all" alignment="justify"/>
- </initialize>
- <paraStyle name="P1" rightIndent="-1.0" leftIndent="0.0" fontName="Helvetica"/>
- <paraStyle name="P2" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica"/>
- <paraStyle name="P3" fontName="Helvetica"/>
- <paraStyle name="P4" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT"/>
- <paraStyle name="P5" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT"/>
- <paraStyle name="P6" fontName="Helvetica-Bold" fontSize="9.0" leading="11"/>
- <paraStyle name="P7" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/>
- <paraStyle name="P8" fontName="Helvetica" fontSize="9.0" leading="11"/>
- <paraStyle name="P9" fontName="Helvetica" fontSize="10.0" leading="13"/>
- <paraStyle name="P10" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT"/>
- <paraStyle name="P11" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT"/>
- <paraStyle name="P12" fontName="Helvetica" fontSize="12.0" leading="15"/>
- <paraStyle name="P13" fontName="Helvetica"/>
- <paraStyle name="P14" fontName="Helvetica" fontSize="10.0" leading="13"/>
- <paraStyle name="P15" fontName="Helvetica" fontSize="10.0" leading="13"/>
- <paraStyle name="P16" fontName="Helvetica-Bold" fontSize="9.0" leading="11"/>
- <paraStyle name="P17" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/>
- <paraStyle name="P18" fontName="Helvetica" fontSize="9.0" leading="11"/>
- <paraStyle name="P19" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT"/>
- <paraStyle name="P20" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT"/>
- <paraStyle name="P21" fontName="Helvetica" fontSize="8.0" leading="10"/>
- <paraStyle name="P22" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT"/>
- <paraStyle name="P23" fontName="Helvetica-Bold" fontSize="8.0" leading="10"/>
- <paraStyle name="P24" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT"/>
- <paraStyle name="Standard" fontName="Helvetica"/>
- <paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Caption" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="Index" fontName="Helvetica"/>
- <paraStyle name="Table Contents" fontName="Helvetica"/>
- <paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER"/>
- <images/>
- </stylesheet>
- <story>
- <para style="P1">[[repeatIn(objects,'voucher')]]</para>
- <blockTable colWidths="568.0" style="Table2" rowHeights="320">
- <tr>
- <td>
- <blockTable colWidths="485.0,67.0" style="Table6">
- <tr>
- <td>
- <para style="P16"></para>
- </td>
- <td>
- <para style="P14">[[ voucher.journal_id.use_preprint_check and voucher.chk_seq or '' ]]</para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="P16">[[voucher.partner_id.name]]</para>
- </td>
- <td>
- <para style="P16">[[ formatLang(voucher.date , date=True) or '' ]]</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="81.0,186.0,83.0,81.0,54.0,78.0" style="Table10">
- <tr>
- <td>
- <para style="P4">Due Date</para>
- </td>
- <td>
- <para style="P4">Description</para>
- </td>
- <td>
- <para style="P4">Original Amount</para>
- </td>
- <td>
- <para style="P4">Balance Due</para>
- </td>
- <td>
- <para style="P4">Discount</para>
- </td>
- <td>
- <para style="P4">Payment</para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="P19">[[ repeatIn(get_lines(voucher.line_dr_ids),'l') ]] [[ formatLang(l['date_original'] ,date=True) or '' ]]</para>
- </td>
- <td>
- <para style="P19">[[ l['name'] ]]</para>
- </td>
- <td>
- <para style="P19">[[formatLang( l['amount_original']) ]]</para>
- </td>
- <td>
- <para style="P19">[[ formatLang( l['amount_due']) ]]</para>
- </td>
- <td>
- <para style="P19">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="P19">[[ formatLang (l['amount']) ]]</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="485.0,77.0" style="Table11">
- <tr>
- <td>
- <para style="P24">Check Amount</para>
- </td>
- <td>
- <para style="P23">[[ formatLang (voucher.amount) ]]</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="485.0,77.0" rowHeights="158,10" style="Table11">
- <tr>
- <td>
- </td>
- <td>
- </td>
- </tr>
- <tr>
- <td>
- </td>
- <td>
- <para style="P14">[[ voucher.journal_id.use_preprint_check and voucher.chk_seq or '' ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="P3">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="550.0" rowHeights="10" style="Table5">
- <tr>
- <td>
- <para style="P26">[[ str(fill_stars(voucher.amount_in_word)) ]]</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="568.0" style="Table1">
- <tr>
- <td>
- <blockTable colWidths="370.0,130.0,55.0" rowHeights=".95cm" style="Table5">
- <tr>
- <td>
- <para style="P9"></para>
- </td>
- <td>
- <para style="P9"></para>
- </td>
- <td>
- <para style="P9"></para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="P9"></para>
- </td>
- <td>
- <para style="P9">[[ formatLang(voucher.date , date=True) or '' ]]</para>
- </td>
- <td>
- <para style="P9">[[ formatLang (voucher.amount) ]]</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="54.0,500.0" rowHeights="2.5cm" style="Table12">
- <tr>
- <td>
- <para style="P3">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="P15">[[ voucher.partner_id.name ]]</para>
- <para style="P15">[[ display_address(voucher.partner_id) or removeParentNode('para') ]]</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="25.0,500" rowHeights="30.5" style="Table12">
- <tr>
- <td>
- <para style="P3">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="P3">
- <font color="white"> </font>
- </para>
- <!--para style="P15">[[ voucher.name ]]</para-->
- </td>
- </tr>
- </blockTable>
- <para style="P3">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="568.0" style="Table3">
- <tr>
- <td>
- <blockTable colWidths="436.0,76.0,20.0" style="Table7">
- <tr>
- <td>
- <para style="P16"></para>
- </td>
- <td>
- <para style="P14"></para>
- </td>
- <td>
- <para style="P14"></para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="P16">[[voucher.partner_id.name]]</para>
- </td>
- <td>
- <para style="P16">[[ formatLang(voucher.date , date=True) or '' ]]</para>
- </td>
- <td>
- <para style="P14">[[ voucher.journal_id.use_preprint_check and voucher.chk_seq or '' ]]</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="82.0,185.0,89.0,76.0,52.0,78.0" style="Table8">
- <tr>
- <td>
- <para style="P4">Due Date</para>
- </td>
- <td>
- <para style="P4">Description</para>
- </td>
- <td>
- <para style="P4">Original Amount</para>
- </td>
- <td>
- <para style="P4">Balance Due</para>
- </td>
- <td>
- <para style="P4">Discount</para>
- </td>
- <td>
- <para style="P4">Payment</para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="P19">[[ repeatIn(get_lines(voucher.line_dr_ids),'l') ]] [[ formatLang(l['date_original'] ,date=True) or '' ]]</para>
- </td>
- <td>
- <para style="P19">[[ l['name'] ]]</para>
- </td>
- <td>
- <para style="P19">[[ formatLang (l['amount_original']) ]]</para>
- </td>
- <td>
- <para style="P19">[[ formatLang (l['amount_due']) ]]</para>
- </td>
- <td>
- <para style="P19">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="P19">[[ formatLang (l['amount']) ]]</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="485.0,77.0" style="Table9">
- <tr>
- <td>
- <para style="P24">Check Amount</para>
- </td>
- <td>
- <para style="P23">[[ formatLang (voucher.amount) ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="P3">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- </blockTable>
- <para style="P2">
- <font color="white"> </font>
- </para>
- </story>
-</document>
diff --git a/addons/account_check_writing/report/check_print_top.rml b/addons/account_check_writing/report/check_print_top.rml
deleted file mode 100644
index 9a4d633e680..00000000000
--- a/addons/account_check_writing/report/check_print_top.rml
+++ /dev/null
@@ -1,336 +0,0 @@
-<?xml version="1.0"?>
-<document filename="test.pdf">
- <template pageSize="(595, 842)" title="Test" author="Martin Simon" allowSplitting="20">
- <pageTemplate id="first">
- <frame id="first" x1="13.0" y1="0.0" width="567" height="841"/>
- </pageTemplate>
- </template>
- <stylesheet>
- <blockTableStyle id="Standard_Outline">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table1">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table4">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table5">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table12">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table2">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table6">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table10">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table11">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table3">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table7">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table8">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table9">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <initialize>
- <paraStyle name="all" alignment="justify"/>
- </initialize>
- <paraStyle name="P1" rightIndent="-1.0" leftIndent="0.0" fontName="Helvetica"/>
- <paraStyle name="P2" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica"/>
- <paraStyle name="P3" fontName="Helvetica"/>
- <paraStyle name="P4" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT"/>
- <paraStyle name="P5" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT"/>
- <paraStyle name="P6" fontName="Helvetica-Bold" fontSize="9.0" leading="11"/>
- <paraStyle name="P7" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/>
- <paraStyle name="P8" fontName="Helvetica" fontSize="9.0" leading="11"/>
- <paraStyle name="P9" fontName="Helvetica" fontSize="10.0" leading="13"/>
- <paraStyle name="P10" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT"/>
- <paraStyle name="P11" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT"/>
- <paraStyle name="P12" fontName="Helvetica" fontSize="12.0" leading="15"/>
- <paraStyle name="P13" fontName="Helvetica"/>
- <paraStyle name="P14" fontName="Helvetica" fontSize="10.0" leading="13"/>
- <paraStyle name="P15" fontName="Helvetica" fontSize="10.0" leading="13"/>
- <paraStyle name="P16" fontName="Helvetica-Bold" fontSize="9.0" leading="11"/>
- <paraStyle name="P17" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/>
- <paraStyle name="P18" fontName="Helvetica" fontSize="9.0" leading="11"/>
- <paraStyle name="P19" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT"/>
- <paraStyle name="P20" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT"/>
- <paraStyle name="P21" fontName="Helvetica" fontSize="8.0" leading="10"/>
- <paraStyle name="P22" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT"/>
- <paraStyle name="P23" fontName="Helvetica-Bold" fontSize="8.0" leading="10"/>
- <paraStyle name="P24" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT"/>
- <paraStyle name="Standard" fontName="Helvetica"/>
- <paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Caption" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="Index" fontName="Helvetica"/>
- <paraStyle name="Table Contents" fontName="Helvetica"/>
- <paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER"/>
- <images/>
- </stylesheet>
- <story>
- <para style="P1">[[repeatIn(objects,'voucher')]]</para>
- <blockTable colWidths="568.0" style="Table1">
- <tr>
- <td>
- <blockTable colWidths="425.0,177.0" rowHeights="107.50,25.5" style="Table4">
- <tr>
- <td>
- <para style="P6">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="P6">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="P6">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="P9">[[ formatLang(voucher.date , date=True) or '' ]] [[ voucher.journal_id.use_preprint_check and voucher.chk_seq or '' ]]</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="54.0,425.0,85.0" rowHeights="21.5" style="Table4">
- <tr>
- <td>
- <para style="P6">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="P9">[[ voucher.partner_id.name ]] </para>
- </td>
- <td>
- <para style="P12">[[ formatLang (voucher.amount) ]]</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="550.0" rowHeights="18" style="Table5">
- <tr>
- <td>
- <para style="P9">[[ fill_stars(voucher.amount_in_word) ]]</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="54.0,425.0,85.0" rowHeights="45.5" style="Table4">
- <tr>
- <td>
- <para style="P6"></para>
- </td>
- <td>
- <para style="P9">[[ voucher.partner_id.name ]] </para>
- <para style="P15">[[ display_address(voucher.partner_id) or removeParentNode('para') ]]</para>
- </td>
- <td>
- <para/>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="25.0,350,150" rowHeights="10.5" style="Table12">
- <tr>
- <td>
- <para style="P3">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="P15">[[ voucher.name ]]</para>
- </td>
- <td>
- <para style="P3">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- </blockTable>
- <para style="P3">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="568.0" style="Table2" rowHeights="255">
- <tr>
- <td>
- <blockTable colWidths="445.0,117.0" style="Table6">
- <tr>
- <td>
- <para style="P16">[[voucher.partner_id.name]]</para>
- </td>
- <td>
- <para style="P16">[[ formatLang(voucher.date , date=True) or '' ]] [[ voucher.journal_id.use_preprint_check and voucher.chk_seq or '' ]]</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="82.0,185.0,89.0,76.0,52.0,78.0" style="Table10">
- <tr>
- <td>
- <para style="P4">Due Date</para>
- </td>
- <td>
- <para style="P4">Description</para>
- </td>
- <td>
- <para style="P4">Original Amount</para>
- </td>
- <td>
- <para style="P4">Open Balance</para>
- </td>
- <td>
- <para style="P4">Discount</para>
- </td>
- <td>
- <para style="P4">Payment</para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="P19">[[ repeatIn(get_lines(voucher.line_dr_ids),'l') ]] [[ formatLang(l['date_due'] ,date=True) or '' ]]</para>
- </td>
- <td>
- <para style="P19">[[ l['name'] ]]</para>
- </td>
- <td>
- <para style="P19">[[formatLang( l['amount_original']) ]]</para>
- </td>
- <td>
- <para style="P19">[[ formatLang( l['amount_unreconciled']) ]]</para>
- </td>
- <td>
- <para style="P19">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="P19">[[ formatLang (l['amount']) ]]</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="485.0,77.0" style="Table11">
- <tr>
- <td>
- <para style="P24">Check Amount</para>
- </td>
- <td>
- <para style="P23">[[ formatLang (voucher.amount) ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="P3">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="568.0" style="Table3">
- <tr>
- <td>
- <blockTable colWidths="446.0,116.0" style="Table7">
- <tr>
- <td>
- <para style="P16">[[voucher.partner_id.name]]</para>
- </td>
- <td>
- <para style="P16">[[ formatLang(voucher.date , date=True) or '' ]] [[ voucher.journal_id.use_preprint_check and voucher.chk_seq or '' ]]</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="82.0,185.0,89.0,76.0,52.0,78.0" style="Table8">
- <tr>
- <td>
- <para style="P4">Due Date</para>
- </td>
- <td>
- <para style="P4">Description</para>
- </td>
- <td>
- <para style="P4">Original Amount</para>
- </td>
- <td>
- <para style="P4">Open Balance</para>
- </td>
- <td>
- <para style="P4">Discount</para>
- </td>
- <td>
- <para style="P4">Payment</para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="P19">[[ repeatIn(get_lines(voucher.line_dr_ids),'l') ]] [[ formatLang(l['date_due'] ,date=True) or '' ]]</para>
- </td>
- <td>
- <para style="P19">[[ l['name'] ]]</para>
- </td>
- <td>
- <para style="P19">[[ formatLang (l['amount_original']) ]]</para>
- </td>
- <td>
- <para style="P19">[[ formatLang (l['amount_unreconciled']) ]]</para>
- </td>
- <td>
- <para style="P19">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="P19">[[ formatLang (l['amount']) ]]</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="485.0,77.0" style="Table9">
- <tr>
- <td>
- <para style="P17">Check Amount</para>
- </td>
- <td>
- <para style="P16">[[ formatLang (voucher.amount) ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="P3">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- </blockTable>
- <para style="P2">
- <font color="white"> </font>
- </para>
- </story>
-</document>
diff --git a/addons/account_check_writing/views/report_check.xml b/addons/account_check_writing/views/report_check.xml
new file mode 100644
index 00000000000..d740de1a0a4
--- /dev/null
+++ b/addons/account_check_writing/views/report_check.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+<template id="report_check">
+ <t t-call="report.html_container">
+ <t t-foreach="docs" t-as="o">
+ <!-- This report is (obviously) a work in progress -->
+ <div class="page">
+ <address t-field="o.partner_id"
+ t-field-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true, "no_tag_br": true}' />
+
+ <span t-esc="formatLang(o.date , date=True)"/><br/>
+ <span t-field="o.amount"
+ t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/><br/>
+ <span t-esc="fill_stars(o.amount_in_word)"/>
+
+ <table class="table table-condensed">
+ <thead>
+ <tr>
+ <th>Due Date</th>
+ <th>Description</th>
+ <th>Original Amount</th>
+ <th>Open Balance</th>
+ <th>Discount</th>
+ <th>Payment</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr t-foreach="get_lines(o.line_dr_ids)" t-as="l">
+ <td>
+ <p t-if="l['date_due']">
+ <span t-esc="formatLang(l['date_due'], date=True)"/>
+ </p>
+ </td>
+ <td class="text-right"><span t-esc="l['name']"/></td>
+ <td class="text-right"><span t-esc="formatLang(l['amount_original'])"/></td>
+ <td class="text-right"><span t-esc="formatLang(l['amount_unreconciled'])"/></td>
+ <td class="text-right"></td>
+ <td class="text-right"><span t-esc="formatLang(l['amount'])"/></td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </t>
+ </t>
+</template>
+</data>
+</openerp>
diff --git a/addons/account_followup/__openerp__.py b/addons/account_followup/__openerp__.py
index dbb4ea6583e..61e9ea2d4ae 100644
--- a/addons/account_followup/__openerp__.py
+++ b/addons/account_followup/__openerp__.py
@@ -55,11 +55,12 @@ Note that if you want to check the follow-up level for a given partner/account e
'account_followup_view.xml',
'account_followup_customers.xml',
'wizard/account_followup_print_view.xml',
+ 'views/report_followup.xml',
+ 'account_followup_reports.xml'
],
'demo': ['account_followup_demo.xml'],
'test': [
'test/account_followup.yml',
- #TODO 'test/account_followup_report.yml', --> Need to wait for second step in order to check report (expects after first)
],
'installable': True,
'auto_install': False,
diff --git a/addons/account_followup/account_followup.py b/addons/account_followup/account_followup.py
index 9237282ad80..eae361913ad 100644
--- a/addons/account_followup/account_followup.py
+++ b/addons/account_followup/account_followup.py
@@ -21,7 +21,6 @@
from openerp.osv import fields, osv
from lxml import etree
-
from openerp.tools.translate import _
class followup(osv.osv):
@@ -189,11 +188,7 @@ class res_partner(osv.osv):
'model': 'account_followup.followup',
'form': data
}
- return {
- 'type': 'ir.actions.report.xml',
- 'report_name': 'account_followup.followup.print',
- 'datas': datas,
- }
+ return self.pool['report'].get_action(cr, uid, wizard_partner_ids, 'account_followup.report_followup', data=datas, context=context)
def do_partner_mail(self, cr, uid, partner_ids, context=None):
if context is None:
@@ -274,6 +269,9 @@ class res_partner(osv.osv):
strbegin = "<TD><B>"
strend = "</B></TD>"
followup_table +="<TR>" + strbegin + str(aml['date']) + strend + strbegin + aml['name'] + strend + strbegin + aml['ref'] + strend + strbegin + str(date) + strend + strbegin + str(aml['balance']) + strend + strbegin + block + strend + "</TR>"
+
+ total = reduce(lambda x, y: x+y['balance'], currency_dict['line'], 0.00)
+
total = rml_parse.formatLang(total, dp='Account', currency_obj=currency)
followup_table += '''<tr> </tr>
</table>
diff --git a/addons/account_followup/account_followup_reports.xml b/addons/account_followup/account_followup_reports.xml
new file mode 100644
index 00000000000..16149a5fd47
--- /dev/null
+++ b/addons/account_followup/account_followup_reports.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<openerp>
+ <data>
+ <report
+ id="action_report_followup"
+ model="account_followup.followup"
+ string="Follow-up Report"
+ report_type="qweb-pdf"
+ name="account_followup.report_followup"
+ file="account_followup.report_followup"
+ menu="False"
+ />
+ </data>
+</openerp>
diff --git a/addons/account_followup/account_followup_view.xml b/addons/account_followup/account_followup_view.xml
index e233feb489e..57f71566db0 100644
--- a/addons/account_followup/account_followup_view.xml
+++ b/addons/account_followup/account_followup_view.xml
@@ -132,7 +132,6 @@
id="menu_manual_reconcile_followup"/>
<menuitem action="action_account_followup_definition_form" id="account_followup_menu" parent="account.menu_finance_configuration" name="Follow-up Levels"/>
- <report auto="False" id="account_followup_followup_report" menu="False" model="account_followup.followup" name="account_followup.followup.print" rml="account_followup/report/account_followup_print.rml" string="Follow-up Report"/>
<record id="account_move_line_partner_tree" model="ir.ui.view">
<field name="name">account.move.line.partner.tree</field>
diff --git a/addons/account_followup/report/account_followup_print.py b/addons/account_followup/report/account_followup_print.py
index eecba81acb9..4e856853915 100644
--- a/addons/account_followup/report/account_followup_print.py
+++ b/addons/account_followup/report/account_followup_print.py
@@ -21,9 +21,10 @@
import time
from collections import defaultdict
-
+from openerp.osv import osv
from openerp.report import report_sxw
+
class report_rappel(report_sxw.rml_parse):
_name = "account_followup.report.rappel"
@@ -108,8 +109,11 @@ class report_rappel(report_sxw.rml_parse):
}
return text
-report_sxw.report_sxw('report.account_followup.followup.print',
- 'account_followup.stat.by.partner', 'addons/account_followup/report/account_followup_print.rml',
- parser=report_rappel)
+
+class report_followup(osv.AbstractModel):
+ _name = 'report.account_followup.report_followup'
+ _inherit = 'report.abstract_report'
+ _template = 'account_followup.report_followup'
+ _wrapped_report_class = report_rappel
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_followup/report/account_followup_print.rml b/addons/account_followup/report/account_followup_print.rml
deleted file mode 100644
index 6eadaed8675..00000000000
--- a/addons/account_followup/report/account_followup_print.rml
+++ /dev/null
@@ -1,238 +0,0 @@
-<?xml version="1.0"?>
-<document filename="Account Follow-up.pdf">
- <template title="Account Follow-up" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
- <pageTemplate id="first">
- <frame id="first" x1="31.0" y1="28.0" width="532" height="786"/>
- </pageTemplate>
- </template>
- <stylesheet>
- <blockTableStyle id="Standard_Outline">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Tableau2">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table1">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="7,-1" stop="7,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="8,-1" stop="8,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table5">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="7,-1" stop="7,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="8,-1" stop="8,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table2">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="3,0" stop="3,0"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="4,0" stop="4,0"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="5,0" stop="5,0"/>
- </blockTableStyle>
- <blockTableStyle id="Table3">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="3,0" stop="3,0"/>
- </blockTableStyle>
- <blockTableStyle id="Table15">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,1" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,1" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,1" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,1" stop="3,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="4,1" stop="4,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="5,1" stop="5,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="6,1" stop="6,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="7,1" stop="7,-1"/>
- </blockTableStyle>
-
- <initialize>
- <paraStyle name="all" alignment="justify"/>
- </initialize>
- <paraStyle name="Standard" fontName="Helvetica"/>
- <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Table Contents" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Caption" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="Index" fontName="Helvetica"/>
- <paraStyle name="Heading" fontName="Helvetica" fontSize="15.0" leading="19" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Footer" fontName="Helvetica"/>
- <paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
- <paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_9_followup_id" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <images/>
- </stylesheet>
- <story>
- <para style="terp_default_8">[[ repeatIn(ids_to_objects(data['form']['partner_ids']),'o') ]] </para>
- <para style="terp_default_8">[[ setLang(o.partner_id.lang) ]]</para>
-
- <blockTable colWidths="298.0,234.0" style="Tableau2">
- <tr>
- <td>
- </td>
- <td>
- <para style="terp_default_9">[[ o.partner_id.name or '' ]]</para>
- <para style="terp_default_9">[[ display_address(o.partner_id) or '']]</para>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- <para style="terp_default_9">VAT: [[ o.partner_id.vat or removeParentNode('para') ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <para style="terp_default_9">Document : Customer account statement</para>
- <para style="terp_default_9">Date : [[ formatLang(data['form']['date'],date=True) ]]</para>
- <para style="terp_default_9">Customer Ref : [[ o.partner_id.ref or '' ]]</para>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <para style="terp_default_9"><pre style="terp_default_9_followup_id">[[ format(get_text(o,data['form']['followup_id'])) ]]</pre></para>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- <section>
-
- <blockTable colWidths="70.0,95.0,89.0,75.0,89.0,29.0" style="Table1">
- <para style="terp_default_8">[[repeatIn(getLines(o), 'cur_lines') ]]</para>
- <tr>
- <td>
- <para style="terp_tblheader_Details_Centre">Invoice Date</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Description</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Ref</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Maturity Date</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Amount</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Li.</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="70.0,95.0,89.0,75.0,89.0,29.0" style="Table15">
- <tr>
- <para style="terp_default_8">[[repeatIn(cur_lines['line'], 'line') ]]</para>
- <td>
- <para style="terp_default_Centre_9">[[ formatLang(line['date'],date = True) ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_9">[[ line['name'] ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_9">[[ line['ref'] ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_9">[[ line['date_maturity'] and formatLang(line['date_maturity'], date=True) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang(line['balance'], currency_obj=line['currency_id']) ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_9">[[ line['blocked'] and 'X' or '' ]]</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="260.0,70.0,89.0,29.0" style="Table2">
- <tr>
- <td>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Total: </para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[formatLang(reduce(lambda x,y: x+y['balance'], cur_lines['line'], 0.00), currency_obj=line['currency_id']) ]] </para>
- </td>
- <td>
- <para style="terp_default_Right_9">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- </blockTable>
-
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
-
- </section>
-
- </story>
-</document>
diff --git a/addons/account_followup/tests/test_account_followup.py b/addons/account_followup/tests/test_account_followup.py
index 9e70430c518..b3025021278 100644
--- a/addons/account_followup/tests/test_account_followup.py
+++ b/addons/account_followup/tests/test_account_followup.py
@@ -59,7 +59,6 @@ class TestAccountFollowup(TransactionCase):
self.wizard.do_process(cr, uid, [self.wizard_id], context={"followup_id": self.followup_id})
self.assertFalse(self.partner.browse(cr, uid, self.partner_id).latest_followup_level_id)
-
def run_wizard_three_times(self):
cr, uid = self.cr, self.uid
current_date = datetime.datetime.utcnow()
@@ -131,7 +130,7 @@ class TestAccountFollowup(TransactionCase):
self.run_wizard_three_times()
self.assertEqual(self.partner.browse(cr, uid, self.partner_id).latest_followup_level_id.id,
self.last_followup_line_id, "Lines are not equal")
-
+
def test_06_pay_the_invoice(self):
"""Run wizard until manual action, pay the invoice and check that partner has no follow-up level anymore and after running the wizard the action is empty"""
cr, uid = self.cr, self.uid
@@ -148,7 +147,6 @@ class TestAccountFollowup(TransactionCase):
'followup_id': self.followup_id
}, context={"followup_id": self.followup_id})
self.wizard.do_process(cr, uid, [self.wizard_id], context={"followup_id": self.followup_id})
- partner_ref = self.partner.browse(cr, uid, self.partner_id)
self.assertEqual(0, self.partner.browse(cr, uid, self.partner_id).payment_amount_due, "Amount Due != 0")
self.assertFalse(self.partner.browse(cr, uid, self.partner_id).payment_next_action_date, "Next action date not cleared")
diff --git a/addons/account_followup/views/report_followup.xml b/addons/account_followup/views/report_followup.xml
new file mode 100644
index 00000000000..6c79fe4cc55
--- /dev/null
+++ b/addons/account_followup/views/report_followup.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+<template id="report_followup">
+ <t t-call="report.html_container">
+ <t t-foreach="ids_to_objects(data['form']['partner_ids'])" t-as="o">
+ <t t-call="report.external_layout">
+ <div class="page">
+ <div class="row">
+ <div class="col-xs-4 col-xs-offset-6">
+ <div t-field="o.partner_id"
+ t-field-options='{"widget": "contact", "fields": ["address", "name", "phone", "fax"], "no_marker": true}'/>
+ <span t-field="o.partner_id.vat"/>
+ </div>
+ </div>
+
+ <p>
+ Document: Customer account statement<br/>
+ Date: <span t-esc="formatLang(data['form']['date'], date=True)"/><br/>
+ Customer ref: <span t-field="o.partner_id.ref"/>
+ </p>
+
+ <p t-raw="get_text(o,data['form']['followup_id']).replace('\n', '&lt;br&gt;')"/>
+
+ <t t-foreach="getLines(o)" t-as="cur_lines">
+ <table class="table table-condensed" style="margin-top: 50px;">
+ <thead>
+ <tr>
+ <th>Invoice Date</th>
+ <th>Description</th>
+ <th class="text-center">Ref</th>
+ <th class="text-center">Maturity Date</th>
+ <th class="text-right">Amount</th>
+ <th class="text-center">Li.</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr t-foreach="cur_lines['line']" t-as="line">
+ <td><span t-esc="formatLang(line['date'],date = True)"/></td>
+ <td><span t-esc="line['name']"/></td>
+ <td><span t-esc="line['ref']"/></td>
+ <td class="text-center"><span t-esc="line['date_maturity'] and formatLang(line['date_maturity'], date=True)"/></td>
+ <td class="text-right"><span t-esc="formatLang(line['balance'], currency_obj=line['currency_id'])"/></td>
+ <td><span t-esc="line['blocked'] and 'X' or ''"/></td>
+ </tr>
+ </tbody>
+ </table>
+
+ <t t-set="total" t-value="reduce(lambda x,y: x+y['balance'], cur_lines['line'], 0.00)"/>
+ <p>Total: <span t-esc="formatLang(total, currency_obj=res_company.currency_id)"/></p>
+ </t>
+ </div>
+ </t>
+ </t>
+ </t>
+</template>
+</data>
+</openerp>
diff --git a/addons/account_followup/wizard/account_followup_print.py b/addons/account_followup/wizard/account_followup_print.py
index 00ecab7b860..7b7cb8fc77e 100644
--- a/addons/account_followup/wizard/account_followup_print.py
+++ b/addons/account_followup/wizard/account_followup_print.py
@@ -218,18 +218,18 @@ class account_followup_print(osv.osv_memory):
#Update partners
self.do_update_followup_level(cr, uid, to_update, partner_list, date, context=context)
#process the partners (send mails...)
- restot = self.process_partners(cr, uid, partner_list, data, context=context)
+ restot_context = context.copy()
+ restot = self.process_partners(cr, uid, partner_list, data, context=restot_context)
+ context.update(restot_context)
#clear the manual actions if nothing is due anymore
nbactionscleared = self.clear_manual_actions(cr, uid, partner_list, context=context)
if nbactionscleared > 0:
restot['resulttext'] = restot['resulttext'] + "<li>" + _("%s partners have no credits and as such the action is cleared") %(str(nbactionscleared)) + "</li>"
- res = restot['action']
-
#return the next action
mod_obj = self.pool.get('ir.model.data')
model_data_ids = mod_obj.search(cr, uid, [('model','=','ir.ui.view'),('name','=','view_account_followup_sending_results')], context=context)
resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
- context.update({'description': restot['resulttext'], 'needprinting': restot['needprinting'], 'report_data': res})
+ context.update({'description': restot['resulttext'], 'needprinting': restot['needprinting'], 'report_data': restot['action']})
return {
'name': _('Send Letters and Emails: Actions Summary'),
'view_type': 'form',
diff --git a/addons/account_payment/__openerp__.py b/addons/account_payment/__openerp__.py
index 4c3c8f045e3..c5cccc38c26 100644
--- a/addons/account_payment/__openerp__.py
+++ b/addons/account_payment/__openerp__.py
@@ -54,6 +54,8 @@ have a new option to import payment orders as bank statement lines.
'account_payment_workflow.xml',
'account_payment_sequence.xml',
'account_payment_report.xml',
+
+ 'views/report_paymentorder.xml',
],
'demo': ['account_payment_demo.xml'],
'test': [
diff --git a/addons/account_payment/account_payment_report.xml b/addons/account_payment/account_payment_report.xml
index 699207e1733..3a57abe901f 100644
--- a/addons/account_payment/account_payment_report.xml
+++ b/addons/account_payment/account_payment_report.xml
@@ -1,6 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
- <report auto="True" id="payment_order1" model="payment.order" name="payment.order" rml="account_payment/report/order.rml" string="Payment Order"/>
+ <report
+ id="action_report_payment_order"
+ model="payment.order"
+ string="Payment Order"
+ report_type="qweb-pdf"
+ name="account_payment.report_paymentorder"
+ file="account_payment.report_paymentorder"
+ />
</data>
</openerp>
diff --git a/addons/account_payment/report/order.rml b/addons/account_payment/report/order.rml
deleted file mode 100644
index 02675baf0b2..00000000000
--- a/addons/account_payment/report/order.rml
+++ /dev/null
@@ -1,290 +0,0 @@
-<?xml version="1.0"?>
-<document filename="Payment Order.pdf">
- <template title="Payment Order" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
- <pageTemplate id="first">
- <frame id="first" x1="34.0" y1="34.0" width="527" height="774"/>
- </pageTemplate>
- </template>
- <stylesheet>
- <blockTableStyle id="Standard_Outline">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table1">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table6">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="4,0" stop="4,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="4,0" stop="4,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="4,0" stop="4,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table7">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="4,0" stop="4,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#cccccc" start="4,0" stop="4,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="4,0" stop="4,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table3">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table4">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table5">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEABOVE" colorName="#ffffff" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#ffffff" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="3,0" stop="3,0"/>
- </blockTableStyle>
- <initialize>
- <paraStyle name="all" alignment="justify"/>
- </initialize>
- <paraStyle name="Standard" fontName="Helvetica"/>
- <paraStyle name="Heading" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Caption" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="Index" fontName="Helvetica"/>
- <paraStyle name="Table Contents" fontName="Helvetica"/>
- <paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER"/>
- <paraStyle name="Footer" fontName="Helvetica"/>
- <paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
- <paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Space" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="9.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_space_0.2" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <images/>
- </stylesheet>
- <story>
- <pto>
- <pto_header>
- <blockTable colWidths="112.0,86.0,106.0,63.0,85.0,75.0" style="Table3">
- <tr>
- <td>
- <para style="terp_tblheader_Details">Partner</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Bank Account</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Invoice Ref</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Value Date</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Amount</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Currency</para>
- </td>
- </tr>
- </blockTable>
- </pto_header>
- <para style="terp_default_8">[[ repeatIn(objects, 'o') ]]</para>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="318.0,210.0" style="Table1">
- <tr>
- <td>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_address">[[ o.mode and o.mode.bank_id.bank and o.mode.bank_id.bank.name or '']]</para>
- <para style="terp_default_address">[[ o.mode and o.mode.bank_id.bank and o.mode.bank_id.bank.street or '']]</para>
- <para style="terp_default_address">[[ o.mode and o.mode.bank_id.bank and o.mode.bank_id.bank.street2 or removeParentNode('para')]]</para>
- <para style="terp_default_address">[[ o.mode and o.mode.bank_id.bank and o.mode.bank_id.bank.zip or '']] [[ o.mode and o.mode.bank_id.bank and o.mode.bank_id.bank.city or '']]</para>
- <para style="terp_default_address">[[ o.mode and o.mode.bank_id.bank and o.mode.bank_id.bank.state and o.mode.bank_id.bank.state.name or removeParentNode('para') ]]</para>
- <para style="terp_default_address">[[ o.mode and o.mode.bank_id.bank and o.mode.bank_id.bank.country and o.mode.bank_id.bank.country.name or '']]</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <para style="terp_header">Payment Order / Payment</para>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="106.0,106.0,106.0,106.0,106.0" style="Table6">
- <tr>
- <td>
- <para style="terp_tblheader_General_Centre">Payment Type</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Reference</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Used Account</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Execution Type</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Company Currency</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="106.0,106.0,106.0,106.0,106.0" style="Table7">
- <tr>
- <td>
- <para style="terp_default_Centre_8">[[ o.mode and o.mode.name or '-' ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ o.reference or '-' ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[get_account_name(o.mode.bank_id.id)]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ o.date_prefered == 'now' and 'Now' or removeParentNode('para') ]]</para>
- <para style="terp_default_Centre_8">[[ o.date_prefered == 'due' and 'Due date' or removeParentNode('para') ]]</para>
- <para style="terp_default_Centre_8">[[ o.date_prefered == 'fixed' and 'Fixed date' or removeParentNode('para') ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_8">[[ o.user_id and o.user_id.company_id and o.user_id.company_id.currency_id and o.user_id.company_id.currency_id.name or '' ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="112.0,86.0,102.0,70.0,82.0,75.0" style="Table3">
- <tr>
- <td>
- <para style="terp_tblheader_Details">Partner</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Bank Account</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Invoice Ref</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Value Date</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Amount</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Currency</para>
- </td>
- </tr>
- </blockTable>
- <section>
- <para style="terp_default_2">[[repeatIn(o.line_ids, 'line') ]]</para>
- <blockTable colWidths="112.0,86.0,102.0,70.0,82.0,75.0" style="Table4">
- <tr>
- <td>
- <para style="terp_default_9">[[line.partner_id and line.partner_id.name or '-' ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_9">[[get_account_name(line.bank_id.id) or '-']]</para>
- </td>
- <td>
- <para style="terp_default_Centre_9">[[ get_invoice_name(line.ml_inv_ref.id) or '-' ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_9">[[not line.date and '-' or formatLang(line.date,date=True) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang(line.amount or 0.0, currency_obj=line.company_currency) ]] </para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang(line.amount_currency, currency_obj=line.currency) ]] </para>
- </td>
- </tr>
- </blockTable>
- </section>
- <blockTable colWidths="335.0,32.0,85.0,75.0" style="Table5">
- <tr>
- <td>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_Bold_9">Total:</para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang(get_amount_total(o), currency_obj=o.company_id.currency_id) or '' ]] </para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang(get_amount_total_in_currency(o), currency_obj=(o.line_ids and o.line_ids[0].currency or None)) or '' ]] </para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- </pto>
- </story>
-</document>
diff --git a/addons/account_payment/report/payment_order.py b/addons/account_payment/report/payment_order.py
index a851a54ecbb..292d0e11bf4 100644
--- a/addons/account_payment/report/payment_order.py
+++ b/addons/account_payment/report/payment_order.py
@@ -20,9 +20,10 @@
##############################################################################
import time
-
+from openerp.osv import osv
from openerp.report import report_sxw
+
class payment_order(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context=None):
@@ -70,6 +71,11 @@ class payment_order(report_sxw.rml_parse):
return value_name[0][1]
return False
-report_sxw.report_sxw('report.payment.order', 'payment.order', 'addons/account_payment/report/payment_order.rml', parser=payment_order, header="external")
+
+class report_paymentorder(osv.AbstractModel):
+ _name = 'report.account_payment.report_paymentorder'
+ _inherit = 'report.abstract_report'
+ _template = 'account_payment.report_paymentorder'
+ _wrapped_report_class = payment_order
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_payment/test/account_payment_report.yml b/addons/account_payment/test/account_payment_report.yml
index 3def62de429..922d2502203 100644
--- a/addons/account_payment/test/account_payment_report.yml
+++ b/addons/account_payment/test/account_payment_report.yml
@@ -5,6 +5,6 @@
import os
import openerp.report
from openerp import tools
- data, format = openerp.report.render_report(cr, uid, [ref('payment_order_1')], 'payment.order', {}, {})
+ data, format = openerp.report.render_report(cr, uid, [ref('payment_order_1')], 'account_payment.report_paymentorder', {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'account_payment-payment_order_report.'+format), 'wb+').write(data)
diff --git a/addons/account_payment/views/report_paymentorder.xml b/addons/account_payment/views/report_paymentorder.xml
new file mode 100644
index 00000000000..42a2cbe989a
--- /dev/null
+++ b/addons/account_payment/views/report_paymentorder.xml
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+<template id="report_paymentorder">
+ <t t-call="report.html_container">
+ <t t-foreach="docs" t-as="o">
+ <t t-call="report.external_layout">
+ <div class="page">
+ <div class="oe_structure"/>
+
+ <div class="row">
+ <div class="col-xs-4 col-xs-offset-8">
+ <span t-raw="'%s &lt;br&gt;' % o.mode.bank_id.bank.name if o.mode.bank_id.bank.name else ''"/>
+ <span t-raw="'%s &lt;br&gt;' % o.mode.bank_id.bank.street if o.mode.bank_id.bank.street else ''"/>
+ <span t-raw="'%s &lt;br&gt;' % o.mode.bank_id.bank.street2 if o.mode.bank_id.bank.street2 else ''"/>
+ <span t-raw="'%s &lt;br&gt;' % o.mode.bank_id.bank.zip if o.mode.bank_id.bank.zip else ''"/>
+ <span t-raw="'%s &lt;br&gt;' % o.mode.bank_id.bank.city if o.mode.bank_id.bank.city else ''"/>
+ <span t-raw="'%s &lt;br&gt;' % o.mode.bank_id.bank.state.name if o.mode.bank_id.bank.state.name else ''"/>
+ <span t-raw="'%s &lt;br&gt;' % o.mode.bank_id.bank.country.name if o.mode.bank_id.bank.country.name else ''"/>
+ </div>
+ </div>
+
+ <h2>Payment Order / Payment</h2>
+
+ <div class="row mt32 mb32">
+ <div t-if="o.mode.name" class="col-xs-2">
+ <strong>Payment Type:</strong>
+ <p t-field="o.mode.name"/>
+ </div>
+ <div t-if="o.reference" class="col-xs-2">
+ <strong>Reference</strong>
+ <p t-field="o.reference"/>
+ </div>
+ <div t-if="o.mode.bank_id.id" class="col-xs-2">
+ <strong>Used Account:</strong>
+ <p t-esc="get_account_name(o.mode.bank_id.id)"/>
+ </div>
+ <div t-if="o.date_prefered" class="col-xs-2">
+ <strong>Execution:</strong>
+ <p t-field="o.date_prefered"/>
+ </div>
+ <div t-if="o.user_id.company_id.currency_id.name" class="col-xs-2">
+ <strong>Company Currency:</strong>
+ <p t-field="o.user_id.company_id.currency_id.name"/>
+ </div>
+ </div>
+
+ <table class="table table-condensed">
+ <thead>
+ <tr>
+ <th>Partner</th>
+ <th class="text-center">Bank Account</th>
+ <th class="text-center">Invoice Ref</th>
+ <th class="text-center">Value Date</th>
+ <th class="text-right">Amount</th>
+ <th class="text-right">Currency</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr t-foreach="o.line_ids" t-as="line">
+ <td>
+ <span t-field="line.partner_id.name"/>
+ </td>
+ <td class="text-center">
+ <span t-esc="get_account_name(line.bank_id.id)"/>
+ </td>
+ <td class="text-center">
+ <span t-esc="get_invoice_name(line.ml_inv_ref.id)"/>
+ </td>
+ <td class="text-center">
+ <p t-if="line.date"><span t-esc="formatLang(line.date,date=True)"/></p>
+ </td>
+ <td class="text-right">
+ <span t-esc="formatLang(line.amount or 0.0, currency_obj=line.company_currency)"></span>
+ </td>
+ <td class="text-right">
+ <span t-esc="formatLang(line.amount_currency, currency_obj=line.currency)"></span>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+ <div class="row">
+ <div class="col-xs-4 pull-right">
+ <table class="table table-condensed">
+ <tr class="border-black">
+ <td><strong>Total</strong></td>
+ <td class="text-right">
+ <span t-esc="formatLang(get_amount_total(o), currency_obj=o.company_id.currency_id)"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Total (Currency)</td>
+ <td class="text-right">
+ <span t-esc="formatLang(get_amount_total_in_currency(o), currency_obj=(o.line_ids and o.line_ids[0].currency or None))"></span>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+
+ <div class="oe_structure"/>
+ </div>
+ </t>
+ </t>
+ </t>
+</template>
+</data>
+</openerp>
diff --git a/addons/account_test/__openerp__.py b/addons/account_test/__openerp__.py
index cfd4007fed0..51b47bace7a 100644
--- a/addons/account_test/__openerp__.py
+++ b/addons/account_test/__openerp__.py
@@ -19,11 +19,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
+
{
- 'name' : 'Accounting Consistency Tests',
- 'version' : '1.0',
- 'author' : 'OpenERP',
- 'category' : 'Accounting & Finance',
+ 'name': 'Accounting Consistency Tests',
+ 'version': '1.0',
+ 'author': 'OpenERP',
+ 'category': 'Accounting & Finance',
'website': 'http://www.openerp.com',
'description': """
Asserts on accounting.
@@ -34,14 +35,16 @@ You can write a query in order to create Consistency Test and you will get the r
in PDF format which can be accessed by Menu Reporting -> Accounting Tests, then select the test
and print the report from Print button in header area.
""",
- 'depends' : ['account'],
- 'data' : [
+ 'depends': ['account'],
+ 'data': [
'security/ir.model.access.csv',
'account_test_view.xml',
'account_test_report.xml',
'account_test_data.xml',
+ 'views/report_accounttest.xml',
],
'active': False,
'installable': True
}
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_test/account_test_report.xml b/addons/account_test/account_test_report.xml
index 480507b6072..732b9e9fbdb 100644
--- a/addons/account_test/account_test_report.xml
+++ b/addons/account_test/account_test_report.xml
@@ -1,14 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
-<data>
-
- <report
- id="account_assert_test_report"
- model="accounting.assert.test"
- name="account.test.assert.print"
- rml="account_test/report/account_test.rml"
- header="False"
- string="Accounting Tests"/>
-
-</data>
+ <data>
+ <report
+ id="account_assert_test_report"
+ model="accounting.assert.test"
+ string="Accounting Tests"
+ report_type="qweb-pdf"
+ name="account_test.report_accounttest"
+ file="account_test.report_accounttest"
+ />
+ </data>
</openerp>
diff --git a/addons/account_test/report/account_test.rml b/addons/account_test/report/account_test.rml
deleted file mode 100644
index 1efa12fd5cb..00000000000
--- a/addons/account_test/report/account_test.rml
+++ /dev/null
@@ -1,78 +0,0 @@
-<?xml version="1.0"?>
-<document filename="test.pdf">
- <template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
- <pageTemplate id="first">
- <frame id="first" x1="57.0" y1="57.0" width="481" height="728"/>
- </pageTemplate>
- </template>
- <stylesheet>
- <blockTableStyle id="Standard_Outline">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Tableau1">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
- </blockTableStyle>
- <blockTableStyle id="Table1">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="0,1" stop="1,1"/>
- <lineStyle kind="LINEBEFORE" colorName="#000000" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#000000" start="0,1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#000000" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#000000" start="1,1" stop="1,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#000000" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#000000" start="1,1" stop="1,-1"/>
- </blockTableStyle>
- <initialize>
- <paraStyle name="all" alignment="justify"/>
- </initialize>
- <paraStyle name="Standard" fontName="Times-Roman"/>
- <paraStyle name="Heading" fontName="Times-Roman" fontSize="16.0" leading="20" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P10" fontName="Times-Roman" fontSize="16.0" leading="20" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="List" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Caption" fontName="Times-Roman" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="Index" fontName="Times-Roman"/>
- <paraStyle name="Table Contents" fontName="Times-Roman"/>
- <images/>
- </stylesheet>
- <story>
- <para style="Heading">Accouting tests on [[ datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") ]]</para>
- <para style="Standard">
- <font color="white"> </font>
- </para>
- <section>
- <para style="Standard">[[repeatIn(objects,'o')]]</para>
- <blockTable colWidths="482.0" style="Table1">
- <tr>
- <td>
- <para style="Table Contents">[[ o.name ]]</para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="Table Contents"><i>[[ o.desc or '' ]]</i></para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="482.0" style="Tableau1">
- <tr>
- <td>
- <para style="Table Contents">[[ repeatIn(execute_code(o.code_exec), 'test_result') ]]</para>
- <para style="Table Contents">[[ test_result ]] </para>
- </td>
- </tr>
- </blockTable>
- <para style="Standard">
- <font color="white"> </font>
- </para>
- </section>
-
- </story>
-</document>
diff --git a/addons/account_test/report/account_test_report.py b/addons/account_test/report/account_test_report.py
index 0cfbc040d82..bb21e3807a8 100644
--- a/addons/account_test/report/account_test_report.py
+++ b/addons/account_test/report/account_test_report.py
@@ -23,8 +23,10 @@
import datetime
import time
-from openerp.report import report_sxw
+from openerp.osv import osv
from openerp.tools.translate import _
+from openerp.report import report_sxw
+
#
# Use period and Journal for selection or resources
@@ -84,6 +86,11 @@ class report_assert_account(report_sxw.rml_parse):
return result
-report_sxw.report_sxw('report.account.test.assert.print', 'accounting.assert.test', 'addons/account_test/report/account_test.rml', parser=report_assert_account, header=False)
+
+class report_accounttest(osv.AbstractModel):
+ _name = 'report.account_test.report_accounttest'
+ _inherit = 'report.abstract_report'
+ _template = 'account_test.report_accounttest'
+ _wrapped_report_class = report_assert_account
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_test/views/report_accounttest.xml b/addons/account_test/views/report_accounttest.xml
new file mode 100644
index 00000000000..02ce82218dc
--- /dev/null
+++ b/addons/account_test/views/report_accounttest.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+<template id="report_accounttest">
+ <t t-call="report.html_container">
+ <t t-call="report.internal_layout">
+ <div class="page">
+ <h2>Accouting tests on <span t-esc="datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')"/></h2>
+ <div t-foreach="docs" t-as="o">
+ <p>
+ <strong>Name:</strong> <span t-field="o.name"/><br/>
+ <strong>Description:</strong> <span t-field="o.desc"/>
+ </p>
+ <p t-foreach="execute_code(o.code_exec)" t-as="test_result">
+ <span t-esc="test_result"/>
+ </p>
+ </div>
+ </div>
+ </t>
+ </t>
+</template>
+</data>
+</openerp>
diff --git a/addons/account_voucher/__openerp__.py b/addons/account_voucher/__openerp__.py
index 0659e4f4bae..dc8102d6647 100644
--- a/addons/account_voucher/__openerp__.py
+++ b/addons/account_voucher/__openerp__.py
@@ -49,7 +49,6 @@ This module manages:
'security/ir.model.access.csv',
'account_voucher_sequence.xml',
'account_voucher_workflow.xml',
- 'account_voucher_report.xml',
'wizard/account_statement_from_invoice_view.xml',
'account_voucher_view.xml',
'voucher_payment_receipt_view.xml',
@@ -66,7 +65,6 @@ This module manages:
'test/account_voucher.yml',
'test/sales_receipt.yml',
'test/sales_payment.yml',
- 'test/account_voucher_report.yml',
'test/case1_usd_usd.yml',
'test/case1_usd_usd_payment_rate.yml',
'test/case2_usd_eur_debtor_in_eur.yml',
diff --git a/addons/account_voucher/account_voucher_report.xml b/addons/account_voucher/account_voucher_report.xml
deleted file mode 100644
index 239492d1a27..00000000000
--- a/addons/account_voucher/account_voucher_report.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0"?>
-<openerp>
- <data>
- <!-- <report id="report_account_voucher"
- string="Voucher"
- model="account.voucher"
- name="voucher.cash_receipt.drcr"
- rml="account_voucher/report/account_voucher.rml"
- auto="False"
- header = "False"
- menu="True"/> -->
-
-<!-- This report is awfull so it's better to hide it -->
-<!-- <report id="report_account_voucher_print"
- string="Voucher Print"
- model="account.voucher"
- name="voucher.print"
- rml="account_voucher/report/account_voucher_print.rml"
- auto="False"
- header = "False"
- menu="True"/>-->
- </data>
-</openerp>
diff --git a/addons/account_voucher/report/__init__.py b/addons/account_voucher/report/__init__.py
index 862843352a8..53ac7e915be 100644
--- a/addons/account_voucher/report/__init__.py
+++ b/addons/account_voucher/report/__init__.py
@@ -19,8 +19,6 @@
#
##############################################################################
-import account_voucher
-import account_voucher_print
import account_voucher_sales_receipt
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_voucher/report/account_voucher.py b/addons/account_voucher/report/account_voucher.py
deleted file mode 100644
index c23c7f4d384..00000000000
--- a/addons/account_voucher/report/account_voucher.py
+++ /dev/null
@@ -1,75 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-import time
-from openerp.report import report_sxw
-from openerp.tools import amount_to_text_en
-
-class report_voucher(report_sxw.rml_parse):
- def __init__(self, cr, uid, name, context):
- super(report_voucher, self).__init__(cr, uid, name, context)
- self.localcontext.update({
- 'time': time,
- 'convert':self.convert,
- 'get_title': self.get_title,
- 'debit':self.debit,
- 'credit':self.credit,
- 'get_ref': self._get_ref
- })
-
- def convert(self, amount, cur):
- amt_en = amount_to_text_en.amount_to_text(amount, 'en', cur)
- return amt_en
-
- def get_title(self, type):
- title = ''
- if type:
- title = type[0].swapcase() + type[1:] + " Voucher"
- return title
-
- def debit(self, move_ids):
- debit = 0.0
- for move in move_ids:
- debit += move.debit
- return debit
-
- def credit(self, move_ids):
- credit = 0.0
- for move in move_ids:
- credit += move.credit
- return credit
-
- def _get_ref(self, voucher_id, move_ids):
- voucher_line_obj = self.pool.get('account.voucher.line')
- voucher_line = voucher_line_obj.search(self.cr, self.uid, [('partner_id', '=', move_ids.partner_id.id), ('voucher_id', '=', voucher_id)])
- if voucher_line:
- voucher = voucher_line_obj.browse(self.cr, self.uid, voucher_line)[0]
- return voucher.name
- else:
- return
-report_sxw.report_sxw(
- 'report.voucher.cash_receipt.drcr',
- 'account.voucher',
- 'addons/account_voucher/report/account_voucher.rml',
- parser=report_voucher,header="external"
-)
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_voucher/report/account_voucher.rml b/addons/account_voucher/report/account_voucher.rml
deleted file mode 100644
index 6b3337aa64f..00000000000
--- a/addons/account_voucher/report/account_voucher.rml
+++ /dev/null
@@ -1,446 +0,0 @@
-<?xml version="1.0"?>
-<document filename="Voucher.pdf">
- <template title="Voucher" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
- <pageTemplate id="first">
- <frame id="first" x1="28.0" y1="42.0" width="525" height="772"/>
- </pageTemplate>
- </template>
- <stylesheet>
- <blockTableStyle id="Standard_Outline">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table4">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table7">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#b3b3b3" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="3,0" stop="3,0"/>
- <lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="3,-1" stop="3,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table8">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="3,0" stop="3,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="3,0" stop="3,0"/>
- <lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="4,0" stop="4,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="4,0" stop="4,0"/>
- <lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="5,0" stop="5,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#b3b3b3" start="5,0" stop="5,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="5,0" stop="5,0"/>
- <lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="5,-1" stop="5,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Heading1">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="2,-1" stop="2,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table2">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table6">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table1">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table3">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <initialize>
- <paraStyle name="all" alignment="justify"/>
- </initialize>
- <paraStyle name="P1" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P2" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P3" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P4" rightIndent="0.0" leftIndent="9.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P5" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="Standard" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT"/>
- <paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Text body" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="List" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Caption" fontName="Helvetica-Oblique" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="Index" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT"/>
- <paraStyle name="Table Contents" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Table Heading" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="Footer" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT"/>
- <paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" alignment="LEFT" spaceBefore="0.0" spaceAfter="14.0"/>
- <paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_1" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_9_Bold" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_8_Italic" rightIndent="0.0" leftIndent="9.0" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="Drawing" fontName="Helvetica-Oblique" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="Header" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT"/>
- <paraStyle name="Endnote" rightIndent="0.0" leftIndent="14.0" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT"/>
- <paraStyle name="Addressee" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="3.0"/>
- <paraStyle name="Signature" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT"/>
- <paraStyle name="Heading 8" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Heading 7" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Heading 6" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Heading 5" fontName="Helvetica-Bold" fontSize="85%" leading="NaN" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Heading 4" fontName="Helvetica-BoldOblique" fontSize="85%" leading="NaN" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Heading 1" fontName="Helvetica-Bold" fontSize="115%" leading="NaN" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Heading 10" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Heading 2" fontName="Helvetica-BoldOblique" fontSize="14.0" leading="17" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="First line indent" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Hanging indent" rightIndent="0.0" leftIndent="28.0" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Salutation" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT"/>
- <paraStyle name="Text body indent" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Heading 3" fontName="Helvetica-Bold" fontSize="14.0" leading="17" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="List Indent" rightIndent="0.0" leftIndent="142.0" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Marginalia" rightIndent="0.0" leftIndent="113.0" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_9_with_indent_10" rightIndent="0.0" leftIndent="9.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_9_50" rightIndent="0.0" leftIndent="9.0" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <images/>
- </stylesheet>
- <story>
- <para style="P5">[[ repeatIn(objects,'voucher') ]]</para>
- <blockTable colWidths="524.0" style="Table4">
- <tr>
- <td>
- <para style="terp_header_Centre">[[ get_title(voucher.type) ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="63.0,200.0,52.0,210.0" style="Table7">
- <tr>
- <td>
- <para style="terp_tblheader_General">Journal:</para>
- </td>
- <td>
- <para style="terp_default_9">[[ voucher.type ]]</para>
- </td>
- <td>
- <para style="terp_tblheader_General">Number:</para>
- </td>
- <td>
- <para style="terp_default_9">[[ voucher.number ]]</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="63.0,72.0,44.0,84.0,52.0,210.0" style="Table8">
- <tr>
- <td>
- <para style="terp_tblheader_General">Status:</para>
- </td>
- <td>
- <para style="P2">PRO-FORMA [[ ((voucher.state == 'proforma') or removeParentNode('para')) and '' ]]</para>
- <para style="P2">Draft[[ ((voucher.state == 'draft') or removeParentNode('para')) and '' ]]</para>
- <para style="P2">Canceled [[ ((voucher.state == 'cancel') or removeParentNode('para')) and '' ]]</para>
- <para style="P2">Posted [[ ((voucher.state == 'posted') or removeParentNode('para')) and '' ]]</para>
- </td>
- <td>
- <para style="terp_tblheader_General">Ref. :</para>
- </td>
- <td>
- <para style="terp_default_9">[[ voucher.reference or '' ]]</para>
- </td>
- <td>
- <para style="terp_tblheader_General">Date:</para>
- </td>
- <td>
- <para style="terp_default_9">[[ formatLang(voucher.date , date=True) or '' ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="277.0,124.0,124.0" style="Heading1">
- <tr>
- <td>
- <para style="terp_tblheader_Details">Particulars</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Debit</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Credit</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_1">
- <font color="white"> </font>
- </para>
- <section>
- <para style="terp_default_8">[[ repeatIn(voucher.move_ids,'move_ids') ]] </para>
- <blockTable colWidths="276.0,126.0,123.0" style="Table2">
- <tr>
- <td>
- <para style="P3">[[ (move_ids.partner_id and move_ids.partner_id.name) or 'Account']] </para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang(move_ids.debit) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang(move_ids.credit) ]]</para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="P4">[[ move_ids.account_id.name ]] </para>
- </td>
- <td>
- <para style="terp_default_Right_9">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_Right_9">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="terp_default_8_Italic">[[ move_ids.name ]] - [[ get_ref(voucher.id,move_ids) ]]</para>
- </td>
- <td>
- <para style="terp_default_9_50">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_9_50">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_1">
- <font color="white"> </font>
- </para>
- </section>
- <para style="terp_default_1">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="276.0,126.0,123.0" style="Table6">
- <tr>
- <td>
- <para style="terp_tblheader_Details">Through : </para>
- </td>
- <td>
- <para style="terp_tblheader_Details">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_tblheader_Details">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="terp_default_9">[[ voucher.narration or '']]</para>
- </td>
- <td>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="terp_tblheader_Details">On Account of : </para>
- </td>
- <td>
- <para style="terp_tblheader_Details">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_tblheader_Details">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="terp_default_9">[[ voucher.name ]]</para>
- </td>
- <td>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="terp_tblheader_Details">Amount (in words) : </para>
- </td>
- <td>
- <para style="terp_tblheader_Details">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_tblheader_Details">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="terp_default_9">[[ convert(voucher.amount,voucher.currency_id.name) ]]</para>
- </td>
- <td>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_1">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="276.0,127.0,122.0" style="Table1">
- <tr>
- <td>
- <para style="P1">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_Right_9_Bold">[[ debit(voucher.move_ids)]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9_Bold">[[ credit(voucher.move_ids) ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_1">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="157.0,119.0,126.0,123.0" style="Table3">
- <tr>
- <td>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="terp_default_9">Receiver's Signature</para>
- </td>
- <td>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_Right_9">Authorised Signatory</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- </story>
-</document>
diff --git a/addons/account_voucher/report/account_voucher_print.py b/addons/account_voucher/report/account_voucher_print.py
deleted file mode 100644
index 1bc411947f6..00000000000
--- a/addons/account_voucher/report/account_voucher_print.py
+++ /dev/null
@@ -1,96 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-import time
-from openerp.report import report_sxw
-from openerp.tools import amount_to_text_en
-
-class report_voucher_print(report_sxw.rml_parse):
- def __init__(self, cr, uid, name, context):
- super(report_voucher_print, self).__init__(cr, uid, name, context)
- self.localcontext.update({
- 'time': time,
- 'get_title': self.get_title,
- 'get_lines':self.get_lines,
- 'get_on_account':self.get_on_account,
- 'convert':self.convert
- })
-
- def convert(self, amount, cur):
- amt_en = amount_to_text_en.amount_to_text(amount, 'en', cur)
- return amt_en
-
- def get_lines(self, voucher):
- result = []
- if voucher.type in ('payment','receipt'):
- type = voucher.line_ids and voucher.line_ids[0].type or False
- for move in voucher.move_ids:
- res = {}
- amount = move.credit
- if type == 'dr':
- amount = move.debit
- if amount > 0.0:
- res['pname'] = move.partner_id.name
- res['ref'] = 'Agst Ref'+" "+str(move.name)
- res['aname'] = move.account_id.name
- res['amount'] = amount
- result.append(res)
- else:
- type = voucher.line_ids and voucher.line_ids[0].type or False
- for move in voucher.move_ids:
- res = {}
- amount = move.credit
- if type == 'dr':
- amount = move.debit
- if amount > 0.0:
- res['pname'] = move.partner_id.name
- res['ref'] = move.name
- res['aname'] = move.account_id.name
- res['amount'] = amount
- result.append(res)
- return result
-
- def get_title(self, type):
- title = ''
- if type:
- title = type[0].swapcase() + type[1:] + " Voucher"
- return title
-
- def get_on_account(self, voucher):
- name = ""
- if voucher.type == 'receipt':
- name = "Received cash from "+str(voucher.partner_id.name)
- elif voucher.type == 'payment':
- name = "Payment from "+str(voucher.partner_id.name)
- elif voucher.type == 'sale':
- name = "Sale to "+str(voucher.partner_id.name)
- elif voucher.type == 'purchase':
- name = "Purchase from "+str(voucher.partner_id.name)
- return name
-
-report_sxw.report_sxw(
- 'report.voucher.print',
- 'account.voucher',
- 'addons/account_voucher/report/account_voucher_print.rml',
- parser=report_voucher_print,header="external"
-)
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_voucher/report/account_voucher_print.rml b/addons/account_voucher/report/account_voucher_print.rml
deleted file mode 100644
index 9f0f2e1f07e..00000000000
--- a/addons/account_voucher/report/account_voucher_print.rml
+++ /dev/null
@@ -1,331 +0,0 @@
-<?xml version="1.0"?>
-<document filename="Voucher.pdf">
- <template title="Voucher" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
- <pageTemplate id="first">
- <frame id="first" x1="28.0" y1="42.0" width="525" height="772"/>
- </pageTemplate>
- </template>
- <stylesheet>
- <blockTableStyle id="Standard_Outline">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table6">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table2">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table4">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Heading1">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table7">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="last_info">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table3">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table5">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <initialize>
- <paraStyle name="all" alignment="justify"/>
- </initialize>
- <paraStyle name="P1" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT"/>
- <paraStyle name="P2" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P3" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P4" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="P5" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="Standard" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT"/>
- <paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Text body" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="List" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Caption" fontName="Helvetica-Oblique" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="Index" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT"/>
- <paraStyle name="Table Contents" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Table Heading" fontName="Helvetica" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="Footer" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT"/>
- <paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" alignment="LEFT" spaceBefore="0.0" spaceAfter="14.0"/>
- <paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_1" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_9_Bold" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_8_Italic" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="Drawing" fontName="Helvetica-Oblique" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="Header" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT"/>
- <paraStyle name="Endnote" rightIndent="0.0" leftIndent="14.0" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT"/>
- <paraStyle name="Addressee" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="3.0"/>
- <paraStyle name="Signature" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT"/>
- <paraStyle name="Heading 8" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Heading 7" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Heading 6" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Heading 5" fontName="Helvetica-Bold" fontSize="85%" leading="NaN" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Heading 4" fontName="Helvetica-BoldOblique" fontSize="85%" leading="NaN" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Heading 1" fontName="Helvetica-Bold" fontSize="115%" leading="NaN" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Heading 10" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="Heading 2" fontName="Helvetica-BoldOblique" fontSize="14.0" leading="17" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="First line indent" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Hanging indent" rightIndent="0.0" leftIndent="28.0" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Salutation" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT"/>
- <paraStyle name="Text body indent" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Heading 3" fontName="Helvetica-Bold" fontSize="14.0" leading="17" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="List Indent" rightIndent="0.0" leftIndent="142.0" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Marginalia" rightIndent="0.0" leftIndent="113.0" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_9_30" rightIndent="0.0" leftIndent="9.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_9_50" rightIndent="0.0" leftIndent="14.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_9_50_italic" rightIndent="0.0" leftIndent="9.0" fontName="Helvetica-Oblique" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_9_30cm" rightIndent="0.0" leftIndent="9.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <images/>
- </stylesheet>
- <story>
- <para style="P5">[[ repeatIn(objects,'voucher') ]]</para>
- <blockTable colWidths="524.0" style="Table6">
- <tr>
- <td>
- <para style="terp_header_Centre">[[ get_title(voucher.type) ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="52.0,123.0,50.0,198.0,42.0,59.0" style="Table2">
- <tr>
- <td>
- <para style="terp_tblheader_General">Number:</para>
- </td>
- <td>
- <para style="terp_default_9">[[ voucher.number ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_9">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_tblheader_General">Date:</para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang(voucher.date , date=True) or '' ]]</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="52.0,123.0,50.0,198.0,42.0,59.0" style="Table4">
- <tr>
- <td>
- <para style="terp_tblheader_Details">Status:</para>
- </td>
- <td>
- <para style="P4">PRO-FORMA [[ ((voucher.state == 'proforma') or removeParentNode('para')) and '' ]]</para>
- <para style="P4">Draft[[ ((voucher.state == 'draft') or removeParentNode('para')) and '' ]]</para>
- <para style="P4">Canceled [[ ((voucher.state == 'cancel') or removeParentNode('para')) and '' ]]</para>
- <para style="P4">Posted [[ ((voucher.state == 'posted') or removeParentNode('para')) and '' ]]</para>
- </td>
- <td>
- <para style="terp_default_Bold_9">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="P2">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_tblheader_General">Currency:</para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ voucher.currency_id.symbol ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="381.0,144.0" style="Heading1">
- <tr>
- <td>
- <para style="terp_tblheader_Details">Particulars</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Amount</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_1">
- <font color="white"> </font>
- </para>
- <section>
- <para style="terp_default_8">[[ repeatIn(get_lines(voucher),'p') ]] </para>
- <blockTable colWidths="380.0,144.0" style="Table7">
- <tr>
- <td>
- <para style="terp_default_Bold_9">Account :</para>
- </td>
- <td>
- <para style="terp_default_Right_9_Bold">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="terp_default_9_30cm">[[ p['pname'] ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang(p['amount'], currency_obj=voucher.currency_id) ]]</para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="terp_default_9_30cm">[[ p['ref'] ]] </para>
- </td>
- <td>
- <para style="terp_default_9_50">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="terp_default_9_30cm">Account : [[ p['aname'] ]] </para>
- </td>
- <td>
- <para style="terp_default_9_50">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_1">
- <font color="white"> </font>
- </para>
- </section>
- <para style="terp_default_1">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="380.0,144.0" style="last_info">
- <tr>
- <td>
- <para style="terp_default_Bold_9">Through : </para>
- </td>
- <td>
- <para style="terp_default_Bold_9">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="terp_default_9_30">[[ voucher.journal_id.name or '' ]] </para>
- </td>
- <td>
- <para style="terp_default_9_50_italic">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="terp_default_Bold_9">On Account of : </para>
- </td>
- <td>
- <para style="terp_default_Bold_9">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="terp_default_9_30">[[ get_on_account(voucher) ]]</para>
- </td>
- <td>
- <para style="terp_default_9_30">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="terp_default_Bold_9">Amount (in words) : </para>
- </td>
- <td>
- <para style="terp_default_Bold_9">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="terp_default_9_30">[[ convert(voucher.amount,voucher.currency_id.name) ]]</para>
- </td>
- <td>
- <para style="P3">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_1">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="380.0,144.0" style="Table3">
- <tr>
- <td>
- <para style="terp_default_Right_9_Bold">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_Right_9_Bold">[[ formatLang(voucher.amount, currency_obj=voucher.currency_id) ]]</para>
- </td>
- </tr>
- </blockTable>
- </story>
-</document>
diff --git a/addons/account_voucher/test/account_voucher_report.yml b/addons/account_voucher/test/account_voucher_report.yml
deleted file mode 100644
index 96e96e4bdfd..00000000000
--- a/addons/account_voucher/test/account_voucher_report.yml
+++ /dev/null
@@ -1,27 +0,0 @@
--
- Demo for Account Voucher
--
- !record {model: account.voucher, id: account_voucher_voucheraxelor0again, view: view_sale_receipt_form}:
- type: sale
- account_id: account.cash
- company_id: base.main_company
- journal_id: account.bank_journal
- name: Voucher Axelor
- narration: PC Assemble SC234
- amount: 1000.0
- line_ids:
- - account_id: account.cash
- amount: 1000.0
- name: Voucher Axelor
- period_id: account.period_6
-
--
- In order to test the PDF reports defined on a account_voucher, we will print account voucher Report
--
- !python {model: account.voucher}: |
- import os
- import openerp.report
- from openerp import tools
- data, format = openerp.report.render_report(cr, uid, [ref("account_voucher_voucheraxelor0again")], 'voucher.cash_receipt.drcr', {}, {})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'account_voucher-report.'+format), 'wb+').write(data)
diff --git a/addons/document/document.py b/addons/document/document.py
index eb51ad5ac57..9008f32cd20 100644
--- a/addons/document/document.py
+++ b/addons/document/document.py
@@ -2005,7 +2005,7 @@ class nodefd_content(StringIO, node_descriptor):
par = self._get_parent()
uid = par.context.uid
- cr = openerp.registry(par.context.dbname).db.cursor()
+ cr = openerp.registry(par.context.dbname).cursor()
try:
if self.mode in ('w', 'w+', 'r+'):
data = self.getvalue()
@@ -2058,7 +2058,7 @@ class nodefd_static(StringIO, node_descriptor):
par = self._get_parent()
# uid = par.context.uid
- cr = openerp.registry(par.context.dbname).db.cursor()
+ cr = openerp.registry(par.context.dbname).cursor()
try:
if self.mode in ('w', 'w+', 'r+'):
data = self.getvalue()
diff --git a/addons/edi/edi_service.py b/addons/edi/edi_service.py
index dd95196ef4f..0d3edd451d1 100644
--- a/addons/edi/edi_service.py
+++ b/addons/edi/edi_service.py
@@ -34,18 +34,14 @@ def _edi_dispatch(db_name, method_name, *method_args):
try:
registry = openerp.modules.registry.RegistryManager.get(db_name)
assert registry, 'Unknown database %s' % db_name
- edi = registry['edi.edi']
- cr = registry.db.cursor()
- res = None
- res = getattr(edi, method_name)(cr, *method_args)
- cr.commit()
+ with registry.cursor() as cr:
+ edi = registry['edi.edi']
+ return getattr(edi, method_name)(cr, *method_args)
+
except Exception, e:
_logger.exception('Failed to execute EDI method %s with args %r.',
method_name, method_args)
raise
- finally:
- cr.close()
- return res
def exp_import_edi_document(db_name, uid, passwd, edi_document, context=None):
return _edi_dispatch(db_name, 'import_edi', uid, edi_document, None)
diff --git a/addons/event/event.py b/addons/event/event.py
index 92b237687d7..7ee99402158 100644
--- a/addons/event/event.py
+++ b/addons/event/event.py
@@ -158,16 +158,16 @@ class event_event(osv.osv):
'seats_min': fields.integer('Minimum Reserved Seats', oldname='register_min', help="You can for each event define a minimum registration level. If you do not enough registrations you are not able to confirm your event. (put 0 to ignore this rule )", readonly=True, states={'draft': [('readonly', False)]}),
'seats_reserved': fields.function(_get_seats, oldname='register_current', string='Reserved Seats', type='integer', multi='seats_reserved',
store={'event.registration': (_get_events_from_registrations, ['state'], 10),
- 'event.event': (lambda self, cr, uid, ids, c = {}: ids, ['seats_max'], 20)}),
+ 'event.event': (lambda self, cr, uid, ids, c = {}: ids, ['seats_max', 'registration_ids'], 20)}),
'seats_available': fields.function(_get_seats, oldname='register_avail', string='Available Seats', type='integer', multi='seats_reserved',
store={'event.registration': (_get_events_from_registrations, ['state'], 10),
- 'event.event': (lambda self, cr, uid, ids, c = {}: ids, ['seats_max'], 20)}),
+ 'event.event': (lambda self, cr, uid, ids, c = {}: ids, ['seats_max', 'registration_ids'], 20)}),
'seats_unconfirmed': fields.function(_get_seats, oldname='register_prospect', string='Unconfirmed Seat Reservations', type='integer', multi='seats_reserved',
store={'event.registration': (_get_events_from_registrations, ['state'], 10),
- 'event.event': (lambda self, cr, uid, ids, c = {}: ids, ['seats_max'], 20)}),
+ 'event.event': (lambda self, cr, uid, ids, c = {}: ids, ['seats_max', 'registration_ids'], 20)}),
'seats_used': fields.function(_get_seats, oldname='register_attended', string='Number of Participations', type='integer', multi='seats_reserved',
store={'event.registration': (_get_events_from_registrations, ['state'], 10),
- 'event.event': (lambda self, cr, uid, ids, c = {}: ids, ['seats_max'], 20)}),
+ 'event.event': (lambda self, cr, uid, ids, c = {}: ids, ['seats_max', 'registration_ids'], 20)}),
'registration_ids': fields.one2many('event.registration', 'event_id', 'Registrations', readonly=False, states={'done': [('readonly', True)]}),
'date_begin': fields.datetime('Start Date', required=True, readonly=True, states={'draft': [('readonly', False)]}),
'date_end': fields.datetime('End Date', required=True, readonly=True, states={'draft': [('readonly', False)]}),
@@ -201,7 +201,6 @@ class event_event(osv.osv):
}
def _check_seats_limit(self, cr, uid, ids, context=None):
- print "event _check_seats_limit"
for event in self.browse(cr, uid, ids, context=context):
if event.seats_max and event.seats_available < 0:
return False
diff --git a/addons/gamification/models/goal.py b/addons/gamification/models/goal.py
index 8e79c43c8a6..925b05de5ab 100644
--- a/addons/gamification/models/goal.py
+++ b/addons/gamification/models/goal.py
@@ -279,7 +279,7 @@ class gamification_goal(osv.Model):
if goal.definition_id.computation_mode == 'sum':
field_name = goal.definition_id.field_id.name
- res = obj.read_group(cr, uid, domain, [field_name], [''], context=context)
+ res = obj.read_group(cr, uid, domain, [field_name], [field_name], context=context)
new_value = res and res[0][field_name] or 0.0
else: # computation mode = count
diff --git a/addons/l10n_lu/__init__.py b/addons/l10n_lu/__init__.py
index 0e933f136e0..9a6ca02408e 100644
--- a/addons/l10n_lu/__init__.py
+++ b/addons/l10n_lu/__init__.py
@@ -19,6 +19,4 @@
#
##############################################################################
-import wizard
-
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/l10n_lu/__openerp__.py b/addons/l10n_lu/__openerp__.py
index 46d2312bb02..96c4ea64dea 100644
--- a/addons/l10n_lu/__openerp__.py
+++ b/addons/l10n_lu/__openerp__.py
@@ -22,7 +22,6 @@
#
##############################################################################
-
{
'name': 'Luxembourg - Accounting',
'version': '1.0',
@@ -51,12 +50,12 @@ This is the base module to manage the accounting chart for Luxembourg.
'account.fiscal.position.tax.template-2011.csv',
# configuration wizard, views, reports...
'l10n_lu_wizard.xml',
- 'wizard/print_vat_view.xml'
],
- 'test': ['test/l10n_lu_report.yml'],
+ 'test': [],
'demo': [],
'installable': True,
'auto_install': False,
'images': ['images/config_chart_l10n_lu.jpeg','images/l10n_lu_chart.jpeg'],
}
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/l10n_lu/test/l10n_lu_report.yml b/addons/l10n_lu/test/l10n_lu_report.yml
deleted file mode 100644
index 0ee032d581c..00000000000
--- a/addons/l10n_lu/test/l10n_lu_report.yml
+++ /dev/null
@@ -1,18 +0,0 @@
--
- It is demo data for the account.tax.code
--
- !record {model: account.tax.code, id: account_tax_code_id_r1}:
- name: a
-
--
- In order to test the PDF reports defined on a l10u_lu, we will print a VAT Report
--
- !python {model: res.partner}: |
- import os
- import openerp.report
- from openerp import tools
- data, format = openerp.report.render_report(cr, uid, [], 'l10n_lu.tax.report.print', {'model':'ir.ui.menu', 'form':{'tax_code_id': ref('account_tax_code_id_r1'), 'period_id': ref('account.period_1')}}, {})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'l10n_lu-vat_report.'+format), 'wb+').write(data)
-
-
diff --git a/addons/l10n_lu/wizard/TVA_MEN_09_xxxx.pdf b/addons/l10n_lu/wizard/TVA_MEN_09_xxxx.pdf
deleted file mode 100644
index 9df4ae34065..00000000000
--- a/addons/l10n_lu/wizard/TVA_MEN_09_xxxx.pdf
+++ /dev/null
Binary files differ
diff --git a/addons/l10n_lu/wizard/TVA_TRI_10_xxxx.pdf b/addons/l10n_lu/wizard/TVA_TRI_10_xxxx.pdf
deleted file mode 100644
index 0699bbcb7d9..00000000000
--- a/addons/l10n_lu/wizard/TVA_TRI_10_xxxx.pdf
+++ /dev/null
Binary files differ
diff --git a/addons/l10n_lu/wizard/__init__.py b/addons/l10n_lu/wizard/__init__.py
deleted file mode 100644
index 140f04905ab..00000000000
--- a/addons/l10n_lu/wizard/__init__.py
+++ /dev/null
@@ -1,24 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-import print_vat
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/l10n_lu/wizard/pdf_ext.py b/addons/l10n_lu/wizard/pdf_ext.py
deleted file mode 100644
index 94f150e41d7..00000000000
--- a/addons/l10n_lu/wizard/pdf_ext.py
+++ /dev/null
@@ -1,110 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-""" Copyright (c) 2003-2007 LOGILAB S.A. (Paris, FRANCE).
- http://www.logilab.fr/ -- mailto:contact@logilab.fr
-
-manipulate pdf and fdf files. pdftk recommended.
-
-Notes regarding pdftk, pdf forms and fdf files (form definition file)
-fields names can be extracted with:
- pdftk orig.pdf generate_fdf output truc.fdf
-to merge fdf and pdf:
- pdftk orig.pdf fill_form test.fdf output result.pdf [flatten]
-without flatten, one could further edit the resulting form.
-with flatten, everything is turned into text.
-"""
-
-import os
-from openerp import tools
-
-HEAD="""%FDF-1.2
-%\xE2\xE3\xCF\xD3
-1 0 obj
-<<
-/FDF
-<<
-/Fields [
-"""
-
-TAIL="""]
->>
->>
-endobj
-trailer
-
-<<
-/Root 1 0 R
->>
-%%EOF
-"""
-
-def output_field(f):
- return "\xfe\xff" + "".join( [ "\x00"+c for c in f ] )
-
-def extract_keys(lines):
- keys = []
- for line in lines:
- if line.startswith('/V'):
- pass
- elif line.startswith('/T'):
- key = line[7:-2]
- key = ''.join(key.split('\x00'))
- keys.append( key )
- return keys
-
-def write_field(out, key, value):
- out.write("<<\n")
- if value:
- out.write("/V (%s)\n" %value)
- else:
- out.write("/V /\n")
- out.write("/T (%s)\n" % output_field(key) )
- out.write(">> \n")
-
-def write_fields(out, fields):
- out.write(HEAD)
- for key in fields:
- value = fields[key]
- write_field(out, key, value)
- out.write(TAIL)
-
-def extract_keys_from_pdf(filename):
- # what about using 'pdftk filename dump_data_fields' and parsing the output ?
- os.system('pdftk %s generate_fdf output /tmp/toto.fdf' % filename)
- lines = file('/tmp/toto.fdf').readlines()
- return extract_keys(lines)
-
-
-def fill_pdf(infile, outfile, fields):
- write_fields(file('/tmp/toto.fdf', 'w'), fields)
- os.system('pdftk %s fill_form /tmp/toto.fdf output %s flatten' % (infile, outfile))
-
-def testfill_pdf(infile, outfile):
- keys = extract_keys_from_pdf(infile)
- fields = []
- for key in keys:
- fields.append( (key, key, '') )
- fill_pdf(infile, outfile, fields)
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/l10n_lu/wizard/print_vat.py b/addons/l10n_lu/wizard/print_vat.py
deleted file mode 100644
index 04d4fe9a3b7..00000000000
--- a/addons/l10n_lu/wizard/print_vat.py
+++ /dev/null
@@ -1,96 +0,0 @@
-# -*- coding: utf-8 -*-
-#Copyright (c) Vincent Cardon <vincent.cardon@tranquil-it-systems.fr>
-# Denis Cardon <denis.cardon@tranquilitsystems.com> and Emmanuel RICHARD.
-#Ingenieur fondateur
-#Tranquil IT Systems
-
-from __future__ import with_statement
-
-import openerp
-from openerp.osv import fields, osv
-from openerp import tools
-from openerp.modules.module import get_module_resource
-from openerp.tools.translate import _
-from openerp.report.render import render
-from openerp.report.interface import report_int
-import tempfile
-import os
-
-class external_pdf(render):
-
- def __init__(self, pdf):
- render.__init__(self)
- self.pdf = pdf
- self.output_type='pdf'
-
- def _render(self):
- return self.pdf
-
-
-class report_custom(report_int):
-
- def create(self, cr, uid, ids, datas, context=None):
-
- registry = openerp.registry(cr.dbname)
- taxobj = registry['account.tax.code']
-
- if context is None:
- context = {}
- code_ids = taxobj.search(cr, uid, [('parent_id','child_of',[datas['form']['tax_code_id']])])
- result = {}
- for t in taxobj.browse(cr, uid, code_ids, {'period_id': datas['form']['period_id']}):
- if str(t.code):
- result['case_'+str(t.code)] = '%.2f' % (t.sum_period or 0.0, )
- user = registry['res.users'].browse(cr, uid, uid, context)
-
- # Not Clean, to be changed
- partner = user.company_id.partner_id
- result['info_name'] = user.company_id.name
- result['info_vatnum'] = partner.vat
- if partner:
- result['info_address'] = partner.street
- result['info_address2'] = (partner.zip or '') + ' ' + (partner.city or '')
- try:
- tmp_file = tempfile.mkstemp(".pdf")[1]
- try:
- tools.pdf_utils.fill_pdf(get_module_resource('l10n_lu','wizard', '2008_DECL_F_M10.pdf'), tmp_file, result)
- with open(tmp_file, "r") as ofile:
- self.obj = external_pdf(ofile.read())
- finally:
- try:
- os.remove(tmp_file)
- except:
- pass # nothing to do
- self.obj.render()
- return (self.obj.pdf, 'pdf')
- except Exception:
- raise osv.except_osv(_('PDF Not Created!'), _('Please check if package pdftk is installed!'))
-
-report_custom('report.l10n_lu.tax.report.print')
-
-class vat_declaration_report(osv.osv_memory):
- _name = 'vat.declaration.report'
- _description = 'VAT Declaration Report'
-
- _columns = {
- 'tax_code_id': fields.many2one('account.tax.code', 'Company', readonly=False, required=True, domain=[('parent_id','=',False)]),
- 'type': fields.selection([('monthly','Monthly'),('quarterly','Quaterly'),('yearly','Yearly')], 'Type', required=True),
- 'period_id' : fields.many2one('account.period', 'From Period', required=True),
- 'to_period_id': fields.many2one('account.period', 'To Period', required=True),
- }
-
- _defaults = {
- 'type': 'monthly',
- }
-
- def print_vat_declaration_report(self, cr, uid, ids, context=None):
- active_ids = context.get('active_ids',[])
- data = {}
- data['form'] = {}
- data['ids'] = active_ids
- data['form']['tax_code_id'] = self.browse(cr, uid, ids)[0].tax_code_id.id
- data['form']['period_id'] = self.browse(cr, uid, ids)[0].period_id.id
- return { 'type': 'ir.actions.report.xml', 'report_name': 'l10n_lu.tax.report.print', 'datas': data}
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/l10n_lu/wizard/print_vat_view.xml b/addons/l10n_lu/wizard/print_vat_view.xml
deleted file mode 100644
index 61a29378163..00000000000
--- a/addons/l10n_lu/wizard/print_vat_view.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<openerp>
- <data>
- <record id="vat_report_view" model="ir.ui.view">
- <field name="name">VAT Declaration Report</field>
- <field name="model">vat.declaration.report</field>
- <field name="arch" type="xml">
- <form string="Print Tax Statements" version="7.0">
- <group col="4">
- <field name="tax_code_id" widget="selection"/>
- <field name="type"/>
- <field name="period_id" widget="selection"/>
- <field name="to_period_id" widget="selection"/>
- </group>
- <footer>
- <button name="print_vat_declaration_report" string="Print Tax Statements" type="object" class="oe_highlight" />
- or
- <button string="Cancel" class="oe_link" special="cancel" />
- </footer>
- </form>
- </field>
- </record>
-
- <record id="action_vat_report" model="ir.actions.act_window">
- <field name="name">VAT Declaration Report</field>
- <field name="type">ir.actions.act_window</field>
- <field name="res_model">vat.declaration.report</field>
- <field name="view_type">form</field>
- <field name="view_mode">form</field>
- <field name="view_id" ref="vat_report_view"/>
- <field name="target">new</field>
- </record>
-
- <menuitem id="legal_lu" parent="account.menu_finance_legal_statement" name="Luxembourg"/>
- <menuitem name="VAT Declaration" id="legal_lu_vat" parent="legal_lu" action="action_vat_report"/>
-
- </data>
-
-</openerp>
diff --git a/addons/lunch/__openerp__.py b/addons/lunch/__openerp__.py
index f8a4a1ddcf2..955a1278c03 100644
--- a/addons/lunch/__openerp__.py
+++ b/addons/lunch/__openerp__.py
@@ -23,7 +23,7 @@
'name': 'Lunch Orders',
'author': 'OpenERP SA',
'version': '0.2',
- 'depends': ['base'],
+ 'depends': ['base', 'report'],
'category' : 'Tools',
'summary': 'Lunch Order, Meal, Food',
'description': """
diff --git a/addons/lunch/report/order.py b/addons/lunch/report/order.py
index 0bb99f01017..85b216ac632 100644
--- a/addons/lunch/report/order.py
+++ b/addons/lunch/report/order.py
@@ -20,11 +20,11 @@
##############################################################################
import time
-from openerp.addons.web import http
-from openerp.addons.web.http import request
+from openerp.report import report_sxw
+from openerp.osv import osv
-class order(http.Controller):
+class order(report_sxw.rml_parse):
def get_lines(self, user,objects):
lines=[]
@@ -60,24 +60,23 @@ class order(http.Controller):
notes.append(obj.note)
return notes
- @http.route(['/report/lunch.report_lunchorder/<docids>'], type='http', auth='user', website=True, multilang=True)
- def report_lunch(self, docids):
- self.cr, self.uid, self.context = request.cr, request.uid, request.context
-
- ids = [int(i) for i in docids.split(',')]
- report_obj = request.registry['lunch.order.line']
- docs = report_obj.browse(self.cr, self.uid, ids, context=self.context)
-
+ def __init__(self, cr, uid, name, context):
+ super(order, self).__init__(cr, uid, name, context)
self.net_total=0.0
- docargs = {
- 'docs': docs,
+ self.localcontext.update({
'time': time,
'get_lines': self.get_lines,
'get_users': self.get_users,
'get_total': self.get_total,
'get_nettotal': self.get_nettotal,
'get_note': self.get_note,
- }
- return request.registry['report'].render(self.cr, self.uid, [], 'lunch.report_lunchorder', docargs)
+ })
+
+
+class report_lunchorder(osv.AbstractModel):
+ _name = 'report.lunch.report_lunchorder'
+ _inherit = 'report.abstract_report'
+ _template = 'lunch.report_lunchorder'
+ _wrapped_report_class = order
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/lunch/security/lunch_security.xml b/addons/lunch/security/lunch_security.xml
index e01fab71ea2..5f2a351472c 100644
--- a/addons/lunch/security/lunch_security.xml
+++ b/addons/lunch/security/lunch_security.xml
@@ -16,5 +16,43 @@
<field name="category_id" ref="module_lunch_category"/>
<field name="users" eval="[(4, ref('base.user_root'))]"/>
</record>
+
+ <record id="lunch_mind_your_own_food" model="ir.rule">
+ <field name="name">lunch.order: do not see and create other people's order</field>
+ <field name="model_id" ref="model_lunch_order"/>
+ <field name="groups" eval="[(4, ref('group_lunch_user'))]"/>
+ <field name="domain_force">[('user_id', '=', user.id)]</field>
+ </record>
+ <record id="lunch_mind_other_food" model="ir.rule">
+ <field name="name">lunch.order: do not see and create other people's order</field>
+ <field name="model_id" ref="model_lunch_order"/>
+ <field name="groups" eval="[(4, ref('group_lunch_manager'))]"/>
+ <field name="domain_force">[(1, '=', 1)]</field>
+ </record>
+ <record id="lunch_mind_your_own_food_line" model="ir.rule">
+ <field name="name">lunch.order.line: do not see and create other people's order line</field>
+ <field name="model_id" ref="model_lunch_order_line"/>
+ <field name="groups" eval="[(4, ref('group_lunch_user'))]"/>
+ <field name="domain_force">[('user_id', '=', user.id)]</field>
+ </record>
+ <record id="lunch_mind_other_food_line" model="ir.rule">
+ <field name="name">lunch.order.line: do not see and create other people's order line</field>
+ <field name="model_id" ref="model_lunch_order_line"/>
+ <field name="groups" eval="[(4, ref('group_lunch_manager'))]"/>
+ <field name="domain_force">[(1, '=', 1)]</field>
+ </record>
+ <record id="lunch_mind_your_own_food_money" model="ir.rule">
+ <field name="name">lunch.cashmove: do not see and create other people's cashmove</field>
+ <field name="model_id" ref="model_lunch_cashmove"/>
+ <field name="groups" eval="[(4, ref('group_lunch_user'))]"/>
+ <field name="domain_force">[('user_id', '=', user.id)]</field>
+ </record>
+ <record id="lunch_mind_other_food_money" model="ir.rule">
+ <field name="name">lunch.cashmove: do not see and create other people's cashmove</field>
+ <field name="model_id" ref="model_lunch_cashmove"/>
+ <field name="groups" eval="[(4, ref('group_lunch_manager'))]"/>
+ <field name="domain_force">[(1, '=', 1)]</field>
+ </record>
+
</data>
</openerp>
diff --git a/addons/mail/data/mail_data.xml b/addons/mail/data/mail_data.xml
index 4a2dc6d06f0..cdd7eb12c69 100644
--- a/addons/mail/data/mail_data.xml
+++ b/addons/mail/data/mail_data.xml
@@ -40,6 +40,17 @@
<field name="args">()</field>
</record>
+ <!-- After installation of the module, open the related menu -->
+ <record id="action_client_messaging_menu" model="ir.actions.client">
+ <field name="name">Open Messaging Menu</field>
+ <field name="tag">reload</field>
+ <field name="params" eval="{'menu_id': ref('mail.mail_feeds_main')}"/>
+ </record>
+ <record id="base.open_menu" model="ir.actions.todo">
+ <field name="action_id" ref="action_client_messaging_menu"/>
+ <field name="state">open</field>
+ </record>
+
<!-- Admin should not receivve emails at creation -->
<record id="base.partner_root" model="res.partner">
<field name="notification_email_send">none</field>
diff --git a/addons/mail/static/src/css/mail.css b/addons/mail/static/src/css/mail.css
index 5a51bce04d9..aef0131346a 100644
--- a/addons/mail/static/src/css/mail.css
+++ b/addons/mail/static/src/css/mail.css
@@ -579,7 +579,7 @@
.openerp .oe_followers button.oe_follower{
display: block;
text-align: center;
- width:100%;
+ width:135px;
}
.openerp .oe_followers button.oe_follower.oe_following{
color: white;
diff --git a/addons/mail/static/src/js/mail_followers.js b/addons/mail/static/src/js/mail_followers.js
index e7c8ede6867..04f01efb8af 100644
--- a/addons/mail/static/src/js/mail_followers.js
+++ b/addons/mail/static/src/js/mail_followers.js
@@ -70,7 +70,17 @@ openerp_mail_followers = function(session, mail) {
self.do_unfollow();
});
// event: click on a subtype, that (un)subscribe for this subtype
- this.$el.on('click', '.oe_subtype_list input', self.do_update_subscription);
+ this.$el.on('click', '.oe_subtype_list input', function(event) {
+ self.do_update_subscription(event);
+ var $list = self.$('.oe_subtype_list');
+ if(!$list.hasClass('open')) {
+ $list.addClass('open');
+ }
+ if(self.$('.oe_subtype_list ul')[0].children.length < 1) {
+ $list.removeClass('open');
+ }
+ event.stopPropagation();
+ });
// event: click on 'invite' button, that opens the invite wizard
this.$('.oe_invite').on('click', self.on_invite_follower);
// event: click on 'edit_subtype(pencil)' button to edit subscription
@@ -244,8 +254,14 @@ openerp_mail_followers = function(session, mail) {
if (user_pid) {
dialog = true;
} else {
- var subtype_list_ul = this.$('.oe_subtype_list').empty();
- if (! this.message_is_follower) return;
+ var subtype_list_ul = this.$('.oe_subtype_list ul').empty();
+ if (! this.message_is_follower) {
+ this.$('.oe_subtype_list > .dropdown-toggle').attr('disabled', true);
+ return;
+ }
+ else {
+ this.$('.oe_subtype_list > .dropdown-toggle').attr('disabled', false);
+ }
}
var id = this.view.datarecord.id;
this.ds_model.call('message_get_subscription_data', [[id], user_pid, new session.web.CompoundContext(this.build_context(), {})])
@@ -259,9 +275,8 @@ openerp_mail_followers = function(session, mail) {
var $list = self.$dialog;
}
else {
- var $list = this.$('.oe_subtype_list');
+ var $list = this.$('.oe_subtype_list ul');
}
- $list.empty().hide();
var records = data[id].message_subtype_data;
this.records_length = $.map(records, function(value, index) { return index; }).length;
if (this.records_length > 1) { self.display_followers(); }
@@ -276,15 +291,13 @@ openerp_mail_followers = function(session, mail) {
}
record.name = record_name;
record.followed = record.followed || undefined;
- $(session.web.qweb.render('mail.followers.subtype', {'record': record})).appendTo($list);
+ $(session.web.qweb.render('mail.followers.subtype', {'record': record, 'dialog': dialog})).appendTo($list);
});
- if (_.size(records) > 1) {
- $list.show();
- }
},
do_follow: function () {
var context = new session.web.CompoundContext(this.build_context(), {});
+ this.$('.oe_subtype_list > .dropdown-toggle').attr('disabled', false);
this.ds_model.call('message_subscribe_users', [[this.view.datarecord.id], [this.session.uid], undefined, context])
.then(this.proxy('read_value'));
@@ -294,11 +307,13 @@ openerp_mail_followers = function(session, mail) {
},
do_unfollow: function (user_pid) {
+ var self = this;
if (confirm(_t("Warning! \nYou won't be notified of any email or discussion on this document. Do you really want to unfollow this document ?"))) {
_(this.$('.oe_msg_subtype_check')).each(function (record) {
$(record).attr('checked',false);
});
var action_unsubscribe = 'message_unsubscribe_users';
+ this.$('.oe_subtype_list > .dropdown-toggle').attr('disabled', true);
var follower_ids = [this.session.uid];
if (user_pid) {
action_unsubscribe = 'message_unsubscribe';
@@ -332,6 +347,8 @@ openerp_mail_followers = function(session, mail) {
if (!checklist.length) {
if (!this.do_unfollow(user_pid)) {
$(event.target).attr("checked", "checked");
+ } else {
+ self.$('.oe_subtype_list ul').empty();
}
} else {
var context = new session.web.CompoundContext(this.build_context(), {});
diff --git a/addons/mail/static/src/xml/mail_followers.xml b/addons/mail/static/src/xml/mail_followers.xml
index 6e8682cb533..35a5ad320bb 100644
--- a/addons/mail/static/src/xml/mail_followers.xml
+++ b/addons/mail/static/src/xml/mail_followers.xml
@@ -5,17 +5,23 @@
followers main template
Template used to display the followers, the actions and the subtypes in a record.
-->
- <div t-name="mail.followers" class="oe_followers">
+ <div t-name="mail.followers" class="oe_followers">
<div class="oe_actions">
- <button type="button" class="oe_follower oe_notfollow">
- <span class="oe_follow">Follow</span>
- <span class="oe_unfollow">Unfollow</span>
- <span class="oe_following">Following</span>
- </button>
+ <div t-attf-class="btn-group oe_subtype_list">
+ <button class="btn oe_follower oe_notfollow">
+ <span class="oe_follow">Follow</span>
+ <span class="oe_unfollow">Unfollow</span>
+ <span class="oe_following">Following</span>
+ </button>
+ <button type="button" t-attf-class="btn btn-default dropdown-toggle" data-toggle="dropdown">
+ <span class="caret"></span>
+ </button>
+ <ul class="dropdown-menu" role="menu"></ul>
+ </div>
+
<t t-if="widget.comment">
<h5 class="oe_comment"><t t-raw="widget.comment"/></h5>
</t>
- <div class="oe_subtype_list"></div>
</div>
<div class='oe_follower_title_box'>
<h4 class='oe_follower_title'>Followers</h4>
@@ -42,8 +48,12 @@
<t t-name="mail.followers.subtype">
<table class='oe_subtype'>
<tr>
- <td width="10%"><input type="checkbox" t-att-checked="record.followed" t-att-id="'input_mail_followers_subtype_'+record.id" t-att-data-id="record.id" t-att-name="record.name" class="oe_msg_subtype_check"/></td>
- <td><label t-att-for="'input_mail_followers_subtype_'+record.id"><t t-esc="record.name"/></label></td>
+ <td width="10%">
+ <input type="checkbox" t-att-checked="record.followed" t-att-id="'input_mail_followers_subtype_'+record.id+(dialog ? '_in_dialog': '')" t-att-data-id="record.id" t-att-name="record.name" class="oe_msg_subtype_check"/>
+ </td>
+ <td>
+ <label t-att-for="'input_mail_followers_subtype_'+record.id+(dialog ? '_in_dialog': '')"><t t-raw="record.name"/></label>
+ </td>
</tr>
</table>
</t>
diff --git a/addons/mrp/__openerp__.py b/addons/mrp/__openerp__.py
index cc661f2bf7f..859e676c68f 100644
--- a/addons/mrp/__openerp__.py
+++ b/addons/mrp/__openerp__.py
@@ -29,7 +29,7 @@
'sequence': 18,
'summary': 'Manufacturing Orders, Bill of Materials, Routing',
'images': ['images/bill_of_materials.jpeg', 'images/manufacturing_order.jpeg', 'images/planning_manufacturing_order.jpeg', 'images/manufacturing_analysis.jpeg', 'images/production_dashboard.jpeg','images/routings.jpeg','images/work_centers.jpeg'],
- 'depends': ['product','procurement', 'stock', 'resource', 'purchase','process'],
+ 'depends': ['product','procurement', 'stock', 'resource', 'purchase','process', 'report'],
'description': """
Manage the Manufacturing process in OpenERP
===========================================
diff --git a/addons/mrp/report/bom_structure.py b/addons/mrp/report/bom_structure.py
index 98949ed75dc..1b286feac46 100644
--- a/addons/mrp/report/bom_structure.py
+++ b/addons/mrp/report/bom_structure.py
@@ -19,22 +19,18 @@
#
##############################################################################
+import time
from openerp.osv import osv
+from openerp.report import report_sxw
-class bom_structure(osv.AbstractModel):
- _name = 'report.mrp.report_mrpbomstructure'
-
- def render_html(self, cr, uid, ids, data=None, context=None):
- mrpbom_obj = self.pool['mrp.bom']
- report_obj = self.pool['report']
- docs = mrpbom_obj.browse(cr, uid, ids, context=context)
-
- docargs = {
- 'docs': docs,
- 'get_children': self.get_children,
- }
- return report_obj.render(cr, uid, [], 'mrp.report_mrpbomstructure', docargs, context=context)
+class bom_structure(report_sxw.rml_parse):
+ def __init__(self, cr, uid, name, context):
+ super(bom_structure, self).__init__(cr, uid, name, context=context)
+ self.localcontext.update({
+ 'time': time,
+ 'get_children':self.get_children,
+ })
def get_children(self, object, level=0):
result = []
@@ -62,4 +58,11 @@ class bom_structure(osv.AbstractModel):
return children
+
+class report_lunchorder(osv.AbstractModel):
+ _name = 'report.mrp.report_mrpbomstructure'
+ _inherit = 'report.abstract_report'
+ _template = 'mpr.report_mrpbomstructure'
+ _wrapped_report_class = bom_structure
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/procurement/schedulers.py b/addons/procurement/schedulers.py
index d82fa94c132..b86a799e19c 100644
--- a/addons/procurement/schedulers.py
+++ b/addons/procurement/schedulers.py
@@ -59,7 +59,7 @@ class procurement_order(osv.osv):
context = {}
try:
if use_new_cursor:
- cr = openerp.registry(use_new_cursor).db.cursor()
+ cr = openerp.registry(use_new_cursor).cursor()
procurement_obj = self.pool.get('procurement.order')
if not skip_exception:
@@ -199,7 +199,7 @@ class procurement_order(osv.osv):
if context is None:
context = {}
if use_new_cursor:
- cr = openerp.registry(use_new_cursor).db.cursor()
+ cr = openerp.registry(use_new_cursor).cursor()
orderpoint_obj = self.pool.get('stock.warehouse.orderpoint')
procurement_obj = self.pool.get('procurement.order')
diff --git a/addons/procurement/wizard/orderpoint_procurement.py b/addons/procurement/wizard/orderpoint_procurement.py
index afc8e2a721f..c8d41c5c655 100644
--- a/addons/procurement/wizard/orderpoint_procurement.py
+++ b/addons/procurement/wizard/orderpoint_procurement.py
@@ -49,7 +49,7 @@ class procurement_compute(osv.osv_memory):
"""
proc_obj = self.pool.get('procurement.order')
#As this function is in a new thread, I need to open a new cursor, because the old one may be closed
- new_cr = self.pool.db.cursor()
+ new_cr = self.pool.cursor()
for proc in self.browse(new_cr, uid, ids, context=context):
proc_obj._procure_orderpoint_confirm(new_cr, uid, automatic=proc.automatic, use_new_cursor=new_cr.dbname, context=context)
#close the new cursor
diff --git a/addons/procurement/wizard/schedulers_all.py b/addons/procurement/wizard/schedulers_all.py
index aab9657ae5d..c0f1cfcc2df 100644
--- a/addons/procurement/wizard/schedulers_all.py
+++ b/addons/procurement/wizard/schedulers_all.py
@@ -45,7 +45,7 @@ class procurement_compute_all(osv.osv_memory):
"""
proc_obj = self.pool.get('procurement.order')
#As this function is in a new thread, i need to open a new cursor, because the old one may be closed
- new_cr = self.pool.db.cursor()
+ new_cr = self.pool.cursor()
for proc in self.browse(new_cr, uid, ids, context=context):
proc_obj.run_scheduler(new_cr, uid, automatic=proc.automatic, use_new_cursor=new_cr.dbname,\
context=context)
diff --git a/addons/purchase/__openerp__.py b/addons/purchase/__openerp__.py
index 0d0a372a3d0..009cbf00b78 100644
--- a/addons/purchase/__openerp__.py
+++ b/addons/purchase/__openerp__.py
@@ -46,7 +46,7 @@ Dashboard / Reports for Purchase Management will include:
'author': 'OpenERP SA',
'website': 'http://www.openerp.com',
'images' : ['images/purchase_order.jpeg', 'images/purchase_analysis.jpeg', 'images/request_for_quotation.jpeg'],
- 'depends': ['stock', 'process', 'procurement'],
+ 'depends': ['stock', 'process', 'procurement', 'report'],
'data': [
'security/purchase_security.xml',
'security/ir.model.access.csv',
diff --git a/addons/report/controllers/main.py b/addons/report/controllers/main.py
index 5cff7b4aae2..d3a683cccdc 100644
--- a/addons/report/controllers/main.py
+++ b/addons/report/controllers/main.py
@@ -22,48 +22,43 @@
from openerp.addons.web.http import Controller, route, request
import simplejson
-import urlparse
-from werkzeug import exceptions
+from werkzeug import exceptions, url_decode
+from werkzeug.test import Client
+from werkzeug.wrappers import BaseResponse
+from werkzeug.datastructures import Headers
from reportlab.graphics.barcode import createBarcodeDrawing
class ReportController(Controller):
#------------------------------------------------------
- # Generic reports controller
+ # Report controllers
#------------------------------------------------------
- @route('/report/<reportname>/<docids>', type='http', auth='user', website=True, multilang=True)
- def report_html(self, reportname, docids):
- cr, uid, context = request.cr, request.uid, request.context
- docids = self._eval_params(docids)
- return request.registry['report'].get_html(cr, uid, docids, reportname, context=context)
-
- @route('/report/pdf/report/<reportname>/<docids>', type='http', auth="user", website=True)
- def report_pdf(self, reportname, docids):
- cr, uid, context = request.cr, request.uid, request.context
- docids = self._eval_params(docids)
- pdf = request.registry['report'].get_pdf(cr, uid, docids, reportname, context=context)
- pdfhttpheaders = [('Content-Type', 'application/pdf'), ('Content-Length', len(pdf))]
- return request.make_response(pdf, headers=pdfhttpheaders)
-
- #------------------------------------------------------
- # Particular reports controller
- #------------------------------------------------------
- @route('/report/<reportname>', type='http', auth='user', website=True, multilang=True)
- def report_html_particular(self, reportname, **data):
- cr, uid, context = request.cr, request.uid, request.context
+ @route([
+ '/report/<path:converter>/<reportname>',
+ '/report/<path:converter>/<reportname>/<docids>',
+ ], type='http', auth='user', website=True, multilang=True)
+ def report_routes(self, reportname, docids=None, converter=None, **data):
report_obj = request.registry['report']
- data = self._eval_params(data) # Sanitizing
- return report_obj.get_html(cr, uid, [], reportname, data=data, context=context)
-
- @route('/report/pdf/report/<reportname>', type='http', auth='user', website=True, multilang=True)
- def report_pdf_particular(self, reportname, **data):
cr, uid, context = request.cr, request.uid, request.context
- report_obj = request.registry['report']
- data = self._eval_params(data) # Sanitizing
- pdf = report_obj.get_pdf(cr, uid, [], reportname, data=data, context=context)
- pdfhttpheaders = [('Content-Type', 'application/pdf'), ('Content-Length', len(pdf))]
- return request.make_response(pdf, headers=pdfhttpheaders)
+
+ if docids:
+ docids = [int(i) for i in docids.split(',')]
+ options_data = None
+ if data.get('options'):
+ options_data = simplejson.loads(data['options'])
+ if data.get('context'):
+ context.update(simplejson.loads(data['context']))
+
+ if converter == 'html':
+ html = report_obj.get_html(cr, uid, docids, reportname, data=options_data, context=context)
+ return request.make_response(html)
+ elif converter == 'pdf':
+ pdf = report_obj.get_pdf(cr, uid, docids, reportname, data=options_data, context=context)
+ pdfhttpheaders = [('Content-Type', 'application/pdf'), ('Content-Length', len(pdf))]
+ return request.make_response(pdf, headers=pdfhttpheaders)
+ else:
+ raise exceptions.HTTPException(description='Converter %s not implemented.' % converter)
#------------------------------------------------------
# Misc. route utils
@@ -94,7 +89,7 @@ class ReportController(Controller):
@route(['/report/download'], type='http', auth="user", website=True)
def report_download(self, data, token):
"""This function is used by 'qwebactionmanager.js' in order to trigger the download of
- a pdf report.
+ a pdf/controller report.
:param data: a javascript array JSON.stringified containg report internal url ([0]) and
type [1]
@@ -102,26 +97,26 @@ class ReportController(Controller):
"""
requestcontent = simplejson.loads(data)
url, type = requestcontent[0], requestcontent[1]
+
if type == 'qweb-pdf':
- reportname = url.split('/report/pdf/report/')[1].split('?')[0].split('/')[0]
+ reportname = url.split('/report/pdf/')[1].split('?')[0]
- if '?' not in url:
+ docids = None
+ if '/' in reportname:
+ reportname, docids = reportname.split('/')
+
+ if docids:
# Generic report:
- docids = url.split('/')[-1]
- response = self.report_pdf(reportname, docids)
+ response = self.report_routes(reportname, docids=docids, converter='pdf')
else:
# Particular report:
- querystring = url.split('?')[1]
- querystring = dict(urlparse.parse_qsl(querystring))
- response = self.report_pdf_particular(reportname, **querystring)
+ data = url_decode(url.split('?')[1]).items() # decoding the args represented in JSON
+ response = self.report_routes(reportname, converter='pdf', **dict(data))
response.headers.add('Content-Disposition', 'attachment; filename=%s.pdf;' % reportname)
response.set_cookie('fileToken', token)
return response
elif type =='controller':
- from werkzeug.test import Client
- from werkzeug.wrappers import BaseResponse
- from werkzeug.datastructures import Headers
reqheaders = Headers(request.httprequest.headers)
response = Client(request.httprequest.app, BaseResponse).get(url, headers=reqheaders, follow_redirects=True)
response.set_cookie('fileToken', token)
@@ -132,28 +127,3 @@ class ReportController(Controller):
@route(['/report/check_wkhtmltopdf'], type='json', auth="user")
def check_wkhtmltopdf(self):
return request.registry['report']._check_wkhtmltopdf()
-
- def _eval_params(self, param):
- """Parse a dict generated by the webclient (javascript) into a python dict.
- """
- if isinstance(param, dict):
- for key, value in param.iteritems():
- if value.lower() == 'false':
- param[key] = False
- elif value.lower() == 'true':
- param[key] = True
- elif ',' in value:
- param[key] = [int(i) for i in value.split(',')]
- else:
- try:
- param[key] = int(value)
- except (ValueError, TypeError):
- pass
- else:
- if isinstance(param, (str, unicode)):
- param = [int(i) for i in param.split(',')]
- if isinstance(param, list):
- param = list(set(param))
- if isinstance(param, int):
- param = [param]
- return param
diff --git a/addons/report/models/__init__.py b/addons/report/models/__init__.py
index e048e10eb91..d21f03e5bcb 100644
--- a/addons/report/models/__init__.py
+++ b/addons/report/models/__init__.py
@@ -1,2 +1,3 @@
import report
import report_paperformat
+import abstract_report
diff --git a/addons/report/models/abstract_report.py b/addons/report/models/abstract_report.py
new file mode 100644
index 00000000000..2da32b6c0f6
--- /dev/null
+++ b/addons/report/models/abstract_report.py
@@ -0,0 +1,65 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from openerp.osv import osv
+
+
+class AbstractReport(osv.AbstractModel):
+ """Model used to embed old style reports"""
+ _name = 'report.abstract_report'
+ _template = None
+ _wrapped_report_class = None
+
+ def render_html(self, cr, uid, ids, data=None, context=None):
+ if context is None:
+ context = {}
+
+ # If the key 'landscape' is present in data['form'], passing it into the context
+ if data and data.get('form', {}).get('landscape'):
+ context['landscape'] = True
+
+ if context and context.get('active_ids'):
+ # Browse the selected objects via their reference in context
+ model = context.get('active_model') or context.get('model')
+ objects_model = self.pool[model]
+ objects = objects_model.browse(cr, uid, context['active_ids'], context=context)
+ else:
+ # If no context is set (for instance, during test execution), build one
+ model = self.pool['report']._get_report_from_name(cr, uid, self._template).model
+ objects_model = self.pool[model]
+ objects = objects_model.browse(cr, uid, ids, context=context)
+ context['active_model'] = model
+ context['active_ids'] = ids
+
+ # Generate the old style report
+ wrapped_report = self._wrapped_report_class(cr, uid, '', context=context)
+ wrapped_report.set_context(objects, data, context['active_ids'])
+
+ # Rendering self._template with the wrapped report instance localcontext as
+ # rendering environment
+ docargs = wrapped_report.localcontext
+ docargs['docs'] = docargs.get('objects')
+
+ # Used in template translating (see render_doc method from report model)
+ docargs['doc_ids'] = context['active_ids']
+ docargs['doc_model'] = model
+
+ return self.pool['report'].render(cr, uid, [], self._template, docargs, context=context)
diff --git a/addons/report/models/report.py b/addons/report/models/report.py
index 8abe8e544eb..8dd8a4dce6f 100644
--- a/addons/report/models/report.py
+++ b/addons/report/models/report.py
@@ -20,9 +20,10 @@
##############################################################################
from openerp.osv import osv
+from openerp.tools import config
from openerp.tools.translate import _
-from openerp.tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT, config
-from openerp.osv.fields import float as float_field, function as function_field, datetime as datetime_field
+from openerp.addons.web.http import request
+from openerp.tools.safe_eval import safe_eval as eval
import os
import time
@@ -34,8 +35,6 @@ import tempfile
import lxml.html
import cStringIO
import subprocess
-from datetime import datetime
-from functools import partial
from distutils.version import LooseVersion
try:
from pyPdf import PdfFileWriter, PdfFileReader
@@ -46,7 +45,7 @@ except ImportError:
_logger = logging.getLogger(__name__)
-"""Check the presence of wkhtmltopdf and return its version."""
+"""Check the presence of wkhtmltopdf and return its version at OpnerERP start-up."""
wkhtmltopdf_state = 'install'
try:
process = subprocess.Popen(
@@ -70,98 +69,26 @@ class Report(osv.Model):
public_user = None
+ MINIMAL_HTML_PAGE = """
+<base href="{base_url}">
+<!DOCTYPE html>
+<html style="height: 0;">
+ <head>
+ <link href="/report/static/src/css/reset.min.css" rel="stylesheet"/>
+ <link href="/web/static/lib/bootstrap/css/bootstrap.css" rel="stylesheet"/>
+ <link href="/website/static/src/css/website.css" rel="stylesheet"/>
+ <link href="/web/static/lib/fontawesome/css/font-awesome.css" rel="stylesheet"/>
+ <style type='text/css'>{css}</style>
+ {subst}
+ </head>
+ <body class="container" onload="subst()">
+ {body}
+ </body>
+</html>"""
+
#--------------------------------------------------------------------------
# Extension of ir_ui_view.render with arguments frequently used in reports
#--------------------------------------------------------------------------
-
- def _get_digits(self, cr, uid, obj=None, f=None, dp=None):
- d = DEFAULT_DIGITS = 2
- if dp:
- decimal_precision_obj = self.pool['decimal.precision']
- ids = decimal_precision_obj.search(cr, uid, [('name', '=', dp)])
- if ids:
- d = decimal_precision_obj.browse(cr, uid, ids)[0].digits
- elif obj and f:
- res_digits = getattr(obj._columns[f], 'digits', lambda x: ((16, DEFAULT_DIGITS)))
- if isinstance(res_digits, tuple):
- d = res_digits[1]
- else:
- d = res_digits(cr)[1]
- elif (hasattr(obj, '_field') and
- isinstance(obj._field, (float_field, function_field)) and
- obj._field.digits):
- d = obj._field.digits[1] or DEFAULT_DIGITS
- return d
-
- def _get_lang_dict(self, cr, uid):
- pool_lang = self.pool['res.lang']
- lang = self.localcontext.get('lang', 'en_US') or 'en_US'
- lang_ids = pool_lang.search(cr, uid, [('code', '=', lang)])[0]
- lang_obj = pool_lang.browse(cr, uid, lang_ids)
- lang_dict = {
- 'lang_obj': lang_obj,
- 'date_format': lang_obj.date_format,
- 'time_format': lang_obj.time_format
- }
- self.lang_dict.update(lang_dict)
- self.default_lang[lang] = self.lang_dict.copy()
- return True
-
- def formatLang(self, value, digits=None, date=False, date_time=False, grouping=True, monetary=False, dp=False, currency_obj=False, cr=None, uid=None):
- """
- Assuming 'Account' decimal.precision=3:
- formatLang(value) -> digits=2 (default)
- formatLang(value, digits=4) -> digits=4
- formatLang(value, dp='Account') -> digits=3
- formatLang(value, digits=5, dp='Account') -> digits=5
- """
- def get_date_length(date_format=DEFAULT_SERVER_DATE_FORMAT):
- return len((datetime.now()).strftime(date_format))
-
- if digits is None:
- if dp:
- digits = self._get_digits(cr, uid, dp=dp)
- else:
- digits = self._get_digits(cr, uid, value)
-
- if isinstance(value, (str, unicode)) and not value:
- return ''
-
- if not self.lang_dict_called:
- self._get_lang_dict(cr, uid)
- self.lang_dict_called = True
-
- if date or date_time:
- if not str(value):
- return ''
-
- date_format = self.lang_dict['date_format']
- parse_format = DEFAULT_SERVER_DATE_FORMAT
- if date_time:
- value = value.split('.')[0]
- date_format = date_format + " " + self.lang_dict['time_format']
- parse_format = DEFAULT_SERVER_DATETIME_FORMAT
- if isinstance(value, basestring):
- # FIXME: the trimming is probably unreliable if format includes day/month names
- # and those would need to be translated anyway.
- date = datetime.strptime(value[:get_date_length(parse_format)], parse_format)
- elif isinstance(value, time.struct_time):
- date = datetime(*value[:6])
- else:
- date = datetime(*value.timetuple()[:6])
- if date_time:
- # Convert datetime values to the expected client/context timezone
- date = datetime_field.context_timestamp(cr, uid, timestamp=date, context=self.localcontext)
- return date.strftime(date_format.encode('utf-8'))
-
- res = self.lang_dict['lang_obj'].format('%.' + str(digits) + 'f', value, grouping=grouping, monetary=monetary)
- if currency_obj:
- if currency_obj.position == 'after':
- res = '%s %s' % (res, currency_obj.symbol)
- elif currency_obj and currency_obj.position == 'before':
- res = '%s %s' % (currency_obj.symbol, res)
- return res
-
def render(self, cr, uid, ids, template, values=None, context=None):
"""Allow to render a QWeb template python-side. This function returns the 'ir.ui.view'
render but embellish it with some variables/methods used in reports.
@@ -175,28 +102,19 @@ class Report(osv.Model):
if context is None:
context = {}
- self.lang_dict = self.default_lang = {}
- self.lang_dict_called = False
- self.localcontext = {
- 'lang': context.get('lang'),
- 'tz': context.get('tz'),
- 'uid': context.get('uid'),
- }
- self._get_lang_dict(cr, uid)
-
view_obj = self.pool['ir.ui.view']
- def render_doc(doc_id, model, template):
- """Helper used when a report should be translated into the associated
- partner's lang.
+ def translate_doc(doc_id, model, lang_field, template):
+ """Helper used when a report should be translated into a specific lang.
<t t-foreach="doc_ids" t-as="doc_id">
- <t t-raw="render_doc(doc_id, doc_model, 'module.templatetocall')"/>
+ <t t-raw="translate_doc(doc_id, doc_model, 'partner_id.lang', account.report_invoice_document')"/>
</t>
:param doc_id: id of the record to translate
:param model: model of the record to translate
- :param template: name of the template to translate into the partner's lang
+ :param lang_field': field of the record containing the lang
+ :param template: name of the template to translate into the lang_field
"""
ctx = context.copy()
doc = self.pool[model].browse(cr, uid, doc_id, context=ctx)
@@ -205,26 +123,28 @@ class Report(osv.Model):
if ctx.get('translatable') is True:
qcontext['o'] = doc
else:
- ctx['lang'] = doc.partner_id.lang
+ # Reach the lang we want to translate the doc into
+ ctx['lang'] = eval('doc.%s' % lang_field, {'doc': doc})
qcontext['o'] = self.pool[model].browse(cr, uid, doc_id, context=ctx)
return view_obj.render(cr, uid, template, qcontext, context=ctx)
+ user = self.pool['res.users'].browse(cr, uid, uid)
+ website = None
+ if request and hasattr(request, 'website'):
+ website = request.website
values.update({
'time': time,
- 'formatLang': partial(self.formatLang, cr=cr, uid=uid),
- 'get_digits': self._get_digits,
- 'render_doc': render_doc,
+ 'translate_doc': translate_doc,
'editable': True, # Will active inherit_branding
- 'res_company': self.pool['res.users'].browse(cr, uid, uid).company_id,
- 'website': False, # Will be overidden by ir.ui.view if the request has website enabled
+ 'user': user,
+ 'res_company': user.company_id,
+ 'website': website,
})
-
return view_obj.render(cr, uid, template, values, context=context)
#--------------------------------------------------------------------------
- # Main reports methods
+ # Main report methods
#--------------------------------------------------------------------------
-
def get_html(self, cr, uid, ids, report_name, data=None, context=None):
"""This method generates and returns html version of a report.
"""
@@ -233,7 +153,7 @@ class Report(osv.Model):
try:
report_model_name = 'report.%s' % report_name
particularreport_obj = self.pool[report_model_name]
- return particularreport_obj.render_html(cr, uid, ids, data={'form': data}, context=context)
+ return particularreport_obj.render_html(cr, uid, ids, data=data, context=context)
except KeyError:
report = self._get_report_from_name(cr, uid, report_name)
report_obj = self.pool[report.model]
@@ -254,41 +174,12 @@ class Report(osv.Model):
if html is None:
html = self.get_html(cr, uid, ids, report_name, data=data, context=context)
- html = html.decode('utf-8')
+ html = html.decode('utf-8') # Ensure the current document is utf-8 encoded.
# Get the ir.actions.report.xml record we are working on.
report = self._get_report_from_name(cr, uid, report_name)
-
- # Check attachment_use field. If set to true and an existing pdf is already saved, load
- # this one now. Else, mark save it.
- save_in_attachment = {}
-
- if report.attachment_use is True:
- save_in_attachment['model'] = report.model
- save_in_attachment['loaded_documents'] = {}
-
- for record_id in ids:
- obj = self.pool[report.model].browse(cr, uid, record_id)
- filename = eval(report.attachment, {'object': obj, 'time': time})
-
- if filename is False: # May be false if, for instance, the record is in draft state
- continue
- else:
- alreadyindb = [('datas_fname', '=', filename),
- ('res_model', '=', report.model),
- ('res_id', '=', record_id)]
-
- attach_ids = self.pool['ir.attachment'].search(cr, uid, alreadyindb)
- if attach_ids:
- # Add the loaded pdf in the loaded_documents list
- pdf = self.pool['ir.attachment'].browse(cr, uid, attach_ids[0]).datas
- pdf = base64.decodestring(pdf)
- save_in_attachment['loaded_documents'][record_id] = pdf
- _logger.info('The PDF document %s was loaded from the database' % filename)
- else:
- # Mark current document to be saved
- save_in_attachment[id] = filename
-
+ # Check if we have to save the report or if we have to get one from the db.
+ save_in_attachment = self._check_attachment_use(cr, uid, ids, report)
# Get the paperformat associated to the report, otherwise fallback on the company one.
if not report.paperformat_id:
user = self.pool['res.users'].browse(cr, uid, uid)
@@ -297,34 +188,15 @@ class Report(osv.Model):
paperformat = report.paperformat_id
# Preparing the minimal html pages
- #subst = self._get_url_content('/report/static/src/js/subst.js')[0] # Used in age numbering
subst = "<script src='/report/static/src/js/subst.js'></script> "
css = '' # Will contain local css
-
headerhtml = []
contenthtml = []
footerhtml = []
base_url = self.pool['ir.config_parameter'].get_param(cr, uid, 'web.base.url')
- minimalhtml = """
-<base href="{base_url}">
-<!DOCTYPE html>
-<html style="height: 0;">
- <head>
- <link href="/report/static/src/css/reset.min.css" rel="stylesheet"/>
- <link href="/web/static/lib/bootstrap/css/bootstrap.css" rel="stylesheet"/>
- <link href="/website/static/src/css/website.css" rel="stylesheet"/>
- <link href="/web/static/lib/fontawesome/css/font-awesome.css" rel="stylesheet"/>
- <style type='text/css'>{css}</style>
- {subst}
- </head>
- <body class="container" onload='subst()'>
- {body}
- </body>
-</html>"""
-
- # The retrieved html report must be simplified. We convert it into a xml tree
- # via lxml in order to extract headers, footers and content.
+ # The received html report must be simplified. We convert it in a xml tree
+ # in order to extract headers, bodies and footers.
try:
root = lxml.html.fromstring(html)
@@ -333,12 +205,12 @@ class Report(osv.Model):
for node in root.xpath("//div[@class='header']"):
body = lxml.html.tostring(node)
- header = minimalhtml.format(css=css, subst=subst, body=body, base_url=base_url)
+ header = self.MINIMAL_HTML_PAGE.format(css=css, subst=subst, body=body, base_url=base_url)
headerhtml.append(header)
for node in root.xpath("//div[@class='footer']"):
body = lxml.html.tostring(node)
- footer = minimalhtml.format(css=css, subst=subst, body=body, base_url=base_url)
+ footer = self.MINIMAL_HTML_PAGE.format(css=css, subst=subst, body=body, base_url=base_url)
footerhtml.append(footer)
for node in root.xpath("//div[@class='page']"):
@@ -355,7 +227,15 @@ class Report(osv.Model):
reportid = False
body = lxml.html.tostring(node)
- reportcontent = minimalhtml.format(css=css, subst='', body=body, base_url=base_url)
+ reportcontent = self.MINIMAL_HTML_PAGE.format(css=css, subst='', body=body, base_url=base_url)
+
+ # FIXME: imo the best way to extract record id from html reports is by using the
+ # qweb branding. As website editor is not yet splitted in a module independant from
+ # website, when we print a unique report we can use the id passed in argument to
+ # identify it.
+ if ids and len(ids) == 1:
+ reportid = ids[0]
+
contenthtml.append(tuple([reportid, reportcontent]))
except lxml.etree.XMLSyntaxError:
@@ -377,42 +257,65 @@ class Report(osv.Model):
)
return pdf
- def get_action(self, cr, uid, ids, report_name, datas=None, context=None):
+ def get_action(self, cr, uid, ids, report_name, data=None, context=None):
"""Return an action of type ir.actions.report.xml.
:param report_name: Name of the template to generate an action for
"""
- # TODO: return the action for the ids passed in args
if context is None:
context = {}
- if datas is None:
- datas = {}
-
- report_obj = self.pool.get('ir.actions.report.xml')
+ report_obj = self.pool['ir.actions.report.xml']
idreport = report_obj.search(cr, uid, [('report_name', '=', report_name)], context=context)
-
try:
report = report_obj.browse(cr, uid, idreport[0], context=context)
except IndexError:
- raise osv.except_osv(_('Bad Report'),
- _('This report is not loaded into the database.'))
+ raise osv.except_osv(_('Bad Report'), _('This report is not loaded into the database.'))
action = {
+ 'context': context,
+ 'data': data,
'type': 'ir.actions.report.xml',
'report_name': report.report_name,
'report_type': report.report_type,
'report_file': report.report_file,
}
-
- if datas:
- action['datas'] = datas
-
return action
#--------------------------------------------------------------------------
# Report generation helpers
#--------------------------------------------------------------------------
+ def _check_attachment_use(self, cr, uid, ids, report):
+ """ Check attachment_use field. If set to true and an existing pdf is already saved, load
+ this one now. Else, mark save it.
+ """
+ save_in_attachment = {}
+ if report.attachment_use is True:
+ save_in_attachment['model'] = report.model
+ save_in_attachment['loaded_documents'] = {}
+
+ for record_id in ids:
+ obj = self.pool[report.model].browse(cr, uid, record_id)
+ filename = eval(report.attachment, {'object': obj, 'time': time})
+
+ if filename is False: # May be false if, for instance, the record is in draft state
+ continue
+ else:
+ alreadyindb = [('datas_fname', '=', filename),
+ ('res_model', '=', report.model),
+ ('res_id', '=', record_id)]
+
+ attach_ids = self.pool['ir.attachment'].search(cr, uid, alreadyindb)
+ if attach_ids:
+ # Add the loaded pdf in the loaded_documents list
+ pdf = self.pool['ir.attachment'].browse(cr, uid, attach_ids[0]).datas
+ pdf = base64.decodestring(pdf)
+ save_in_attachment['loaded_documents'][record_id] = pdf
+ _logger.info('The PDF document %s was loaded from the database' % filename)
+ else:
+ # Mark current document to be saved
+ save_in_attachment[record_id] = filename
+ return save_in_attachment
def _check_wkhtmltopdf(self):
return wkhtmltopdf_state
@@ -436,8 +339,8 @@ class Report(osv.Model):
# Passing the cookie to wkhtmltopdf in order to resolve URL.
try:
- from openerp.addons.web.http import request
- command_args.extend(['--cookie', 'session_id', request.session.sid])
+ if request:
+ command_args.extend(['--cookie', 'session_id', request.session.sid])
except AttributeError:
pass
@@ -445,6 +348,8 @@ class Report(osv.Model):
if paperformat:
command_args.extend(self._build_wkhtmltopdf_args(paperformat, spec_paperformat_args))
+ command_args.extend(['--load-error-handling', 'ignore'])
+
if landscape and '--orientation' in command_args:
command_args_copy = list(command_args)
for index, elem in enumerate(command_args_copy):
@@ -464,7 +369,7 @@ class Report(osv.Model):
# Directly load the document if we have it
if save_in_attachment and save_in_attachment['loaded_documents'].get(reporthtml[0]):
pdfreport.write(save_in_attachment['loaded_documents'].get(reporthtml[0]))
- pdfreport.flush()
+ pdfreport.seek(0)
pdfdocuments.append(pdfreport)
continue
@@ -473,7 +378,7 @@ class Report(osv.Model):
head_file = tempfile.NamedTemporaryFile(suffix='.html', prefix='report.header.tmp.',
dir=tmp_dir, mode='w+')
head_file.write(headers[index])
- head_file.flush()
+ head_file.seek(0)
command_arg_local.extend(['--header-html', head_file.name])
# Footer stuff
@@ -481,14 +386,14 @@ class Report(osv.Model):
foot_file = tempfile.NamedTemporaryFile(suffix='.html', prefix='report.footer.tmp.',
dir=tmp_dir, mode='w+')
foot_file.write(footers[index])
- foot_file.flush()
+ foot_file.seek(0)
command_arg_local.extend(['--footer-html', foot_file.name])
# Body stuff
content_file = tempfile.NamedTemporaryFile(suffix='.html', prefix='report.body.tmp.',
dir=tmp_dir, mode='w+')
content_file.write(reporthtml[1])
- content_file.flush()
+ content_file.seek(0)
try:
# If the server is running with only one worker, ask to create a secund to be able
@@ -525,7 +430,7 @@ class Report(osv.Model):
_logger.info('The PDF document %s is now saved in the '
'database' % attachment['name'])
- pdfreport.flush()
+ pdfreport.seek(0)
pdfdocuments.append(pdfreport)
if headers:
@@ -566,15 +471,24 @@ class Report(osv.Model):
command_args.extend(['--page-size', paperformat.format])
if paperformat.page_height and paperformat.page_width and paperformat.format == 'custom':
- command_args.extend(['--page-width', str(paperformat.page_width) + 'in'])
- command_args.extend(['--page-height', str(paperformat.page_height) + 'in'])
+ command_args.extend(['--page-width', str(paperformat.page_width) + 'mm'])
+ command_args.extend(['--page-height', str(paperformat.page_height) + 'mm'])
- if specific_paperformat_args and specific_paperformat_args['data-report-margin-top']:
- command_args.extend(['--margin-top',
- str(specific_paperformat_args['data-report-margin-top'])])
+ if specific_paperformat_args and specific_paperformat_args.get('data-report-margin-top'):
+ command_args.extend(['--margin-top', str(specific_paperformat_args['data-report-margin-top'])])
elif paperformat.margin_top:
command_args.extend(['--margin-top', str(paperformat.margin_top)])
+ if specific_paperformat_args and specific_paperformat_args.get('data-report-dpi'):
+ command_args.extend(['--dpi', str(specific_paperformat_args['data-report-dpi'])])
+ elif paperformat.dpi:
+ command_args.extend(['--dpi', str(paperformat.dpi)])
+
+ if specific_paperformat_args and specific_paperformat_args.get('data-report-header-spacing'):
+ command_args.extend(['--header-spacing', str(specific_paperformat_args['data-report-header-spacing'])])
+ elif paperformat.header_spacing:
+ command_args.extend(['--header-spacing', str(paperformat.header_spacing)])
+
if paperformat.margin_left:
command_args.extend(['--margin-left', str(paperformat.margin_left)])
if paperformat.margin_bottom:
@@ -583,12 +497,8 @@ class Report(osv.Model):
command_args.extend(['--margin-right', str(paperformat.margin_right)])
if paperformat.orientation:
command_args.extend(['--orientation', str(paperformat.orientation)])
- if paperformat.header_spacing:
- command_args.extend(['--header-spacing', str(paperformat.header_spacing)])
if paperformat.header_line:
command_args.extend(['--header-line'])
- if paperformat.dpi:
- command_args.extend(['--dpi', str(paperformat.dpi)])
return command_args
diff --git a/addons/report/models/report_paperformat.py b/addons/report/models/report_paperformat.py
index e3e747b81a4..6b84f3d3363 100644
--- a/addons/report/models/report_paperformat.py
+++ b/addons/report/models/report_paperformat.py
@@ -69,8 +69,8 @@ class report_paperformat(osv.Model):
'margin_bottom': fields.integer('Bottom Margin (mm)'),
'margin_left': fields.integer('Left Margin (mm)'),
'margin_right': fields.integer('Right Margin (mm)'),
- 'page_height': fields.integer('Page height (in)'),
- 'page_width': fields.integer('Page width (in)'),
+ 'page_height': fields.integer('Page height (mm)'),
+ 'page_width': fields.integer('Page width (mm)'),
'orientation': fields.selection([('Landscape', 'Landscape'),
('Portrait', 'Portrait')],
'Orientation'),
diff --git a/addons/report/static/src/js/qwebactionmanager.js b/addons/report/static/src/js/qwebactionmanager.js
index b75003942d2..7e55661be86 100644
--- a/addons/report/static/src/js/qwebactionmanager.js
+++ b/addons/report/static/src/js/qwebactionmanager.js
@@ -1,13 +1,20 @@
openerp.report = function(instance) {
var wkhtmltopdf_state;
+ var trigger_download = function(session, response, c) {
+ session.get_file({
+ url: '/report/download',
+ data: {data: JSON.stringify(response)},
+ complete: openerp.web.unblockUI,
+ error: c.rpc_error.bind(c)
+ });
+ }
+
instance.web.ActionManager = instance.web.ActionManager.extend({
ir_actions_report_xml: function(action, options) {
var self = this;
instance.web.blockUI();
action = _.clone(action);
- var eval_contexts = ([instance.session.user_context] || []).concat([action.context]);
- action.context = instance.web.pyeval.eval('contexts',eval_contexts);
_t = instance.web._t;
// QWeb reports
@@ -15,49 +22,40 @@ openerp.report = function(instance) {
var report_url = '';
switch (action.report_type) {
case 'qweb-html':
- report_url = '/report/' + action.report_name;
+ report_url = '/report/html/' + action.report_name;
break;
case 'qweb-pdf':
- report_url = '/report/pdf/report/' + action.report_name;
+ report_url = '/report/pdf/' + action.report_name;
break;
case 'controller':
report_url = action.report_file;
break;
default:
- report_url = '/report/' + action.report_name;
+ report_url = '/report/html/' + action.report_name;
break;
}
- // single/multiple id(s): no query string
- // wizard: query string of action.datas.form
- if (!('datas' in action)) {
+ // generic report: no query string
+ // particular: query string of action.data.form and context
+ if (!('data' in action) || !(action.data)) {
if ('active_ids' in action.context) {
report_url += "/" + action.context.active_ids.join(',');
}
} else {
- _.each(action.datas.form, function(value, key) {
- // will be erased when all wizards are rewritten
- if (key.substring(0, 12) === 'used_context') {
- delete action.datas.form[key];
- }
-
- if ($.type(value) === 'array') {
- action.datas.form[key] = value.join(',');
- }
- });
- report_url += "?" + $.param(action.datas.form);
+ report_url += "?options=" + encodeURIComponent(JSON.stringify(action.data));
+ report_url += "&context=" + encodeURIComponent(JSON.stringify(action.context));
}
+
+ var response = new Array();
+ response[0] = report_url;
+ response[1] = action.report_type;
+ var c = openerp.webclient.crashmanager;
+
if (action.report_type == 'qweb-html') {
- // Open the html report in a popup
window.open(report_url, '_blank', 'height=900,width=1280');
instance.web.unblockUI();
- return;
} else {
// Trigger the download of the pdf/controller report
- var c = openerp.webclient.crashmanager;
- var response = new Array();
- response[0] = report_url;
- response[1] = action.report_type;
if (action.report_type == 'qweb-pdf') {
(wkhtmltopdf_state = wkhtmltopdf_state || openerp.session.rpc('/report/check_wkhtmltopdf')).then(function (presence) {
@@ -66,8 +64,10 @@ openerp.report = function(instance) {
self.do_notify(_t('Report'), _t('Unable to find Wkhtmltopdf on this \
system. The report will be shown in html.<br><br><a href="http://wkhtmltopdf.org/" target="_blank">\
wkhtmltopdf.org</a>'), true);
- window.open(report_url.substring(12), '_blank', 'height=768,width=1024');
+ report_url = report_url.substring(12)
+ window.open('/report/html/' + report_url, '_blank', 'height=768,width=1024');
instance.web.unblockUI();
+ return;
} else {
if (presence == 'upgrade') {
self.do_notify(_t('Report'), _t('You should upgrade your version of\
@@ -75,22 +75,13 @@ openerp.report = function(instance) {
support for table-breaking between pages.<br><br><a href="http://wkhtmltopdf.org/" \
target="_blank">wkhtmltopdf.org</a>'), true);
}
- self.session.get_file({
- url: '/report/download',
- data: {data: JSON.stringify(response)},
- complete: openerp.web.unblockUI,
- error: c.rpc_error.bind(c)
- });
}
+ return trigger_download(self.session, response, c);
});
- } else {
- self.session.get_file({
- url: '/report/download',
- data: {data: JSON.stringify(response)},
- complete: openerp.web.unblockUI,
- error: c.rpc_error.bind(c)
- });
- }
+ }
+ else if (action.report_type == 'controller') {
+ return trigger_download(self.session, response, c);
+ }
}
} else {
return self._super(action, options);
diff --git a/addons/report/tests/test_reports.py b/addons/report/tests/test_reports.py
index dda14442709..b1853489573 100644
--- a/addons/report/tests/test_reports.py
+++ b/addons/report/tests/test_reports.py
@@ -1,5 +1,23 @@
# -*- coding: utf-8 -*-
-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
import logging
import openerp
@@ -11,26 +29,24 @@ _logger = logging.getLogger(__name__)
@openerp.tests.common.post_install(True)
class TestReports(openerp.tests.TransactionCase):
def test_reports(self):
- return # commented out until post_install tests are working
-
registry, cr, uid = self.registry, self.cr, self.uid
r_model = registry('ir.actions.report.xml')
domain = [('report_type', 'like', 'qweb')]
for r in r_model.browse(cr, uid, r_model.search(cr, uid, domain)):
report_model = 'report.%s' % r.report_name
- particular_model = registry('ir.model').search(cr, uid, [('model', '=', report_model)])
-
+ try:
+ registry(report_model)
+ except KeyError:
# Only test the generic reports here
- if particular_model:
+ _logger.info("testing report %s", r.report_name)
+ report_model = registry(r.model)
+ report_model_ids = report_model.search(cr, uid, [], limit=10)
+ if not report_model_ids:
+ _logger.info("no record found skipping report %s", r.report_name)
+ if not r.multi:
+ report_model_ids = report_model_ids[:1]
+
+ # Test report generation
+ registry('report').get_html(cr, uid, report_model_ids, r.report_name)
+ else:
continue
-
- _logger.info("testing report %s", r.report_name)
- report_model = registry(r.model)
- report_model_ids = report_model.search(cr, uid, [], limit=10)
- if not report_model_ids:
- _logger.info("no record found skipping report %s", r.report_name)
- if not r.multi:
- report_model_ids = report_model_ids[:1]
-
- # Test report generation
- registry('report').get_html(cr, uid, report_model_ids, r.report_name)
diff --git a/addons/report/views/layouts.xml b/addons/report/views/layouts.xml
index 588775fc41e..4f5104c726b 100644
--- a/addons/report/views/layouts.xml
+++ b/addons/report/views/layouts.xml
@@ -6,7 +6,10 @@
<html t-att-lang="lang and lang.replace('_', '-')"
t-att-data-editable="'1' if editable else None"
t-att-data-view-xmlid="xmlid if editable else None"
- t-att-data-main-object="repr(main_object) if editable else None">
+ t-att-data-main-object="repr(main_object) if editable else None"
+ t-att-data-report-margin-top="data_report_margin_top if data_report_margin_top else None"
+ t-att-data-report-header-spacing="data_report_header_spacing if data_report_header_spacing else None"
+ t-att-data-report-dpi="data_report_dpi if data_report_dpi else None">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
@@ -64,6 +67,9 @@
.table-condensed > thead > tr > th {
border-bottom: 1px solid black !important;
}
+ .zero_min_height {
+ min-height: 0px !important;
+ }
</template>
<template id="external_layout">
@@ -84,11 +90,11 @@
<div class="header">
<div class="row">
<div class="col-xs-3">
- <img t-if="company.logo" t-att-src="'data:image/png;base64,%s' % company.logo"/>
+ <img t-if="company.logo" t-att-src="'data:image/png;base64,%s' % company.logo" style="max-height: 45px;"/>
</div>
<div class="col-xs-9 text-right" style="margin-top:20px;" t-field="company.rml_header1"/>
</div>
- <div class="row">
+ <div class="row zero_min_height">
<div class="col-xs-12">
<div style="border-bottom: 1px solid black;"></div>
</div>
@@ -158,5 +164,6 @@
</div>
<t t-raw="0" />
</template>
+
</data>
</openerp>
diff --git a/addons/report_intrastat/__init__.py b/addons/report_intrastat/__init__.py
index d2f598434a2..119777f2c70 100644
--- a/addons/report_intrastat/__init__.py
+++ b/addons/report_intrastat/__init__.py
@@ -20,7 +20,5 @@
##############################################################################
import report_intrastat
-import report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/report_intrastat/__openerp__.py b/addons/report_intrastat/__openerp__.py
index 0fa57977db1..4682a777ccc 100644
--- a/addons/report_intrastat/__openerp__.py
+++ b/addons/report_intrastat/__openerp__.py
@@ -19,7 +19,6 @@
#
##############################################################################
-
{
'name': 'Intrastat Reporting',
'version': '1.0',
@@ -37,7 +36,8 @@ European Union.""",
'security/ir.model.access.csv',
'report_intrastat_view.xml',
'intrastat_report.xml',
- 'report_intrastat_data.xml'
+ 'report_intrastat_data.xml',
+ 'views/report_intrastatinvoice.xml'
],
'demo': [],
'test': ['test/report_intrastat_report.yml'],
@@ -45,4 +45,5 @@ European Union.""",
'auto_install': False,
'images': ['images/country_intrastat_code.jpeg','images/intrastat_code.jpeg'],
}
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/report_intrastat/intrastat_report.xml b/addons/report_intrastat/intrastat_report.xml
index 124cf899efb..c5a8e9e7f84 100644
--- a/addons/report_intrastat/intrastat_report.xml
+++ b/addons/report_intrastat/intrastat_report.xml
@@ -1,13 +1,13 @@
<?xml version="1.0"?>
<openerp>
-<data>
- <report string="Invoice Intrastat"
- model="account.invoice"
- name="account.invoice.intrastat"
- rml="report_intrastat/report/invoice.rml"
- id="invoice_intrastat_id"
- auto="False"/>
-</data>
+ <data>
+ <report
+ id="account_intrastatinvoices"
+ model="account.invoice"
+ string="Intrastat Invoices"
+ report_type="qweb-pdf"
+ name="report_intrastat.report_intrastatinvoice"
+ file="report_intrastat.report_intrastatinvoice"
+ />
+ </data>
</openerp>
-
-
diff --git a/addons/report_intrastat/report/__init__.py b/addons/report_intrastat/report/__init__.py
deleted file mode 100644
index 64e530bc278..00000000000
--- a/addons/report_intrastat/report/__init__.py
+++ /dev/null
@@ -1,22 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-import invoice
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/report_intrastat/report/invoice.py b/addons/report_intrastat/report/invoice.py
deleted file mode 100644
index c38a62774ac..00000000000
--- a/addons/report_intrastat/report/invoice.py
+++ /dev/null
@@ -1,35 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-import time
-from openerp.report import report_sxw
-
-class account_invoice_intrastat(report_sxw.rml_parse):
- def __init__(self, cr, uid, name, context):
- super(account_invoice_intrastat, self).__init__(cr, uid, name, context=context)
- self.total=0
- self.localcontext.update({
- 'time': time,
- })
-
-report_sxw.report_sxw('report.account.invoice.intrastat', 'account.invoice', 'addons/report_intrastat/report/invoice.rml', parser=account_invoice_intrastat)
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/report_intrastat/report/invoice.rml b/addons/report_intrastat/report/invoice.rml
deleted file mode 100644
index fc410e04ce0..00000000000
--- a/addons/report_intrastat/report/invoice.rml
+++ /dev/null
@@ -1,401 +0,0 @@
-<?xml version="1.0"?>
-<document filename="Invoices.pdf">
- <template title="Invoices" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
- <pageTemplate id="first">
- <frame id="first" x1="34.0" y1="28.0" width="530" height="786"/>
- </pageTemplate>
- </template>
- <stylesheet>
- <blockTableStyle id="Standard_Outline">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table1">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <blockTableStyle id="Table2">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table3">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
- <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table4">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="7,-1" stop="7,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table5">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="6,-1" stop="6,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="7,-1" stop="7,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table6">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="1,2" stop="1,2"/>
- <lineStyle kind="LINEABOVE" colorName="#000000" start="2,2" stop="2,2"/>
- </blockTableStyle>
- <blockTableStyle id="Table9">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table7">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
- </blockTableStyle>
- <blockTableStyle id="Table8">
- <blockAlignment value="LEFT"/>
- <blockValign value="TOP"/>
- </blockTableStyle>
- <initialize>
- <paraStyle name="all" alignment="justify"/>
- </initialize>
- <paraStyle name="Standard" fontName="Helvetica"/>
- <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Table Contents" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
- <paraStyle name="Caption" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="Index" fontName="Helvetica"/>
- <paraStyle name="Heading" fontName="Helvetica" fontSize="15.0" leading="19" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_8" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="Footer" fontName="Helvetica"/>
- <paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
- <paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_Bold_8" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_Right_8" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_8" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
- <paraStyle name="terp_default_address" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_9" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_9" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Centre_9" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Right_9" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_Bold_Right_9" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_2" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <paraStyle name="terp_default_White_2" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0" textColor="#ffffff"/>
- <paraStyle name="terp_default_Note" rightIndent="0.0" leftIndent="9.0" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
- <images/>
- </stylesheet>
- <story>
- <para style="terp_default_8">[[ repeatIn(objects,'o') ]]</para>
- <para style="terp_default_8">[[ setLang(o.partner_id.lang) ]]</para>
- <blockTable colWidths="297.0,233.0" style="Table1">
- <tr>
- <td>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_8">[[ (o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]]</para>
- <para style="terp_default_8">[[ o.partner_id and display_address(o.partner_id) ]] </para>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <para style="terp_default_8">Tel. : [[ (o.partner_id.phone) or removeParentNode('para') ]]</para>
- <para style="terp_default_8">Fax : [[ (o.partner_id.fax) or removeParentNode('para') ]]</para>
- <para style="terp_default_8">VAT : [[ (o.partner_id.vat) or removeParentNode('para') ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_header">Invoice [[ ((o.type == 'out_invoice' and (o.state == 'open' or o.state == 'paid')) or removeParentNode('para')) and '' ]] [[ o.number ]]</para>
- <para style="terp_header">PRO-FORMA [[ ((o.type == 'out_invoice' and o.state == 'proforma2') or removeParentNode('para')) and '' ]]</para>
- <para style="terp_header">Draft Invoice [[ ((o.type == 'out_invoice' and o.state == 'draft') or removeParentNode('para')) and '' ]]</para>
- <para style="terp_header">Cancelled Invoice [[ ((o.type == 'out_invoice' and o.state == 'cancel') or removeParentNode('para')) and '' ]] [[ o.number ]]</para>
- <para style="terp_header">Refund [[ (o.type=='out_refund' or removeParentNode('para')) and '' ]] [[ o.number ]]</para>
- <para style="terp_header">Supplier Refund [[ (o.type=='in_refund' or removeParentNode('para')) and '' ]] [[ o.number ]]</para>
- <para style="terp_header">Supplier Invoice [[ (o.type=='in_invoice' or removeParentNode('para')) and '' ]] [[ o.number ]]</para>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="177.0,177.0,177.0" style="Table2">
- <tr>
- <td>
- <para style="terp_tblheader_General_Centre">Document</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Invoice Date</para>
- </td>
- <td>
- <para style="terp_tblheader_General_Centre">Partner Ref.</para>
- </td>
- </tr>
- </blockTable>
- <blockTable colWidths="177.0,177.0,177.0" style="Table3">
- <tr>
- <td>
- <para style="terp_default_Centre_9">[[ o.name or ' ' ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_9">[[ formatLang(o.date_invoice,date=True) ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_9">[[ (o.partner_id.ref) or ' ' ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="105.0,57.0,57.0,42.0,71.0,57.0,57.0,85.0" style="Table4">
- <tr>
- <td>
- <para style="terp_tblheader_Details">Description</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Taxes</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Intrastat</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Weight</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Quantity</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Unit Price</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Centre">Disc. (%)</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Price</para>
- </td>
- </tr>
- </blockTable>
- <section>
- <para style="terp_default_8">[[ repeatIn(o.invoice_line,'l') ]]</para>
- <blockTable colWidths="105.0,57.0,57.0,42.0,71.0,57.0,57.0,85.0" style="Table5">
- <tr>
- <td>
- <para style="terp_default_9">[[ l.name ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_9">[[ ', '.join([lt.name for lt in l.invoice_line_tax_id]) ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_9">[[l.product_id and l.product_id.intrastat_id and l.product_id.intrastat_id.name or '']]</para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ l.product_id and l.product_id.weight or '']]</para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang(l.quantity) ]] [[ (l.uos_id and l.uos_id.name) or '' ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang(l.price_unit) ]]</para>
- </td>
- <td>
- <para style="terp_default_Centre_9">[[ l.discount and formatLang (l.discount) or '' ]] </para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang(l.price_subtotal, currency_obj=o.currency_id) ]]</para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="terp_default_Note">[[ format(l.note or removeParentNode('tr')) ]]</para>
- </td>
- <td>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_Right_9">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_Right_9">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_Right_9">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_Right_9">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- </blockTable>
- </section>
- <blockTable colWidths="332.0,99.0,99.0" style="Table6">
- <tr>
- <td>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_9">Total (excl. taxes):</para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang(o.amount_untaxed, currency_obj=o.currency_id) ]]</para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_9">Taxes:</para>
- </td>
- <td>
- <para style="terp_default_Right_9">[[ formatLang(o.amount_tax, currency_obj=o.currency_id) ]]</para>
- </td>
- </tr>
- <tr>
- <td>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- </td>
- <td>
- <para style="terp_default_Bold_9">Total (inclu. taxes):</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">[[ formatLang(o.amount_total, currency_obj=o.currency_id) ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="205.0,71.0,71.0,183.0" style="Table9">
- <tr>
- <td>
- <para style="terp_tblheader_Details">Tax [[ o.tax_line==[] and removeParentNode('blockTable') ]]</para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Base </para>
- </td>
- <td>
- <para style="terp_tblheader_Details_Right">Amount </para>
- </td>
- <td>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- </blockTable>
- <section>
- <para style="terp_default_2">[[ repeatIn(o.tax_line,'t') ]]</para>
- <blockTable colWidths="205.0,71.0,71.0,184.0" style="Table7">
- <tr>
- <td>
- <para style="terp_default_8">[[ t.name ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_8">[[ formatLang(t.base, digits=get_digits(dp='Account'), currency_obj = o.currency_id) ]]</para>
- </td>
- <td>
- <para style="terp_default_Right_8">[[ (t.tax_code_id and t.tax_code_id.notprintable) and removeParentNode('blockTable') or '' ]] [[ formatLang(t.amount, digits=get_digits(dp='Account'), currency_obj=o.currency_id) ]]</para>
- </td>
- <td>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- </td>
- </tr>
- </blockTable>
- </section>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- <para style="terp_default_9">[[ (o.comment and format(o.comment )) or removeParentNode('para') ]]</para>
- <para style="terp_default_8">
- <font color="white"> </font>
- </para>
- <para style="terp_default_9">[[ (o.payment_term and o.payment_term.note and format(o.payment_term and o.payment_term.note)) or removeParentNode('para') ]]</para>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="120.0,410.0" style="Table8">
- <tr>
- <td>
- <para style="terp_default_Bold_9">Fiscal Position Remark : </para>
- </td>
- <td>
- <para style="terp_default_9">[[ (o.fiscal_position and o.fiscal_position.note and format(o.fiscal_position.note)) or removeParentNode('blockTable') ]]</para>
- </td>
- </tr>
- </blockTable>
- <para style="terp_default_2">
- <font color="white"> </font>
- </para>
- </story>
-</document>
diff --git a/addons/report_intrastat/test/report_intrastat_report.yml b/addons/report_intrastat/test/report_intrastat_report.yml
index 687f605b901..5c70ba67ef2 100644
--- a/addons/report_intrastat/test/report_intrastat_report.yml
+++ b/addons/report_intrastat/test/report_intrastat_report.yml
@@ -16,6 +16,6 @@
import os
import openerp.report
from openerp import tools
- data, format = openerp.report.render_report(cr, uid, [ref('test_invoice_1')], 'account.invoice.intrastat', {}, {})
+ data, format = openerp.report.render_report(cr, uid, [ref('test_invoice_1')], 'report_intrastat.report_intrastatinvoice', {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'report_intrastat-intrastat_report.'+format), 'wb+').write(data)
diff --git a/addons/report_intrastat/views/report_intrastatinvoice.xml b/addons/report_intrastat/views/report_intrastatinvoice.xml
new file mode 100644
index 00000000000..c534f808c95
--- /dev/null
+++ b/addons/report_intrastat/views/report_intrastatinvoice.xml
@@ -0,0 +1,149 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+<template id="report_intrastatinvoice_document">
+ <t t-call="report.external_layout">
+ <div class="page">
+ <div class="row">
+ <div class="col-xs-4 col-xs-offset-8">
+ <address t-field="o.partner_id"
+ t-field-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}' />
+ <span t-field="o.partner_id.vat"/>
+ </div>
+ </div>
+
+ <h2>
+ <span t-if="o.type == 'out_invoice' and (o.state == 'open' or o.state == 'paid')">Invoice</span>
+ <span t-if="o.type == 'out_invoice' and o.state == 'proforma2'">PRO-FORMA</span>
+ <span t-if="o.type == 'out_invoice' and o.state == 'draft'">Draft Invoice</span>
+ <span t-if="o.type == 'out_invoice' and o.state == 'cancel'">Cancelled Invoice</span>
+ <span t-if="o.type == 'out_refund'">Refund</span>
+ <span t-if="o.type == 'in_refund'">Supplier Refund</span>
+ <span t-if="o.type == 'in_invoice'">Supplier Invoice</span>
+ <span t-field="o.number"/>
+ </h2>
+
+ <div class="row mt32 mb32">
+ <div class="col-xs-3" t-if="o.name">
+ <strong>Document:</strong>
+ <p t-field="o.name"/>
+ </div>
+ <div class="col-xs-3" t-if="o.date_invoice">
+ <strong>Invoice Date:</strong>
+ <p t-field="o.date_invoice"/>
+ </div>
+ <div class="col-xs-3" t-if="o.partner_id.ref">
+ <strong>Partner Ref.:</strong>
+ <p t-field="o.partner_id.ref"/>
+ </div>
+ </div>
+
+ <table class="table table-condensed">
+ <thead>
+ <tr>
+ <th>Description</th>
+ <th class="text-right">Taxes</th>
+ <th class="text-right">Intrastat</th>
+ <th class="text-right">Weight</th>
+ <th class="text-right">Quantity</th>
+ <th groups="product.group_uom">Unit of measure</th>
+ <th class="text-right">Unit Price</th>
+ <th class="text-right" groups="sale.group_discount_per_so_line">Discount (%)</th>
+ <th class="text-right">Amount</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr t-foreach="o.invoice_line" t-as="l">
+ <td><span t-field="l.name"/></td>
+ <td class="text-right"><span t-esc="', '.join(map(lambda x: x.name, l.invoice_line_tax_id))"/></td>
+ <td class="text-right"><span t-esc="l.product_id.intrastat_id"/></td>
+ <td class="text-right"><span t-esc="l.product_id.weight"/></td>
+ <td class="text-right"><span t-field="l.quantity"/></td>
+ <td groups="product.group_uom"><span t-field="l.uos_id"/></td>
+ <td class="text-right"><span t-field="l.price_unit"/></td>
+ <td groups="sale.group_discount_per_so_line"><span t-field="l.discount"/></td>
+ <td class="text-right">
+ <span t-field="l.price_subtotal"
+ t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+ <div class="row">
+ <div class="col-xs-4 pull-right">
+ <table class="table table-condensed">
+ <tr class="border-black">
+ <td><strong>Total Without Taxes</strong></td>
+ <td class="text-right">
+ <span t-field="o.amount_untaxed" t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
+ </td>
+ </tr>
+ <tr>
+ <td>Taxes</td>
+ <td class="text-right">
+ <span t-field="o.amount_tax" t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
+ </td>
+ </tr>
+ <tr class="border-black">
+ <td><strong>Total</strong></td>
+ <td class="text-right">
+ <span t-field="o.amount_total" t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+
+ <div class="row" t-if="o.tax_line">
+ <div class="col-xs-3">
+ <table class="table table-condensed">
+ <thead>
+ <tr>
+ <th>Tax</th>
+ <th class="text-right">Base</th>
+ <th class="text-right">Amount</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr t-foreach="o.tax_line" t-as="t">
+ <td><span t-field="t.name"/></td>
+ <td class="text-right">
+ <span t-field="t.base"
+ t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
+ </td>
+ <td class="text-right">
+ <span t-field="t.amount"
+ t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </div>
+
+ <p t-if="o.comment">
+ <strong>Comment:</strong>
+ <span t-field="o.comment"/>
+ </p>
+ <p t-if="o.payment_term">
+ <strong>Payment Term:</strong>
+ <span t-field="o.payment_term"/>
+ </p>
+ <p t-if="o.fiscal_position">
+ <strong>Fiscal Position:</strong>
+ <span t-field="o.fiscal_position.note"/>
+ </p>
+ </div>
+ </t>
+</template>
+
+<template id="report_intrastatinvoice">
+ <t t-call="report.html_container">
+ <t t-foreach="doc_ids" t-as="doc_id">
+ <t t-raw="translate_doc(doc_id, doc_model, 'partner_id.lang', 'report_intrastat.report_intrastatinvoice_document')"/>
+ </t>
+ </t>
+</template>
+</data>
+</openerp>
diff --git a/addons/sale/__openerp__.py b/addons/sale/__openerp__.py
index bb5bac89e46..1684760debf 100644
--- a/addons/sale/__openerp__.py
+++ b/addons/sale/__openerp__.py
@@ -59,7 +59,7 @@ The Dashboard for the Sales Manager will include
'author': 'OpenERP SA',
'website': 'http://www.openerp.com',
'images': ['images/sale_dashboard.jpeg','images/Sale_order_line_to_invoice.jpeg','images/sale_order.jpeg','images/sales_analysis.jpeg'],
- 'depends': ['account_voucher'],
+ 'depends': ['account_voucher', 'report'],
'data': [
'wizard/sale_make_invoice_advance.xml',
'wizard/sale_line_invoice.xml',
diff --git a/addons/sale/views/report_saleorder.xml b/addons/sale/views/report_saleorder.xml
index c6f237e3ac3..c23e680e664 100644
--- a/addons/sale/views/report_saleorder.xml
+++ b/addons/sale/views/report_saleorder.xml
@@ -1,131 +1,135 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
-<template id="report_saleorder">
- <t t-call="report.html_container">
- <t t-foreach="docs" t-as="o">
- <t t-call="report.external_layout">
- <div class="page">
- <div class="oe_structure"/>
- <div class="row">
- <div class="col-xs-6">
- <p t-if="o.partner_shipping_id == o.partner_invoice_id">Invoice and shipping address:</p>
- <p t-if="o.partner_shipping_id != o.partner_invoice_id">Invoice address: </p>
- <div t-field="o.partner_invoice_id"
- t-field-options='{"widget": "contact", "fields": ["address", "name", "phone", "fax"], "no_marker": true}'/>
- <p t-if="o.partner_id.vat">VAT: <span t-field="o.partner_id.vat"/></p>
- <div t-if="o.partner_shipping_id != o.partner_invoice_id">
- <p>Shipping address :</p>
- <div t-field="o.partner_shipping_id"
- t-field-options='{"widget": "contact", "fields": ["address", "name", "phone", "fax"], "no_marker": true}'/>
- <p t-if="o.partner_id.vat">VAT: <span t-field="o.partner_id.vat"/></p>
- </div>
- </div>
- <div class="col-xs-4 col-xs-offset-2">
- <div t-field="o.partner_id"
- t-field-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}' />
- </div>
- </div>
+<template id="report_saleorder_document">
+ <t t-call="report.external_layout">
+ <div class="page">
+ <div class="oe_structure"/>
+ <div class="row">
+ <div class="col-xs-6">
+ <p t-if="o.partner_shipping_id == o.partner_invoice_id">Invoice and shipping address:</p>
+ <p t-if="o.partner_shipping_id != o.partner_invoice_id">Invoice address: </p>
+ <div t-field="o.partner_invoice_id"
+ t-field-options='{"widget": "contact", "fields": ["address", "name", "phone", "fax"], "no_marker": true}'/>
+ <p t-if="o.partner_id.vat">VAT: <span t-field="o.partner_id.vat"/></p>
+ <div t-if="o.partner_shipping_id != o.partner_invoice_id">
+ <p>Shipping address :</p>
+ <div t-field="o.partner_shipping_id"
+ t-field-options='{"widget": "contact", "fields": ["address", "name", "phone", "fax"], "no_marker": true}'/>
+ <p t-if="o.partner_id.vat">VAT: <span t-field="o.partner_id.vat"/></p>
+ </div>
+ </div>
+ <div class="col-xs-4 col-xs-offset-2">
+ <div t-field="o.partner_id"
+ t-field-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}' />
+ </div>
+ </div>
- <h2>
- <span t-if="o.state not in ['draft','sent']">Order N° </span>
- <span t-if="o.state in ['draft','sent']">Quotation N° </span>
- <span t-field="o.name"/>
- </h2>
+ <h2>
+ <span t-if="o.state not in ['draft','sent']">Order N° </span>
+ <span t-if="o.state in ['draft','sent']">Quotation N° </span>
+ <span t-field="o.name"/>
+ </h2>
- <div class="row mt32 mb32">
- <div t-if="o.client_order_ref" class="col-xs-3">
- <strong>Your Reference:</strong>
- <p t-field="o.client_order_ref"/>
- </div>
- <div t-if="o.date_order" class="col-xs-3">
- <strong t-if="o.state not in ['draft','sent']">Date Ordered:</strong>
- <strong t-if="o.state in ['draft','sent']">Quotation Date:</strong>
- <p t-field="o.date_order"/>
- </div>
- <div t-if="o.user_id.name" class="col-xs-3">
- <strong>Salesperson:</strong>
- <p t-field="o.user_id.name"/>
- </div>
- <div t-if="o.payment_term" class="col-xs-3">
- <strong>Payment Term:</strong>
- <p t-field="o.payment_term"/>
- </div>
- </div>
+ <div class="row mt32 mb32">
+ <div t-if="o.client_order_ref" class="col-xs-3">
+ <strong>Your Reference:</strong>
+ <p t-field="o.client_order_ref"/>
+ </div>
+ <div t-if="o.date_order" class="col-xs-3">
+ <strong t-if="o.state not in ['draft','sent']">Date Ordered:</strong>
+ <strong t-if="o.state in ['draft','sent']">Quotation Date:</strong>
+ <p t-field="o.date_order"/>
+ </div>
+ <div t-if="o.user_id.name" class="col-xs-3">
+ <strong>Salesperson:</strong>
+ <p t-field="o.user_id.name"/>
+ </div>
+ <div t-if="o.payment_term" class="col-xs-3">
+ <strong>Payment Term:</strong>
+ <p t-field="o.payment_term"/>
+ </div>
+ </div>
+ <table class="table table-condensed">
+ <thead>
+ <tr>
+ <th>Description</th>
+ <th>Taxes</th>
+ <th class="text-right">Quantity</th>
+ <th class="text-right">Unit Price</th>
+ <th groups="sale.group_discount_per_so_line">Disc.(%)</th>
+ <th class="text-right">Price</th>
+ </tr>
+ </thead>
+ <tbody class="sale_tbody">
+ <tr t-foreach="o.order_line" t-as="l">
+ <td>
+ <span t-field="l.name"/>
+ </td>
+ <td>
+ <span t-esc="', '.join(map(lambda x: x.name, l.tax_id))"/>
+ </td>
+ <td class="text-right">
+ <span t-field="l.product_uom_qty"/>
+ <span groups="product.group_uom" t-field="l.product_uom"/>
+ </td>
+ <td class="text-right">
+ <span t-field="l.price_unit"/>
+ </td>
+ <td groups="sale.group_discount_per_so_line">
+ <span t-field="l.discount"/>
+ </td>
+ <td class="text-right">
+ <span t-field="l.price_subtotal"
+ t-field-options='{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}'/>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+ <div class="row">
+ <div class="col-xs-4 pull-right">
<table class="table table-condensed">
- <thead>
- <tr>
- <th>Description</th>
- <th>Taxes</th>
- <th class="text-right">Quantity</th>
- <th class="text-right">Unit Price</th>
- <th groups="sale.group_discount_per_so_line">Disc.(%)</th>
- <th class="text-right">Price</th>
- </tr>
- </thead>
- <tbody>
- <tr t-foreach="o.order_line" t-as="l">
- <td>
- <span t-field="l.name"/>
- </td>
- <td>
- <span t-esc="', '.join(map(lambda x: x.name, l.tax_id))"/>
- </td>
- <td class="text-right">
- <span t-field="l.product_uom_qty"/>
- <span groups="product.group_uom" t-field="l.product_uom"/>
- </td>
- <td class="text-right">
- <span t-field="l.price_unit"/>
- </td>
- <td groups="sale.group_discount_per_so_line">
- <span t-field="l.discount"/>
- </td>
- <td class="text-right">
- <span t-field="l.price_subtotal"
- t-field-options='{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}'/>
- </td>
- </tr>
- </tbody>
+ <tr class="border-black">
+ <td><strong>Total Without Taxes</strong></td>
+ <td class="text-right">
+ <span t-field="o.amount_untaxed"
+ t-field-options='{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}'/>
+ </td>
+ </tr>
+ <tr>
+ <td>Taxes</td>
+ <td class="text-right">
+ <span t-field="o.amount_tax"
+ t-field-options='{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}'/>
+ </td>
+ </tr>
+ <tr class="border-black">
+ <td><strong>Total</strong></td>
+ <td class="text-right">
+ <span t-field="o.amount_total"
+ t-field-options='{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}'/>
+ </td>
+ </tr>
</table>
+ </div>
+ </div>
- <div class="row">
- <div class="col-xs-4 pull-right">
- <table class="table table-condensed">
- <tr class="border-black">
- <td><strong>Total Without Taxes</strong></td>
- <td class="text-right">
- <span t-field="o.amount_untaxed"
- t-field-options='{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}'/>
- </td>
- </tr>
- <tr>
- <td>Taxes</td>
- <td class="text-right">
- <span t-field="o.amount_tax"
- t-field-options='{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}'/>
- </td>
- </tr>
- <tr class="border-black">
- <td><strong>Total</strong></td>
- <td class="text-right">
- <span t-field="o.amount_total"
- t-field-options='{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}'/>
- </td>
- </tr>
- </table>
- </div>
- </div>
+ <p t-field="o.note" />
+ <p t-if="o.payment_term">
+ <strong>Payment Term:</strong>
+ <span t-field="o.payment_term"/>
+ </p>
+ <div class="oe_structure"/>
+ </div>
+ </t>
+</template>
- <p t-field="o.note" />
- <p t-if="o.payment_term">
- <strong>Payment Term:</strong>
- <span t-field="o.payment_term"/>
- </p>
- <div class="oe_structure"/>
- </div>
- </t>
+<template id="report_saleorder">
+ <t t-call="report.html_container">
+ <t t-foreach="doc_ids" t-as="doc_id">
+ <t t-raw="translate_doc(doc_id, doc_model, 'partner_id.lang', 'sale.report_saleorder_document')"/>
</t>
</t>
</template>
diff --git a/addons/sale_layout/__init__.py b/addons/sale_layout/__init__.py
new file mode 100644
index 00000000000..bff786c0885
--- /dev/null
+++ b/addons/sale_layout/__init__.py
@@ -0,0 +1 @@
+import models
diff --git a/addons/account/report/account_print_invoice.py b/addons/sale_layout/__openerp__.py
index 75680810254..b8fcefc6adc 100644
--- a/addons/account/report/account_print_invoice.py
+++ b/addons/sale_layout/__openerp__.py
@@ -2,7 +2,7 @@
##############################################################################
#
# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+# Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
@@ -19,19 +19,26 @@
#
##############################################################################
-import time
-from openerp.report import report_sxw
-
-class account_invoice(report_sxw.rml_parse):
- def __init__(self, cr, uid, name, context):
- super(account_invoice, self).__init__(cr, uid, name, context=context)
- self.localcontext.update({
- 'time': time,
- })
-report_sxw.report_sxw(
- 'report.account.invoice',
- 'account.invoice',
- 'addons/account/report/account_print_invoice.rml',
- parser=account_invoice
-)
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+{
+ 'name': 'Sale Layout',
+ 'version': '1.0',
+ 'sequence': 14,
+ 'summary': 'Sale Layout, page-break, subtotals, separators, report',
+ 'description': """
+Manage your sales reports
+=========================
+With this module you can personnalize the sale order and invoice report with
+separators, page-breaks or subtotals.
+ """,
+ 'author': 'OpenERP SA',
+ 'website': 'http://www.openerp.com',
+ 'depends': ['sale', 'report'],
+ 'category': 'Sale',
+ 'data': ['views/sale_layout_category_view.xml',
+ 'views/report_invoice_layouted.xml',
+ 'views/report_quotation_layouted.xml',
+ 'views/sale_layout_template.xml',
+ 'security/ir.model.access.csv'],
+ 'demo': ['data/sale_layout_category_data.xml'],
+ 'installable': True,
+}
diff --git a/addons/sale_layout/data/sale_layout_category_data.xml b/addons/sale_layout/data/sale_layout_category_data.xml
new file mode 100644
index 00000000000..858654e427f
--- /dev/null
+++ b/addons/sale_layout/data/sale_layout_category_data.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data noupdate="1">
+ <record id="sale_layout_cat_1" model="sale_layout.category">
+ <field name="name">Services</field>
+ <field name="subtotal" eval="True"></field>
+ <field name="separator" eval="True"></field>
+ <field name="pagebreak" eval="True"></field>
+ <field name="sequence">1</field>
+ </record>
+
+ <record id="sale_layout_cat_2" model="sale_layout.category">
+ <field name="name">Material</field>
+ <field name="subtotal" eval="True"></field>
+ <field name="separator" eval="True"></field>
+ <field name="pagebreak" eval="False"></field>
+ <field name="sequence">10</field>
+ </record>
+ </data>
+</openerp>
diff --git a/addons/sale_layout/models/__init__.py b/addons/sale_layout/models/__init__.py
new file mode 100644
index 00000000000..9e9b002e402
--- /dev/null
+++ b/addons/sale_layout/models/__init__.py
@@ -0,0 +1 @@
+import sale_layout
diff --git a/addons/sale_layout/models/sale_layout.py b/addons/sale_layout/models/sale_layout.py
new file mode 100644
index 00000000000..ac9d4241607
--- /dev/null
+++ b/addons/sale_layout/models/sale_layout.py
@@ -0,0 +1,146 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from openerp.osv import osv, fields
+from itertools import groupby
+
+
+def grouplines(self, ordered_lines, sortkey):
+ """Return lines from a specified invoice or sale order grouped by category"""
+ grouped_lines = []
+ for key, valuesiter in groupby(ordered_lines, sortkey):
+ group = {}
+ group['category'] = key
+ group['lines'] = list(v for v in valuesiter)
+
+ if 'subtotal' in key and key.subtotal is True:
+ group['subtotal'] = sum(line.price_subtotal for line in group['lines'])
+ grouped_lines.append(group)
+
+ return grouped_lines
+
+
+class SaleLayoutCategory(osv.Model):
+ _name = 'sale_layout.category'
+ _order = 'sequence'
+ _columns = {
+ 'name': fields.char('Name', required=True),
+ 'sequence': fields.integer('Sequence', required=True),
+ 'subtotal': fields.boolean('Add subtotal'),
+ 'separator': fields.boolean('Add separator'),
+ 'pagebreak': fields.boolean('Add pagebreak')
+ }
+
+ _defaults = {
+ 'subtotal': True,
+ 'separator': True,
+ 'pagebreak': False,
+ 'sequence': 10
+ }
+
+ # We want to forbid edit of a category if it is already linked to a report.
+ def _check(self, cr, uid, ids):
+ for cat in self.browse(cr, uid, ids):
+ invoice_obj = self.pool.get('account.invoice.line')
+ sale_obj = self.pool.get('sale.order.line')
+ ids = invoice_obj.search(cr, uid, [('sale_layout_cat_id', '=', cat.id)])
+ ids += sale_obj.search(cr, uid, [('sale_layout_cat_id', '=', cat.id)])
+
+ if len(ids) > 0:
+ return False
+
+ return True
+
+ _constraints = [(
+ _check,
+ 'This category could not be modified nor deleted because it is still used in an invoice or'
+ ' a sale report.', ['name']
+ )]
+
+
+class AccountInvoice(osv.Model):
+ _inherit = 'account.invoice'
+
+ def sale_layout_lines(self, cr, uid, ids, invoice_id=None, context=None):
+ """
+ Returns invoice lines from a specified invoice ordered by
+ sale_layout_category sequence. Used in sale_layout module.
+
+ :Parameters:
+ -'invoice_id' (int): specify the concerned invoice.
+ """
+ ordered_lines = self.browse(cr, uid, invoice_id, context=context).invoice_line
+ # We chose to group first by category model and, if not present, by invoice name
+ sortkey = lambda x: x.sale_layout_cat_id if x.sale_layout_cat_id else ''
+
+ return grouplines(self, ordered_lines, sortkey)
+
+
+class AccountInvoiceLine(osv.Model):
+ _inherit = 'account.invoice.line'
+ _columns = {
+ 'sale_layout_cat_id': fields.many2one('sale_layout.category',
+ 'Layout Category'),
+ 'categ_sequence': fields.related('sale_layout_cat_id',
+ 'sequence', type='integer',
+ string='Layout Sequence', store=True)
+ # Store is intentionally set in order to keep the "historic" order.
+ }
+ _order = 'invoice_id, categ_sequence, sequence, id'
+
+
+class SaleOrder(osv.Model):
+ _inherit = 'sale.order'
+
+ def sale_layout_lines(self, cr, uid, ids, order_id=None, context=None):
+ """
+ Returns order lines from a specified sale ordered by
+ sale_layout_category sequence. Used in sale_layout module.
+
+ :Parameters:
+ -'order_id' (int): specify the concerned sale order.
+ """
+ ordered_lines = self.browse(cr, uid, order_id, context=context).order_line
+ sortkey = lambda x: x.sale_layout_cat_id if x.sale_layout_cat_id else ''
+
+ return grouplines(self, ordered_lines, sortkey)
+
+
+class SaleOrderLine(osv.Model):
+ _inherit = 'sale.order.line'
+ _columns = {
+ 'sale_layout_cat_id': fields.many2one('sale_layout.category',
+ 'Layout Category'),
+ 'categ_sequence': fields.related('sale_layout_cat_id',
+ 'sequence', type='integer',
+ string='Layout Sequence', store=True)
+ # Store is intentionally set in order to keep the "historic" order.
+ }
+ _order = 'order_id, categ_sequence, sequence, id'
+
+ def _prepare_order_line_invoice_line(self, cr, uid, line, account_id=False, context=None):
+ """Save the layout when converting to an invoice line."""
+ invoice_vals = super(SaleOrderLine, self)._prepare_order_line_invoice_line(cr, uid, line, account_id=account_id, context=context)
+ if line.sale_layout_cat_id:
+ invoice_vals['sale_layout_cat_id'] = line.sale_layout_cat_id.id
+ if line.categ_sequence:
+ invoice_vals['categ_sequence'] = line.categ_sequence
+ return invoice_vals
diff --git a/addons/sale_layout/security/ir.model.access.csv b/addons/sale_layout/security/ir.model.access.csv
new file mode 100644
index 00000000000..119fce977d1
--- /dev/null
+++ b/addons/sale_layout/security/ir.model.access.csv
@@ -0,0 +1,5 @@
+id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
+report_layout_category_1,report_layout_category_1,model_sale_layout_category,base.group_sale_manager,1,1,1,1
+report_layout_category_2,report_layout_category_2,model_sale_layout_category,account.group_account_manager,1,1,1,1
+report_layout_category_3,report_layout_category_3,model_sale_layout_category,base.group_sale_salesman,1,1,1,O
+report_layout_category_4,report_layout_category_4,model_sale_layout_category,base.group_sale_salesman_all_leads,1,1,1,0
diff --git a/addons/sale_layout/views/report_invoice_layouted.xml b/addons/sale_layout/views/report_invoice_layouted.xml
new file mode 100644
index 00000000000..4c0b1929484
--- /dev/null
+++ b/addons/sale_layout/views/report_invoice_layouted.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+<template id="report_invoice_layouted" inherit_id="account.report_invoice_document">
+ <xpath expr="//table/tbody[@class='invoice_tbody']" position="replace">
+ <t t-foreach="o.sale_layout_lines(invoice_id=o.id)" t-as="p">
+ <!-- Name of the category -->
+ <t t-call="sale_layout.category_template"/>
+
+ <!-- Lines associated -->
+ <t t-foreach="p['lines']" t-as="l">
+ <tr>
+ <td><span t-field="l.name"/></td>
+ <td><span t-field="l.quantity"/></td>
+ <td groups="product.group_uom"><span t-field="l.uos_id"/></td>
+ <td class="text-right">
+ <span t-field="l.price_unit"/>
+ </td>
+ <td groups="sale.group_discount_per_so_line"><span t-field="l.discount"/></td>
+ <td class="text-right">
+ <span t-esc="', '.join(map(lambda x: x.name, l.invoice_line_tax_id))"/>
+ </td>
+ <td class="text-right">
+ <span t-field="l.price_subtotal"
+ t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
+ </td>
+ </tr>
+ </t>
+
+ <!-- Subtotal -->
+ <t t-call="sale_layout.subtotal_template"/>
+
+ <!-- Separator -->
+ <t t-call="sale_layout.separator_template"/>
+
+ <!-- Pagebreak -->
+ <t t-if="'pagebreak' in p['category'] and p['category'].pagebreak is True">
+ <t t-if="p_index &lt; p_size - 1">
+ <![CDATA[
+ </tbody>
+ </table>
+ <p style="page-break-before:always;"> </p>
+ <table class="table table-condensed">
+ ]]>
+ <thead>
+ <tr>
+ <th>Description</th>
+ <th>Quantity</th>
+ <th groups="product.group_uom">Unit of measure</th>
+ <th class="text-right">Unit Price</th>
+ <th class="text-right" groups="sale.group_discount_per_so_line">Discount (%)</th>
+ <th class="text-right">Taxes</th>
+ <th class="text-right">Amount</th>
+ </tr>
+ </thead>
+ <![CDATA[
+ <tbody>
+ ]]>
+ </t>
+ </t>
+ </t>
+ </xpath>
+</template>
+</data>
+</openerp>
diff --git a/addons/sale_layout/views/report_quotation_layouted.xml b/addons/sale_layout/views/report_quotation_layouted.xml
new file mode 100644
index 00000000000..02f56786392
--- /dev/null
+++ b/addons/sale_layout/views/report_quotation_layouted.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <template id="report_sale_layouted" inherit_id="sale.report_saleorder_document">
+ <xpath expr="//table/tbody[@class='sale_tbody']" position="replace">
+ <t t-foreach="o.sale_layout_lines(order_id = o.id)" t-as="p">
+ <!-- Name of the category -->
+ <t t-call="sale_layout.category_template" />
+
+ <!-- Lines associated -->
+ <t t-foreach="p['lines']" t-as="l">
+ <tr>
+ <td>
+ <span t-field="l.name"/>
+ </td>
+ <td>
+ <span t-esc="', '.join(map(lambda x: x.name, l.tax_id))"/>
+ </td>
+ <td class="text-right">
+ <span t-field="l.product_uom_qty"/>
+ <span groups="product.group_uom" t-field="l.product_uom"/>
+ </td>
+ <td class="text-right">
+ <span t-field="l.price_unit"/>
+ </td>
+ <td groups="sale.group_discount_per_so_line">
+ <span t-field="l.discount"/>
+ </td>
+ <td class="text-right">
+ <span t-field="l.price_subtotal"
+ t-field-options='{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}'/>
+ </td>
+ </tr>
+ </t>
+
+ <!-- Subtotal -->
+ <t t-call="sale_layout.subtotal_template" />
+
+ <!-- Separator -->
+ <t t-call="sale_layout.separator_template" />
+
+ <!-- Pagebreak -->
+ <t t-if="'pagebreak' in p['category'] and p['category'].pagebreak is True">
+ <t t-if="p_index &lt; p_size - 1">
+ <![CDATA[
+ </tbody>
+ </table>
+ <p style="page-break-before:always;"> </p>
+ <table class="table table-condensed">
+ ]]>
+ <thead>
+ <tr>
+ <th>Description</th>
+ <th>Taxes</th>
+ <th class="text-right">Quantity</th>
+ <th class="text-right">Unit Price</th>
+ <th groups="sale.group_discount_per_so_line">Disc.(%)</th>
+ <th class="text-right">Price</th>
+ </tr>
+ </thead>
+ <![CDATA[
+ <tbody>
+ ]]>
+ </t>
+ </t>
+ </t>
+ </xpath>
+ </template>
+ </data>
+</openerp>
diff --git a/addons/sale_layout/views/sale_layout_category_view.xml b/addons/sale_layout/views/sale_layout_category_view.xml
new file mode 100644
index 00000000000..08f892c127e
--- /dev/null
+++ b/addons/sale_layout/views/sale_layout_category_view.xml
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <!-- Sale order form -->
+ <record model="ir.ui.view" id="view_order_form_inherit_1">
+ <field name="name">sale.order.form.inherit_1</field>
+ <field name="model">sale.order</field>
+ <field name="inherit_id" ref="sale.view_order_form"/>
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr="//notebook/page/field[@name='order_line']/tree" position="attributes">
+ <attribute name="editable"></attribute>
+ </xpath>
+ </data>
+ </field>
+ </record>
+
+ <record model="ir.ui.view" id="view_order_form_inherit_2">
+ <field name="name">sale.order.line.form.inherit_2</field>
+ <field name="model">sale.order</field>
+ <field name="inherit_id" ref="sale.view_order_form"/>
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr="//field[@name='order_line']/form/group/group/field[@name='product_id']" position="before">
+ <field name="sale_layout_cat_id"/>
+ </xpath>
+ </data>
+ </field>
+ </record>
+
+ <!-- Invoice form -->
+ <record model="ir.ui.view" id="view_invoice_form_inherit_1">
+ <field name="name">account.invoice.form.inherit_1</field>
+ <field name="model">account.invoice</field>
+ <field name="inherit_id" ref="account.invoice_form"/>
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr="//notebook/page/field[@name='invoice_line']/tree" position="attributes">
+ <attribute name="editable"></attribute>
+ </xpath>
+ </data>
+ </field>
+ </record>
+
+ <record model="ir.ui.view" id="view_invoice_line_form_inherit_2">
+ <field name="name">account.invoice.line.form.inherit_2</field>
+ <field name="model">account.invoice.line</field>
+ <field name="inherit_id" ref="account.view_invoice_line_form"/>
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr="//group/group/field[@name='product_id']" position="before">
+ <field name="sale_layout_cat_id"/>
+ </xpath>
+ </data>
+ </field>
+ </record>
+
+ <!-- Report condiguration -->
+ <record id="report_configuration_form_view" model="ir.ui.view">
+ <field name="name">report.configuration.form.view</field>
+ <field name="model">sale_layout.category</field>
+ <field name="arch" type="xml">
+ <form string="Report Configuration" version="7.0">
+ <group>
+ <field name="name"/>
+ <field name="subtotal" widget="checkbox"/>
+ <field name="separator" widget="checkbox"/>
+ <field name="pagebreak" widget="checkbox"/>
+ <field name="sequence"/>
+ </group>
+ </form>
+ </field>
+ </record>
+
+ <record id="report_configuration_tree_view" model="ir.ui.view">
+ <field name="name">report.configuration.form.view</field>
+ <field name="model">sale_layout.category</field>
+ <field name="arch" type="xml">
+ <tree string="Report Configuration">
+ <field name="name"/>
+ <field name="subtotal" widget="checkbox"/>
+ <field name="separator" widget="checkbox"/>
+ <field name="pagebreak" widget="checkbox"/>
+ <field name="sequence"/>
+ </tree>
+ </field>
+ </record>
+
+ <record id="report_configuration_search_view" model="ir.ui.view" >
+ <field name="name">report.configuration.search.view</field>
+ <field name="model">sale_layout.category</field>
+ <field name="arch" type="xml">
+ <search string="Search Name">
+ <filter string="Total" domain="[('subtotal','=','True')]"/>
+ <filter string="Separator" domain="[('separator','=','True')]"/>
+ <filter string="Break" domain="[('pagebreak','=','True')]"/>
+ <group string="Group By Name">
+ <filter string="Name" context="{'group_by' : 'name'}"/>
+ </group>
+ </search>
+ </field>
+ </record>
+
+ <record id='report_configuration_action' model='ir.actions.act_window'>
+ <field name="name">Report Configuration</field>
+ <field name="res_model">sale_layout.category</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">tree,form</field>
+ </record>
+
+ <menuitem
+ action="report_configuration_action"
+ id="Report_configuration"
+ parent="base.menu_base_config"
+ sequence="25"
+ name="Report Layout Categories"
+ groups="base.group_sale_manager,base.group_sale_salesman,account.group_account_manager,account.group_account_user"
+ />
+ </data>
+</openerp>
diff --git a/addons/sale_layout/views/sale_layout_template.xml b/addons/sale_layout/views/sale_layout_template.xml
new file mode 100644
index 00000000000..73406fc9fd6
--- /dev/null
+++ b/addons/sale_layout/views/sale_layout_template.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+<template id="category_template">
+ <!-- Category name -->
+ <t t-if="p['category']">
+ <tr>
+ <td colspan="100" class="active" style="font-weight: bold; border-bottom: 1px solid black;">&amp;bull;
+ <t t-if="p['category'].name">
+ <t t-esc="p['category'].name"></t>
+ </t>
+ <t t-if="not p['category'].name">
+ Uncategorized
+ </t>
+ </td>
+ </tr>
+ </t>
+</template>
+
+<template id="subtotal_template">
+ <!-- Subtotal -->
+ <t t-if="'subtotal' in p['category'] and p['category'].subtotal is True">
+ <tr class="text-right">
+ <td colspan="100">
+ <strong>Subtotal: </strong>
+ <span t-esc="p['subtotal']" t-esc-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
+ </td>
+ </tr>
+ </t>
+</template>
+
+<template id="separator_template">
+ <!-- Separator -->
+ <t t-if="'separator' in p['category'] and p['category'].separator is True">
+ <tr class="text-center">
+ <td colspan="100">
+ ***
+ </td>
+ </tr>
+ </t>
+</template>
+</data>
+</openerp>
diff --git a/addons/website/controllers/main.py b/addons/website/controllers/main.py
index 1711bddcfce..19df0de92a2 100644
--- a/addons/website/controllers/main.py
+++ b/addons/website/controllers/main.py
@@ -247,37 +247,47 @@ class Website(openerp.addons.web.controllers.main.Home):
return True
@http.route('/website/attach', type='http', auth='user', methods=['POST'], website=True)
- def attach(self, func, upload):
+ def attach(self, func, upload=None, url=None):
+ Attachments = request.registry['ir.attachment']
- url = message = None
- try:
- image_data = upload.read()
- image = Image.open(cStringIO.StringIO(image_data))
- w, h = image.size
- if w*h > 42e6: # Nokia Lumia 1020 photo resolution
- raise ValueError(
- u"Image size excessive, uploaded images must be smaller "
- u"than 42 million pixel")
-
- Attachments = request.registry['ir.attachment']
+ website_url = message = None
+ if not upload:
+ website_url = url
+ name = url.split("/").pop()
attachment_id = Attachments.create(request.cr, request.uid, {
- 'name': upload.filename,
- 'datas': image_data.encode('base64'),
- 'datas_fname': upload.filename,
+ 'name':name,
+ 'type': 'url',
+ 'url': url,
'res_model': 'ir.ui.view',
}, request.context)
-
- [attachment] = Attachments.read(
- request.cr, request.uid, [attachment_id], ['website_url'],
- context=request.context)
- url = attachment['website_url']
- except Exception, e:
- logger.exception("Failed to upload image to attachment")
- message = unicode(e)
+ else:
+ try:
+ image_data = upload.read()
+ image = Image.open(cStringIO.StringIO(image_data))
+ w, h = image.size
+ if w*h > 42e6: # Nokia Lumia 1020 photo resolution
+ raise ValueError(
+ u"Image size excessive, uploaded images must be smaller "
+ u"than 42 million pixel")
+
+ attachment_id = Attachments.create(request.cr, request.uid, {
+ 'name': upload.filename,
+ 'datas': image_data.encode('base64'),
+ 'datas_fname': upload.filename,
+ 'res_model': 'ir.ui.view',
+ }, request.context)
+
+ [attachment] = Attachments.read(
+ request.cr, request.uid, [attachment_id], ['website_url'],
+ context=request.context)
+ website_url = attachment['website_url']
+ except Exception, e:
+ logger.exception("Failed to upload image to attachment")
+ message = unicode(e)
return """<script type='text/javascript'>
window.parent['%s'](%s, %s);
- </script>""" % (func, json.dumps(url), json.dumps(message))
+ </script>""" % (func, json.dumps(website_url), json.dumps(message))
@http.route(['/website/publish'], type='json', auth="public", website=True)
def publish(self, id, object):
@@ -288,8 +298,6 @@ class Website(openerp.addons.web.controllers.main.Home):
values = {}
if 'website_published' in _object._all_columns:
values['website_published'] = not obj.website_published
- if 'website_published_datetime' in _object._all_columns and values.get('website_published'):
- values['website_published_datetime'] = fields.datetime.now()
_object.write(request.cr, request.uid, [_id],
values, context=request.context)
@@ -341,9 +349,10 @@ class Website(openerp.addons.web.controllers.main.Home):
id = int(id)
ids = Model.search(request.cr, request.uid,
- [('id', '=', id)], context=request.context) \
- or Model.search(request.cr, openerp.SUPERUSER_ID,
- [('id', '=', id), ('website_published', '=', True)], context=request.context)
+ [('id', '=', id)], context=request.context)
+ if not ids and 'website_published' in Model._all_columns:
+ ids = Model.search(request.cr, openerp.SUPERUSER_ID,
+ [('id', '=', id), ('website_published', '=', True)], context=request.context)
if not ids:
return self.placeholder(response)
diff --git a/addons/website/models/ir_ui_view.py b/addons/website/models/ir_ui_view.py
index 67781cc02a0..c9fadade6ed 100644
--- a/addons/website/models/ir_ui_view.py
+++ b/addons/website/models/ir_ui_view.py
@@ -123,7 +123,7 @@ class view(osv.osv):
return arch
def render(self, cr, uid, id_or_xml_id, values=None, engine='ir.qweb', context=None):
- if getattr(request, 'website_enabled', False):
+ if request and getattr(request, 'website_enabled', False):
engine='website.qweb'
if isinstance(id_or_xml_id, list):
diff --git a/addons/website/models/website.py b/addons/website/models/website.py
index a516f5cb96f..a0a6d1fb28b 100644
--- a/addons/website/models/website.py
+++ b/addons/website/models/website.py
@@ -638,7 +638,7 @@ class ir_attachment(osv.osv):
# in-document URLs are html-escaped, a straight search will not
# find them
url = werkzeug.utils.escape(attachment.website_url)
- ids = Views.search(cr, uid, [('arch', 'like', url)], context=context)
+ ids = Views.search(cr, uid, ["|", ('arch', 'like', '"%s"' % url), ('arch', 'like', "'%s'" % url)], context=context)
if ids:
removal_blocked_by[attachment.id] = Views.read(
diff --git a/addons/website/static/src/css/editor.css b/addons/website/static/src/css/editor.css
index da0fad43caf..eb4c5b2851c 100644
--- a/addons/website/static/src/css/editor.css
+++ b/addons/website/static/src/css/editor.css
@@ -94,6 +94,10 @@
display: none;
}
+.cke_editable .css_editable_mode_display {
+ display: block !important;
+}
+
.oe_structure.oe_empty:empty, [data-oe-type=html]:empty, .oe_structure.oe_empty > .oe_drop_zone.oe_insert:only-child, [data-oe-type=html] > .oe_drop_zone.oe_insert:only-child {
background-image: url("/website/static/src/img/edit_here.png") !important;
}
@@ -180,7 +184,7 @@ ul.oe_menu_editor .disclose {
cursor: text !important;
}
-.modal-dialog.select-image {
+.modal-dialog.select-media {
width: 80%;
}
@@ -212,7 +216,7 @@ ul.oe_menu_editor .disclose {
.modal .font-icons-icons {
font-size: 2em;
- max-height: 6em;
+ max-height: 9em;
overflow: auto;
}
.modal .font-icons-icons .font-icons-icon {
@@ -271,6 +275,10 @@ ul.oe_menu_editor .disclose {
-webkit-border-bottom-right-radius: 8px;
border-bottom-right-radius: 8px;
}
+.existing-attachments .existing-attachment-cell.media_selected > i, .existing-attachments .existing-attachment-cell.media_selected > img {
+ border-width: 5px;
+ border-color: #00f8f8;
+}
.cke_widget_wrapper {
position: static !important;
@@ -296,17 +304,34 @@ ul.oe_menu_editor .disclose {
background-color: #ffd9dd !important;
}
-.hover-edition-button {
+.hover-edition {
+ display: inline-block;
position: absolute;
top: 0;
left: 0;
- z-index: 1000;
+ z-index: 1001;
+}
+
+.preview-container {
+ text-align: center;
+ line-height: 100px;
+ height: 100px;
+}
+.preview-container > * {
+ max-height: 100px;
+ line-height: 100px;
+ margin: 0 auto;
+ display: inline-block;
}
.cke_editable .fa {
cursor: pointer;
}
+.img-responsive {
+ text-align: center;
+}
+
/* ---- MOBILE PREVIEW ---- {{{ */
.oe_mobile_preview.modal .modal-content {
height: 660px;
diff --git a/addons/website/static/src/css/editor.sass b/addons/website/static/src/css/editor.sass
index 4571dcd257e..fb80fa47277 100644
--- a/addons/website/static/src/css/editor.sass
+++ b/addons/website/static/src/css/editor.sass
@@ -77,6 +77,9 @@
.cke_editable .css_editable_mode_hidden
display: none
+.cke_editable .css_editable_mode_display
+ display: block !important
+
.oe_structure.oe_empty:empty, [data-oe-type=html]:empty, .oe_structure.oe_empty > .oe_drop_zone.oe_insert:only-child, [data-oe-type=html] > .oe_drop_zone.oe_insert:only-child
background-image: url('/website/static/src/img/edit_here.png') !important
@@ -150,7 +153,7 @@ ul.oe_menu_editor
+user-select(auto)
cursor: text !important
-.modal-dialog.select-image
+.modal-dialog.select-media
width: 80%
.modal .existing-attachments
@@ -179,7 +182,7 @@ ul.oe_menu_editor
.modal
.font-icons-icons
font-size: 2em
- max-height: 6em
+ max-height: 9em
overflow: auto
.font-icons-icon
@@ -232,6 +235,10 @@ $attachment-border-color: #848490
border-top: none
border-left: none
+border-bottom-right-radius(8px)
+ &.media_selected
+ > i, > img
+ border-width: 5px
+ border-color: rgb(0, 248, 248)
// wrapper positioned relatively for drag&drop widget which is disabled below.
// Breaks completely horribly crazy products listing page, so take it out.
@@ -259,17 +266,30 @@ $attachment-border-color: #848490
outline: 1px solid red !important
background-color: #ffd9dd !important
-.hover-edition-button
+.hover-edition
+ display: inline-block
position: absolute
top: 0
left: 0
- // This z-index is due to .navbar of bootstrap
- z-index: 1000
+ // This z-index is due to .navbar of bootstrap & jQuery-transfo
+ z-index: 1001
+.preview-container
+ text-align: center
+ line-height: 100px
+ height: 100px
+ > *
+ max-height: 100px
+ line-height: 100px
+ margin: 0 auto
+ display: inline-block
// fontawesome
.cke_editable .fa
cursor: pointer
+.img-responsive
+ text-align: center
+
// }}}
/* ---- MOBILE PREVIEW ---- {{{ */
diff --git a/addons/website/static/src/css/snippets.css b/addons/website/static/src/css/snippets.css
index 726855f311b..cbfca8be131 100644
--- a/addons/website/static/src/css/snippets.css
+++ b/addons/website/static/src/css/snippets.css
@@ -201,6 +201,7 @@
height: 0;
position: absolute;
background: transparent;
+ z-index: 1001;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
-ms-border-radius: 3px;
@@ -325,11 +326,13 @@
top: auto;
left: 50%;
bottom: -6px;
+ margin-left: -50px;
}
.oe_overlay .oe_handle.size .oe_handle_button {
+ position: relative;
z-index: 3;
text-align: center;
- margin-left: -32px;
+ margin-left: -52px;
margin-top: -10px;
left: 0px;
}
@@ -341,15 +344,17 @@
box-shadow: 0 0 5px 3px rgba(255, 255, 255, 0.7);
}
.oe_overlay .oe_handle.size .size {
+ position: absolute;
width: 64px;
cursor: row-resize;
top: 9px;
+ margin-left: 52px;
+ padding: 0 5px;
}
.oe_overlay .oe_handle.size .auto_size {
- width: 20px;
- padding: 0 5px;
- top: 1px;
- margin-left: 36px;
+ position: absolute;
+ width: 100px;
+ top: 9px;
cursor: pointer;
}
.oe_overlay .oe_handle.readonly {
diff --git a/addons/website/static/src/css/snippets.sass b/addons/website/static/src/css/snippets.sass
index 9b12e9df246..40467897e26 100644
--- a/addons/website/static/src/css/snippets.sass
+++ b/addons/website/static/src/css/snippets.sass
@@ -151,6 +151,7 @@
height: 0
position: absolute
background: transparent
+ z-index: 1001
//@include background-image( repeating-linear-gradient(45deg, rgba(255,255,255,.02) ,rgba(255,255,255,.02) 35px, rgba(0,0,0,.02) 35px, rgba(0,0,0,.02) 75px))
+border-radius(3px)
@include transition(opacity 100ms linear)
@@ -238,10 +239,12 @@
top: auto
left: 50%
bottom: -6px
+ margin-left: -50px
.oe_handle_button
+ position: relative
z-index: 3
text-align: center
- margin-left: -32px
+ margin-left: -52px
margin-top: -10px
left: 0px
&:hover
@@ -249,14 +252,16 @@
color: #fff
+box-shadow(0 0 5px 3px rgba(255,255,255,.7))
.size
+ position: absolute
width: 64px
cursor: row-resize
top: 9px
- .auto_size
- width: 20px
+ margin-left: 52px
padding: 0 5px
- top: 1px
- margin-left: 36px
+ .auto_size
+ position: absolute
+ width: 100px
+ top: 9px
cursor: pointer
&.readonly
cursor: auto !important
diff --git a/addons/website/static/src/css/website.css b/addons/website/static/src/css/website.css
index 354796a053e..9339b5e03b9 100644
--- a/addons/website/static/src/css/website.css
+++ b/addons/website/static/src/css/website.css
@@ -1,3 +1,4 @@
+@charset "utf-8";
/* THIS CSS FILE IS FOR WEBSITE THEMING CUSTOMIZATION ONLY
*
* css for editor buttons, openerp widget included in the website and other
@@ -284,10 +285,6 @@ ul.nav-stacked > li > a {
background-size: 100%;
}
-section, .carousel, .parallax, .row, .hr, .blockquote {
- min-height: 30px;
-}
-
.carousel, .parallax, .blockquote {
overflow: hidden;
}
@@ -376,17 +373,33 @@ section, .carousel, .parallax, .row, .hr, .blockquote {
position: absolute;
margin-top: -8px;
}
-.carousel .carousel-control.left span {
- left: 10px;
+.carousel .carousel-control.left {
+ left: -10px;
+}
+.carousel .carousel-control.left * {
+ position: absolute;
+ top: 50%;
+ z-index: 5;
+ right: 50%;
}
-.carousel .carousel-control.right span {
- right: 10px;
+.carousel .carousel-control.right {
+ right: -10px;
+}
+.carousel .carousel-control.right * {
+ position: absolute;
+ top: 50%;
+ z-index: 5;
+ left: 50%;
}
.quotecarousel {
padding-bottom: 16px;
}
+.hr {
+ padding: 4px 0;
+}
+
/* Parallax Theme */
div.carousel .carousel-indicators li {
border: 1px solid grey;
@@ -527,3 +540,33 @@ span[data-oe-type="monetary"] {
width: 400px;
margin: 40px auto;
}
+
+div.media_iframe_video {
+ height: 0;
+ margin: 0 auto;
+ text-align: center;
+ position: relative;
+ overflow: hidden;
+ padding-bottom: 66.5%;
+}
+div.media_iframe_video iframe {
+ width: 100%;
+ height: 100%;
+}
+div.media_iframe_video div {
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ display: none;
+}
+
+/* Mobile view */
+@media (max-width: 768px) {
+ img:not(.cke_iframe), .media_iframe_video, span.fa, i.fa {
+ -webkit-transform: none !important;
+ -moz-transform: none !important;
+ -ms-transform: none !important;
+ -o-transform: none !important;
+ transform: none !important;
+ }
+}
diff --git a/addons/website/static/src/css/website.sass b/addons/website/static/src/css/website.sass
index 77da53c2958..e8a7d870623 100644
--- a/addons/website/static/src/css/website.sass
+++ b/addons/website/static/src/css/website.sass
@@ -234,8 +234,6 @@ ul.nav-stacked > li > a
.oe_img_bg
background-size: 100%
-section, .carousel, .parallax, .row, .hr, .blockquote
- min-height: 30px
.carousel, .parallax, .blockquote
overflow: hidden
@@ -308,14 +306,27 @@ section, .carousel, .parallax, .row, .hr, .blockquote
top: 50%
position: absolute
margin-top: -8px
- &.left span
- left: 10px
- &.right span
- right: 10px
+ &.left
+ left: -10px
+ *
+ position: absolute
+ top: 50%
+ z-index: 5
+ right: 50%
+ &.right
+ right: -10px
+ *
+ position: absolute
+ top: 50%
+ z-index: 5
+ left: 50%
.quotecarousel
padding-bottom: 16px
+.hr
+ padding: 4px 0
+
/* Parallax Theme */
div.carousel
@@ -434,3 +445,28 @@ span[data-oe-type="monetary"]
overflow:hidden
text-overflow:ellipsis
+div.media_iframe_video
+ height: 0
+ margin: 0 auto
+ text-align: center
+ position: relative
+ overflow: hidden
+ padding-bottom: 66.5%
+ iframe
+ width: 100%
+ height: 100%
+ div
+ position: absolute
+ width: 100%
+ height: 100%
+ display: none
+
+/* Mobile view */
+
+@media (max-width: 768px)
+ img:not(.cke_iframe), .media_iframe_video, span.fa, i.fa
+ -webkit-transform: none !important
+ -moz-transform: none !important
+ -ms-transform: none !important
+ -o-transform: none !important
+ transform: none !important
diff --git a/addons/website/static/src/js/jQuery.transfo.js b/addons/website/static/src/js/jQuery.transfo.js
new file mode 100644
index 00000000000..725e5a02216
--- /dev/null
+++ b/addons/website/static/src/js/jQuery.transfo.js
@@ -0,0 +1,433 @@
+/*
+Copyright (c) 2014 Christophe Matthieu,
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+(function($){
+ 'use strict';
+ var rad = Math.PI/180;
+
+ // public methods
+ var methods = {
+ init : function(settings) {
+ return this.each(function() {
+ var $this = $(this), transfo = $this.data('transfo');
+ if (!transfo) {
+ _init($this, settings);
+ } else {
+ _overwriteOptions($this, transfo, settings);
+ _targetCss($this, transfo);
+ }
+ });
+ },
+
+ destroy : function() {
+ return this.each(function() {
+ var $this = $(this);
+ if ($this.data('transfo')) {
+ _destroy($this);
+ }
+ });
+ },
+
+ reset : function() {
+ return this.each(function() {
+ var $this = $(this);
+ if ($this.data('transfo')) {
+ _reset($this);
+ }
+ });
+ },
+
+ toggle : function() {
+ return this.each(function() {
+ var $this = $(this);
+ var transfo = $this.data('transfo');
+ if (transfo) {
+ transfo.settings.hide = !transfo.settings.hide;
+ _showHide($this, transfo);
+ }
+ });
+ },
+
+ hide : function() {
+ return this.each(function() {
+ var $this = $(this);
+ var transfo = $this.data('transfo');
+ if (transfo) {
+ transfo.settings.hide = true;
+ _showHide($this, transfo);
+ }
+ });
+ },
+
+ show : function() {
+ return this.each(function() {
+ var $this = $(this);
+ var transfo = $this.data('transfo');
+ if (transfo) {
+ transfo.settings.hide = false;
+ _showHide($this, transfo);
+ }
+ });
+ },
+
+ settings : function() {
+ if(this.length > 1) {
+ this.map(function () {
+ var $this = $(this);
+ return $this.data('transfo') && $this.data('transfo').settings;
+ });
+ }
+ return this.data('transfo') && $this.data('transfo').settings;
+ },
+ center : function() {
+ if(this.length > 1) {
+ this.map(function () {
+ var $this = $(this);
+ return $this.data('transfo') && $this.data('transfo').$center.offset();
+ });
+ }
+ return this.data('transfo') && this.data('transfo').$center.offset();
+ }
+ };
+
+ $.fn.transfo = function( method ) {
+ if ( methods[method] ) {
+ return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 ));
+ } else if ( typeof method === 'object' || ! method ) {
+ return methods.init.apply( this, arguments );
+ } else {
+ $.error( 'Method ' + method + ' does not exist on jQuery.transfo' );
+ }
+ return false;
+ };
+
+ function _init ($this, settings) {
+ var transfo = {};
+ $this.data('transfo', transfo);
+ transfo.settings = settings;
+
+ // generate all the controls markup
+ var css = "box-sizing: border-box; position: absolute; background-color: #fff; border: 1px solid #ccc; width: 8px; height: 8px; margin-left: -4px; margin-top: -4px;";
+ transfo.$markup = $(''
+ + '<div class="transfo-controls">'
+ + '<div style="cursor: crosshair; position: absolute; margin: -30px; top: 0; right: 0; padding: 1px 0 0 1px;" class="transfo-rotator">'
+ + '<span class="fa-stack fa-lg">'
+ + '<i class="fa fa-circle fa-stack-2x"></i>'
+ + '<i class="fa fa-repeat fa-stack-1x fa-inverse"></i>'
+ + '</span>'
+ + '</div>'
+ + '<div style="' + css + 'top: 0%; left: 0%; cursor: nw-resize;" class="transfo-scaler-tl"></div>'
+ + '<div style="' + css + 'top: 0%; left: 100%; cursor: ne-resize;" class="transfo-scaler-tr"></div>'
+ + '<div style="' + css + 'top: 100%; left: 100%; cursor: se-resize;" class="transfo-scaler-br"></div>'
+ + '<div style="' + css + 'top: 100%; left: 0%; cursor: sw-resize;" class="transfo-scaler-bl"></div>'
+ + '<div style="' + css + 'top: 0%; left: 50%; cursor: n-resize;" class="transfo-scaler-tc"></div>'
+ + '<div style="' + css + 'top: 100%; left: 50%; cursor: s-resize;" class="transfo-scaler-bc"></div>'
+ + '<div style="' + css + 'top: 50%; left: 0%; cursor: w-resize;" class="transfo-scaler-ml"></div>'
+ + '<div style="' + css + 'top: 50%; left: 100%; cursor: e-resize;" class="transfo-scaler-mr"></div>'
+ + '<div style="' + css + 'border: 0; width: 0px; height: 0px; top: 50%; left: 50%;" class="transfo-scaler-mc"></div>'
+ + '</div>');
+ transfo.$center = transfo.$markup.find(".transfo-scaler-mc");
+
+ // init setting and get css to set wrap
+ _setOptions($this, transfo);
+ _overwriteOptions ($this, transfo, settings);
+
+ // append controls to container
+ $("body").append(transfo.$markup);
+
+ // set transfo container and markup
+ setTimeout(function () {
+ _targetCss($this, transfo);
+ },0);
+
+ _bind($this, transfo);
+
+ _targetCss($this, transfo);
+ }
+
+ function _overwriteOptions ($this, transfo, settings) {
+ transfo.settings = $.extend(transfo.settings, settings || {});
+ }
+
+ function _setOptions ($this, transfo) {
+ var style = $this.attr("style") || "";
+ var transform = style.match(/transform\s*:([^;]+)/) ? style.match(/transform\s*:([^;]+)/)[1] : "";
+
+ transfo.settings = {};
+
+ transfo.settings.angle= transform.indexOf('rotate') != -1 ? parseFloat(transform.match(/rotate\(([^)]+)deg\)/)[1]) : 0;
+ transfo.settings.scalex= transform.indexOf('scaleX') != -1 ? parseFloat(transform.match(/scaleX\(([^)]+)\)/)[1]) : 1;
+ transfo.settings.scaley= transform.indexOf('scaleY') != -1 ? parseFloat(transform.match(/scaleY\(([^)]+)\)/)[1]) : 1;
+
+ transfo.settings.style = style.replace(/[^;]*transform[^;]+/g, '').replace(/;+/g, ';');
+ $this.attr("style", transfo.settings.style);
+
+ transfo.settings.height = $this.innerHeight();
+ transfo.settings.width = $this.innerWidth();
+
+ var translatex = transform.match(/translateX\(([0-9.-]+)(%|px)\)/);
+ var translatey = transform.match(/translateY\(([0-9.-]+)(%|px)\)/);
+ transfo.settings.translate = "%";
+
+ if (translatex && translatex[2] === "%") {
+ transfo.settings.translatexp = parseFloat(translatex[1]);
+ transfo.settings.translatex = transfo.settings.translatexp / 100 * transfo.settings.width;
+ } else {
+ transfo.settings.translatex = translatex ? parseFloat(translatex[1]) : 0;
+ }
+ if (translatey && translatey[2] === "%") {
+ transfo.settings.translateyp = parseFloat(translatey[1]);
+ transfo.settings.translatey = transfo.settings.translateyp / 100 * transfo.settings.height;
+ } else {
+ transfo.settings.translatey = translatey ? parseFloat(translatey[1]) : 0;
+ }
+
+ transfo.settings.css = window.getComputedStyle($this[0], null);
+ transfo.settings.pos = $this.offset();
+
+ transfo.settings.rotationStep = 5;
+ transfo.settings.hide = false;
+ transfo.settings.callback = function () {};
+ }
+
+ function _bind ($this, transfo) {
+ function mousedown (event) {
+ _mouseDown($this, this, transfo, event);
+ $(document).on("mousemove", mousemove).on("mouseup", mouseup);
+ }
+ function mousemove (event) {
+ _mouseMove($this, this, transfo, event);
+ }
+ function mouseup (event) {
+ _mouseUp($this, this, transfo, event);
+ $(document).off("mousemove", mousemove).off("mouseup", mouseup);
+ }
+
+ transfo.$markup.off().on("mousedown", mousedown);
+ transfo.$markup.find(">:not(.transfo-scaler-mc)").off().on("mousedown", mousedown);
+ }
+
+ function _mouseDown($this, div, transfo, event) {
+ event.preventDefault();
+ if (transfo.active || event.which !== 1) return;
+
+ var type = "position", $e = $(div);
+ if ($e.hasClass("transfo-rotator")) type = "rotator";
+ else if ($e.hasClass("transfo-scaler-tl")) type = "tl";
+ else if ($e.hasClass("transfo-scaler-tr")) type = "tr";
+ else if ($e.hasClass("transfo-scaler-br")) type = "br";
+ else if ($e.hasClass("transfo-scaler-bl")) type = "bl";
+ else if ($e.hasClass("transfo-scaler-tc")) type = "tc";
+ else if ($e.hasClass("transfo-scaler-bc")) type = "bc";
+ else if ($e.hasClass("transfo-scaler-ml")) type = "ml";
+ else if ($e.hasClass("transfo-scaler-mr")) type = "mr";
+
+ transfo.active = {
+ "type": type,
+ "scalex": transfo.settings.scalex,
+ "scaley": transfo.settings.scaley,
+ "pageX": event.pageX,
+ "pageY": event.pageY,
+ "center": transfo.$center.offset(),
+ };
+ }
+ function _mouseUp($this, div, transfo, event) {
+ transfo.active = null;
+ }
+
+ function _mouseMove($this, div, transfo, event) {
+ event.preventDefault();
+ if (!transfo.active) return;
+ var settings = transfo.settings;
+ var center = transfo.active.center;
+ var cdx = center.left - event.pageX;
+ var cdy = center.top - event.pageY;
+
+ if (transfo.active.type == "rotator") {
+ var ang, dang = Math.atan((settings.width * settings.scalex) / (settings.height * settings.scaley)) / rad;
+
+ if (cdy) ang = Math.atan(- cdx / cdy) / rad;
+ else ang = 0;
+ if (event.pageY >= center.top && event.pageX >= center.left) ang += 180;
+ else if (event.pageY >= center.top && event.pageX < center.left) ang += 180;
+ else if (event.pageY < center.top && event.pageX < center.left) ang += 360;
+
+ ang -= dang;
+ if (settings.scaley < 0 && settings.scalex < 0) ang += 180;
+
+ if (!event.ctrlKey) {
+ settings.angle = Math.round(ang / transfo.settings.rotationStep) * transfo.settings.rotationStep;
+ } else {
+ settings.angle = ang;
+ }
+
+ // reset position : don't move center
+ _targetCss($this, transfo);
+ var new_center = transfo.$center.offset();
+ var x = center.left - new_center.left;
+ var y = center.top - new_center.top;
+ var angle = ang * rad;
+ settings.translatex += x*Math.cos(angle) - y*Math.sin(-angle);
+ settings.translatey += - x*Math.sin(angle) + y*Math.cos(-angle);
+ }
+ else if (transfo.active.type == "position") {
+ var angle = settings.angle * rad;
+ var x = event.pageX - transfo.active.pageX;
+ var y = event.pageY - transfo.active.pageY;
+ transfo.active.pageX = event.pageX;
+ transfo.active.pageY = event.pageY;
+ var dx = x*Math.cos(angle) - y*Math.sin(-angle);
+ var dy = - x*Math.sin(angle) + y*Math.cos(-angle);
+
+ settings.translatex += dx;
+ settings.translatey += dy;
+ }
+ else if (transfo.active.type.length === 2) {
+ var angle = settings.angle * rad;
+ var dx = cdx*Math.cos(angle) - cdy*Math.sin(-angle);
+ var dy = - cdx*Math.sin(angle) + cdy*Math.cos(-angle);
+ if (transfo.active.type.indexOf("t") != -1) {
+ settings.scaley = dy / (settings.height/2);
+ }
+ if (transfo.active.type.indexOf("b") != -1) {
+ settings.scaley = - dy / (settings.height/2);
+ }
+ if (transfo.active.type.indexOf("l") != -1) {
+ settings.scalex = dx / (settings.width/2);
+ }
+ if (transfo.active.type.indexOf("r") != -1) {
+ settings.scalex = - dx / (settings.width/2);
+ }
+ if (settings.scaley > 0 && settings.scaley < 0.05) settings.scaley = 0.05;
+ if (settings.scalex > 0 && settings.scalex < 0.05) settings.scalex = 0.05;
+ if (settings.scaley < 0 && settings.scaley > -0.05) settings.scaley = -0.05;
+ if (settings.scalex < 0 && settings.scalex > -0.05) settings.scalex = -0.05;
+
+ if (event.shiftKey &&
+ (transfo.active.type === "tl" || transfo.active.type === "bl" ||
+ transfo.active.type === "tr" || transfo.active.type === "br")) {
+ settings.scaley = settings.scalex;
+ }
+ }
+
+ settings.angle = Math.round(settings.angle);
+ settings.translatex = Math.round(settings.translatex);
+ settings.translatey = Math.round(settings.translatey);
+ settings.scalex = Math.round(settings.scalex*100)/100;
+ settings.scaley = Math.round(settings.scaley*100)/100;
+
+ _targetCss($this, transfo);
+ return false;
+ }
+
+ function _setCss($this, css, settings) {
+ var transform = "";
+ var trans = false;
+ if (settings.angle !== 0) {
+ trans = true;
+ transform += " rotate("+settings.angle+"deg) ";
+ }
+ if (settings.translatex) {
+ trans = true;
+ transform += " translateX("+(settings.translate === "%" ? settings.translatexp+"%" : settings.translatex+"px")+") ";
+ }
+ if (settings.translatey) {
+ trans = true;
+ transform += " translateY("+(settings.translate === "%" ? settings.translateyp+"%" : settings.translatey+"px")+") ";
+ }
+ if (settings.scalex != 1) {
+ trans = true;
+ transform += " scaleX("+settings.scalex+") ";
+ }
+ if (settings.scaley != 1){
+ trans = true;
+ transform += " scaleY("+settings.scaley+") ";
+ }
+
+ if (trans) {
+ css += ";"
+ /* Safari */
+ css += "-webkit-transform:" + transform + ";"
+ /* Firefox */
+ + "-moz-transform:" + transform + ";"
+ /* IE */
+ + "-ms-transform:" + transform + ";"
+ /* Opera */
+ + "-o-transform:" + transform + ";"
+ /* Other */
+ + "transform:" + transform + ";";
+ }
+
+ css = css.replace(/(\s*;)+/g, ';').replace(/^\s*;|;\s*$/g, '');
+
+ $this.attr("style", css);
+ }
+
+ function _targetCss ($this, transfo) {
+ var settings = transfo.settings;
+ var width = parseFloat(settings.css.width);
+ var height = parseFloat(settings.css.height);
+ settings.translatexp = Math.round(settings.translatex/width*1000)/10;
+ settings.translateyp = Math.round(settings.translatey/height*1000)/10;
+
+ _setCss($this, settings.style, settings);
+
+ _setCss(transfo.$markup,
+ "position: absolute;" +
+ "top:" + settings.pos.top + "px;" +
+ "left:" + settings.pos.left + "px;" +
+ "width:" + width + "px;" +
+ "height:" + height + "px;" +
+ "cursor: move;",
+ settings);
+ transfo.$markup.find(">").css("transform", "scaleX("+(1/settings.scalex)+") scaleY("+(1/settings.scaley)+")");
+
+ _showHide($this, transfo);
+
+ transfo.settings.callback.call($this[0], $this);
+ }
+
+ function _showHide ($this, transfo) {
+ transfo.$markup.css("z-index", transfo.settings.hide ? -1 : 1000);
+ if (transfo.settings.hide) {
+ transfo.$markup.find(">").hide();
+ transfo.$markup.find(".transfo-scaler-mc").show();
+ } else {
+ transfo.$markup.find(">").show();
+ }
+ }
+
+ function _destroy ($this) {
+ $this.data('transfo').$markup.remove();
+ $this.removeData('transfo');
+ }
+
+ function _reset ($this) {
+ var transfo = $this.data('transfo');
+ _destroy($this);
+ $this.transfo(transfo.settings);
+ }
+
+})(jQuery);
diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js
index c965c5ef834..365b8cf46ea 100644
--- a/addons/website/static/src/js/website.editor.js
+++ b/addons/website/static/src/js/website.editor.js
@@ -64,7 +64,7 @@
return new website.editor.RTELinkDialog(editor).appendTo(document.body);
}
function image_dialog(editor, image) {
- return new website.editor.RTEImageDialog(editor, image).appendTo(document.body);
+ return new website.editor.MediaDialog(editor, image).appendTo(document.body);
}
// only enable editors manually
@@ -80,14 +80,19 @@
website.init_editor = function () {
CKEDITOR.plugins.add('customdialogs', {
-// requires: 'link,image',
+ // requires: 'link,image',
init: function (editor) {
editor.on('doubleclick', function (evt) {
var element = evt.data.element;
- if (element.is('img') && is_editable_node(element)) {
+ if ((element.is('img') || element.$.className.indexOf(' fa-') != -1) && is_editable_node(element)) {
image_dialog(editor, element);
return;
}
+ var parent = new CKEDITOR.dom.element(element.$.parentNode);
+ if (parent.$.className.indexOf('media_iframe_video') != -1 && is_editable_node(parent)) {
+ image_dialog(editor, parent);
+ return;
+ }
element = get_selected_link(editor) || evt.data.element;
if (!(element.is('a') && is_editable_node(element))) {
@@ -109,7 +114,7 @@
context: 'a',
});
//noinspection JSValidateTypes
- editor.addCommand('image', {
+ editor.addCommand('cimage', {
exec: function (editor) {
image_dialog(editor);
return true;
@@ -126,7 +131,7 @@
});
editor.ui.addButton('Image', {
label: 'Image',
- command: 'image',
+ command: 'cimage',
toolbar: 'insert,10',
});
@@ -400,7 +405,7 @@
init: function () {
this.on('edit', function () {
- new website.editor.FontIconsDialog(editor, this.element.$)
+ new website.editor.MediaDialog(editor, this.element)
.appendTo(document.body);
});
},
@@ -629,22 +634,48 @@
},
/**
- * Creates a "hover" button for image and link edition
+ * Creates a "hover" button for link edition
*
- * @param {String} label the button's label
* @param {Function} editfn edition function, called when clicking the button
- * @param {String} [classes] additional classes to set on the button
* @returns {jQuery}
*/
- make_hover_button: function (label, editfn, classes) {
- return $(openerp.qweb.render('website.editor.hoverbutton', {
- label: label,
- classes: classes,
- })).hide().appendTo(document.body).click(function (e) {
+ make_hover_button_link: function (editfn) {
+ return $(openerp.qweb.render('website.editor.hoverbutton.link', {}))
+ .hide()
+ .click(function (e) {
+ e.preventDefault();
+ e.stopPropagation();
+ editfn.call(this, e);
+ })
+ .appendTo(document.body);
+ },
+
+ /**
+ * Creates a "hover" button for image
+ *
+ * @param {Function} editfn edition function, called when clicking the button
+ * @param {Function} stylefn edition style function, called when clicking the button
+ * @returns {jQuery}
+ */
+ make_hover_button_image: function (editfn, stylefn) {
+ var $div = $(openerp.qweb.render('website.editor.hoverbutton.media', {}))
+ .hide()
+ .appendTo(document.body);
+
+ $div.find('[data-toggle="dropdown"]').dropdown();
+ $div.find(".hover-edition-button").click(function (e) {
e.preventDefault();
e.stopPropagation();
editfn.call(this, e);
});
+ if (stylefn) {
+ $div.find(".hover-style-button").click(function (e) {
+ e.preventDefault();
+ e.stopPropagation();
+ stylefn.call(this, e);
+ });
+ }
+ return $div;
},
/**
* For UI clarity, during RTE edition when the user hovers links and
@@ -653,23 +684,18 @@
*/
setup_hover_buttons: function () {
var editor = this.rte.editor;
- var $link_button = this.make_hover_button(_t("Change"), function () {
+ var $link_button = this.make_hover_button_link(function () {
var sel = new CKEDITOR.dom.element(previous);
editor.getSelection().selectElement(sel);
if(sel.hasClass('fa')) {
- new website.editor.FontIconsDialog(editor, previous)
+ new website.editor.MediaDialog(editor, previous)
.appendTo(document.body);
} else if (previous.tagName.toUpperCase() === 'A') {
link_dialog(editor);
}
$link_button.hide();
previous = null;
- }, 'btn-xs');
- var $image_button = this.make_hover_button(_t("Change"), function () {
- image_dialog(editor, new CKEDITOR.dom.element(previous));
- $image_button.hide();
- previous = null;
- }, 'btn-sm');
+ });
function is_icons_widget(element) {
var w = editor.widgets.getByElement(element);
@@ -681,7 +707,7 @@
// -ish, because when moving to the button itself ``previous`` is
// still set to the element having triggered showing the button.
var previous;
- $(editor.element.$).on('mouseover', 'a, img, .fa', function () {
+ $(editor.element.$).on('mouseover', 'a', function () {
// Back from edit button -> ignore
if (previous && previous === this) { return; }
@@ -700,34 +726,19 @@
previous = this;
var $selected = $(this);
var position = $selected.offset();
- if ($selected.is('img')) {
- $link_button.hide();
- // center button on image
- $image_button.show().offset({
- top: $selected.outerHeight() / 2
- + position.top
- - $image_button.outerHeight() / 2,
- left: $selected.outerWidth() / 2
- + position.left
- - $image_button.outerWidth() / 2,
- });
- } else {
- $image_button.hide();
- // put button below link, horizontally centered
- $link_button.show().offset({
- top: $selected.outerHeight()
- + position.top,
- left: $selected.outerWidth() / 2
- + position.left
- - $link_button.outerWidth() / 2
- })
- }
+ $link_button.show().offset({
+ top: $selected.outerHeight()
+ + position.top,
+ left: $selected.outerWidth() / 2
+ + position.left
+ - $link_button.outerWidth() / 2
+ })
}).on('mouseleave', 'a, img, .fa', function (e) {
var current = document.elementFromPoint(e.clientX, e.clientY);
- if (current === $link_button[0] || current === $image_button[0]) {
+ if (current === $link_button[0] || $(current).parent()[0] === $link_button[0]) {
return;
}
- $image_button.add($link_button).hide();
+ $link_button.hide();
previous = null;
});
}
@@ -1041,6 +1052,7 @@
},
save: function () {
this.close();
+ this.trigger("saved");
},
cancel: function () {
},
@@ -1290,6 +1302,128 @@
},
});
+ website.editor.Media = openerp.Widget.extend({
+ init: function (parent, editor, media) {
+ this._super();
+ this.parent = parent;
+ this.editor = editor;
+ this.media = media;
+ },
+ start: function () {
+ this.$preview = this.$('.preview-container').detach();
+ return this._super();
+ },
+ search: function (needle) {
+ },
+ save: function () {
+ },
+ clear: function () {
+ },
+ cancel: function () {
+ },
+ close: function () {
+ },
+ });
+ website.editor.MediaDialog = website.editor.Dialog.extend({
+ template: 'website.editor.dialog.media',
+ events : _.extend({}, website.editor.Dialog.prototype.events, {
+ 'input input#icon-search': 'search',
+ }),
+
+ init: function (editor, media) {
+ this._super(editor);
+ this.editor = editor;
+ this.page = 0;
+ this.media = media;
+ },
+ start: function () {
+ var self = this;
+
+ this.imageDialog = new website.editor.RTEImageDialog(this, this.editor, this.media);
+ this.imageDialog.appendTo(this.$("#editor-media-image"));
+ this.iconDialog = new website.editor.FontIconsDialog(this, this.editor, this.media);
+ this.iconDialog.appendTo(this.$("#editor-media-icon"));
+ this.videoDialog = new website.editor.VideoDialog(this, this.editor, this.media);
+ this.videoDialog.appendTo(this.$("#editor-media-video"));
+
+ this.active = this.imageDialog;
+
+ $('a[data-toggle="tab"]').on('shown.bs.tab', function (event) {
+ if ($(event.target).is('[href="#editor-media-image"]')) {
+ self.active = self.imageDialog;
+ self.$('li.search, li.previous, li.next').removeClass("hidden");
+ } else if ($(event.target).is('[href="#editor-media-icon"]')) {
+ self.active = self.iconDialog;
+ self.$('li.search, li.previous, li.next').removeClass("hidden");
+ self.$('.nav-tabs li.previous, .nav-tabs li.next').addClass("hidden");
+ } else if ($(event.target).is('[href="#editor-media-video"]')) {
+ self.active = self.videoDialog;
+ self.$('.nav-tabs li.search').addClass("hidden");
+ }
+ });
+
+ if (this.media) {
+ if (this.media.$.nodeName === "IMG") {
+ this.$('[href="#editor-media-image"]').tab('show');
+ } else if (this.media.$.className.match(/(^|\s)media_iframe_video($|\s)/)) {
+ this.$('[href="#editor-media-video"]').tab('show');
+ } else if (this.media.$.className.match(/(^|\s)fa($|\s)/)) {
+ this.$('[href="#editor-media-icon"]').tab('show');
+ }
+
+ if ($(this.media.$).parent().data("oe-field") === "image") {
+ this.$('[href="#editor-media-video"], [href="#editor-media-icon"]').addClass('hidden');
+ }
+ }
+
+ return this._super();
+ },
+ save: function () {
+ var self = this;
+ if (self.media) {
+ this.media.$.innerHTML = "";
+ if (this.active !== this.imageDialog) {
+ this.imageDialog.clear();
+ }
+ if (this.active !== this.iconDialog) {
+ this.iconDialog.clear();
+ }
+ if (this.active !== this.videoDialog) {
+ this.videoDialog.clear();
+ }
+ } else {
+ var selection = this.editor.getSelection();
+ var range = selection.getRanges(true)[0];
+ this.media = new CKEDITOR.dom.element("img");
+ range.insertNode(this.media);
+ range.selectNodeContents(this.media);
+ this.active.media = this.media;
+ }
+
+ var $el = $(self.active.media.$);
+
+ this.active.save();
+
+ this.media.$.className = this.media.$.className.replace(/\s+/g, ' ');
+
+ setTimeout(function () {
+ $el.trigger("saved", self.active.media.$);
+ $(document.body).trigger("media-saved", [$el[0], self.active.media.$]);
+ },0);
+
+ this._super();
+ },
+ searchTimer: null,
+ search: function () {
+ var self = this;
+ var needle = this.$("input#icon-search").val();
+ clearTimeout(this.searchTimer);
+ this.searchTimer = setTimeout(function () {
+ self.active.search(needle || "");
+ },250);
+ }
+ });
+
/**
* ImageDialog widget. Lets users change an image, including uploading a
* new image in OpenERP or selecting the image style (if supported by
@@ -1307,73 +1441,118 @@
* selected by the users (or possibly the ones
* originally passed in)
*/
- website.editor.ImageDialog = website.editor.Dialog.extend({
+ var IMAGES_PER_ROW = 6;
+ var IMAGES_ROWS = 2;
+ website.editor.ImageDialog = website.editor.Media.extend({
template: 'website.editor.dialog.image',
events: _.extend({}, website.editor.Dialog.prototype.events, {
- 'change .url-source': function (e) { this.changed($(e.target)); },
+ 'change .url-source': function (e) {
+ this.changed($(e.target));
+ },
'click button.filepicker': function () {
this.$('input[type=file]').click();
},
'change input[type=file]': 'file_selection',
- 'change input.url': 'preview_image',
- 'click a[href=#existing]': 'browse_existing',
- 'change select.image-style': 'preview_image',
+ 'submit form': 'form_submit',
+ 'change input.url': "change_input",
+ 'keyup input.url': "change_input",
+ //'change select.image-style': 'preview_image',
+ 'click .existing-attachments img': 'select_existing',
+ 'click .existing-attachment-remove': 'try_remove',
}),
+ init: function (parent, editor, media) {
+ this.page = 0;
+ this._super(parent, editor, media);
+ },
start: function () {
- this.$('button.wait').text("Uploading…");
- var $options = this.$('.image-style').children();
- this.image_styles = $options.map(function () { return this.value; }).get();
+ var self = this;
+ var res = this._super();
- var o = { url: null, style: null, };
+ var o = { url: null };
// avoid typos, prevent addition of new properties to the object
Object.preventExtensions(o);
this.trigger('start', o);
- if (o.url) {
- if (o.style) {
- this.$('.image-style').val(o.style);
+ this.parent.$(".pager > li").click(function (e) {
+ e.preventDefault();
+ var $target = $(e.currentTarget);
+ if ($target.hasClass('disabled')) {
+ return;
}
- this.set_image(o.url);
- }
+ self.page += $target.hasClass('previous') ? -1 : 1;
+ self.display_attachments();
+ });
- return this._super();
+ this.set_image(o.url);
+
+ return res;
},
save: function () {
+ if (!this.link) {
+ this.link = this.$(".existing-attachments img:first").attr('src');
+ }
this.trigger('save', {
- url: this.$('input.url').val(),
- style: this.$('.image-style').val(),
+ url: this.link
});
+ this.media.renameNode("img");
+ this.media.$.attributes.src = this.link;
return this._super();
},
+ clear: function () {
+ this.media.$.className = this.media.$.className.replace(/(^|\s)(img(\s|$)|img-[^\s]*)/g, ' ');
+ },
cancel: function () {
this.trigger('cancel');
},
- /**
- * Sets the provided image url as the dialog's value-to-save and
- * refreshes the preview element to use it.
- */
- set_image: function (url, error) {
- this.$('input.url').val(
- error ? '' : url);
- this.$('input.url').val(url);
- this.preview_image();
+ change_input: function (e) {
+ var $input = $(e.target);
+ var $button = $input.parent().find("button");
+ if ($input.val() === "") {
+ $button.addClass("btn-default").removeClass("btn-primary");
+ } else {
+ $button.removeClass("btn-default").addClass("btn-primary");
+ }
},
- file_selection: function () {
- this.$el.addClass('nosave');
- this.$('form').removeClass('has-error').find('.help-block').empty();
- this.$('button.filepicker').removeClass('btn-danger btn-success');
+ search: function (needle) {
+ var self = this;
+ this.fetch_existing(needle).then(function () {
+ self.selected_existing(self.$('input.url').val());
+ });
+ },
+
+ set_image: function (url, error) {
+ var self = this;
+ if (url) this.link = url;
+ this.$('input.url').val('');
+ this.fetch_existing().then(function () {
+ self.selected_existing(url);
+ });
+ },
+ form_submit: function (event) {
var self = this;
+ var $form = this.$('form[action="/website/attach"]');
+ if (!$form.find('input[name="upload"]').val().length) {
+ var url = $form.find('input[name="url"]').val();
+ if (this.selected_existing(url).size()) {
+ event.preventDefault();
+ return false;
+ }
+ }
var callback = _.uniqueId('func_');
this.$('input[name=func]').val(callback);
-
window[callback] = function (url, error) {
delete window[callback];
self.file_selected(url, error);
};
+ },
+ file_selection: function () {
+ this.$el.addClass('nosave');
+ this.$('form').removeClass('has-error').find('.help-block').empty();
+ this.$('button.filepicker').removeClass('btn-danger btn-success');
this.$('form').submit();
},
file_selected: function(url, error) {
@@ -1387,125 +1566,27 @@
$button.addClass('btn-danger');
}
this.set_image(url, error);
+ // auto save and close popup
+ this.parent.save();
},
- preview_image: function () {
- var loaded = function () {
- this.$el.removeClass('nosave');
- }.bind(this);
- var image = this.$('input.url').val();
- if (!image) { loaded(); return; }
-
- var $img = this.$('img.image-preview')
- .attr('src', image)
- .removeClass(this.image_styles.join(' '))
- .addClass(this.$('select.image-style').val());
- if ($img.prop('complete')) {
- loaded();
- } else {
- $img.load(loaded)
+ fetch_existing: function (needle) {
+ var domain = [['res_model', '=', 'ir.ui.view'], '|',
+ ['mimetype', '=', false], ['mimetype', '=like', 'image/%']];
+ if (needle && needle.length) {
+ domain.push('|', ['datas_fname', 'ilike', needle], ['name', 'ilike', needle]);
}
- },
- browse_existing: function (e) {
- e.preventDefault();
- this.$('form').removeClass('has-error').find('.help-block').empty();
- this.$('button.filepicker').removeClass('btn-danger btn-success');
- new website.editor.ExistingImageDialog(this).appendTo(document.body);
- },
- });
- website.editor.RTEImageDialog = website.editor.ImageDialog.extend({
- init: function (editor, image) {
- this._super(editor);
-
- this.element = image;
-
- this.on('start', this, this.proxy('started'));
- this.on('save', this, this.proxy('saved'));
- },
- started: function (holder) {
- if (!this.element) {
- var selection = this.editor.getSelection();
- this.element = selection && selection.getSelectedElement();
- }
-
- var el = this.element;
- if (!el || !el.is('img')) {
- return;
- }
- _(this.image_styles).each(function (style) {
- if (el.hasClass(style)) {
- holder.style = style;
- }
- });
- holder.url = el.getAttribute('src');
- },
- saved: function (data) {
- var element, editor = this.editor;
- if (!(element = this.element)) {
- element = editor.document.createElement('img');
- element.addClass('img');
- element.addClass('img-responsive');
- // focus event handler interactions between bootstrap (modal)
- // and ckeditor (RTE) lead to blowing the stack in Safari and
- // Chrome (but not FF) when this is done synchronously =>
- // defer insertion so modal has been hidden & destroyed before
- // it happens
- setTimeout(function () {
- editor.insertElement(element);
- }, 0);
- }
-
- var style = data.style;
- element.setAttribute('src', data.url);
- element.removeAttribute('data-cke-saved-src');
- $(element.$).removeClass(this.image_styles.join(' '));
- if (style) { element.addClass(style); }
- },
- });
-
- var IMAGES_PER_ROW = 6;
- var IMAGES_ROWS = 4;
- website.editor.ExistingImageDialog = website.editor.Dialog.extend({
- template: 'website.editor.dialog.image.existing',
- events: _.extend({}, website.editor.Dialog.prototype.events, {
- 'click .existing-attachments img': 'select_existing',
- 'click .pager > li': function (e) {
- e.preventDefault();
- var $target = $(e.currentTarget);
- if ($target.hasClass('disabled')) {
- return;
- }
- this.page += $target.hasClass('previous') ? -1 : 1;
- this.display_attachments();
- },
- 'click .existing-attachment-remove': 'try_remove',
- }),
- init: function (parent) {
- this.image = null;
- this.page = 0;
- this.parent = parent;
- this._super(parent.editor);
- },
-
- start: function () {
- return $.when(
- this._super(),
- this.fetch_existing().then(this.proxy('fetched_existing')));
- },
-
- fetch_existing: function () {
return openerp.jsonRpc('/web/dataset/call_kw', 'call', {
model: 'ir.attachment',
method: 'search_read',
args: [],
kwargs: {
fields: ['name', 'website_url'],
- domain: [['res_model', '=', 'ir.ui.view'], '|',
- ['mimetype', '=', false], ['mimetype', '=like', 'image/%']],
+ domain: domain,
order: 'id desc',
context: website.get_context(),
}
- });
+ }).then(this.proxy('fetched_existing'));
},
fetched_existing: function (records) {
this.records = records;
@@ -1528,24 +1609,33 @@
this.$('.existing-attachments').replaceWith(
openerp.qweb.render(
'website.editor.dialog.image.existing.content', {rows: rows}));
- this.$('.pager')
+ this.parent.$('.pager')
.find('li.previous').toggleClass('disabled', (from === 0)).end()
.find('li.next').toggleClass('disabled', (from + per_screen >= records.length));
-
},
select_existing: function (e) {
var link = $(e.currentTarget).attr('src');
- if (link) {
- this.parent.set_image(link);
- }
- this.close()
+ this.link = link;
+ this.selected_existing(link);
+ },
+ selected_existing: function (link) {
+ this.$('.existing-attachment-cell.media_selected').removeClass("media_selected");
+ var $select = this.$('.existing-attachment-cell img').filter(function () {
+ return $(this).attr("src") == link;
+ }).first();
+ $select.parent().addClass("media_selected");
+ return $select;
},
try_remove: function (e) {
var $help_block = this.$('.help-block').empty();
var self = this;
- var id = parseInt($(e.target).data('id'), 10);
+ var $a = $(e.target);
+ var id = parseInt($a.data('id'), 10);
var attachment = _.findWhere(this.records, {id: id});
+ var $both = $a.parent().children();
+
+ $both.css({borderWidth: "5px", borderColor: "#f00"});
return openerp.jsonRpc('/web/dataset/call_kw', 'call', {
model: 'ir.attachment',
@@ -1561,6 +1651,7 @@
self.display_attachments();
return;
}
+ $both.css({borderWidth: "", borderColor: ""});
$help_block.replaceWith(openerp.qweb.render(
'website.editor.dialog.image.existing.error', {
views: prevented[id]
@@ -1570,6 +1661,48 @@
},
});
+ website.editor.RTEImageDialog = website.editor.ImageDialog.extend({
+ init: function (parent, editor, media) {
+ this._super(parent, editor, media);
+
+ this.on('start', this, this.proxy('started'));
+ this.on('save', this, this.proxy('saved'));
+ },
+ started: function (holder) {
+ if (!this.media) {
+ var selection = this.editor.getSelection();
+ this.media = selection && selection.getSelectedElement();
+ }
+
+ var el = this.media;
+ if (!el || !el.is('img')) {
+ return;
+ }
+ holder.url = el.getAttribute('src');
+ },
+ saved: function (data) {
+ var element, editor = this.editor;
+ if (!(element = this.media)) {
+ element = editor.document.createElement('img');
+ element.addClass('img');
+ element.addClass('img-responsive');
+ // focus event handler interactions between bootstrap (modal)
+ // and ckeditor (RTE) lead to blowing the stack in Safari and
+ // Chrome (but not FF) when this is done synchronously =>
+ // defer insertion so modal has been hidden & destroyed before
+ // it happens
+ setTimeout(function () {
+ editor.insertElement(element);
+ }, 0);
+ }
+
+ var style = data.style;
+ element.setAttribute('src', data.url);
+ element.removeAttribute('data-cke-saved-src');
+ if (style) { element.addClass(style); }
+ },
+ });
+
function get_selected_link(editor) {
var sel = editor.getSelection(),
el = sel.getSelectedElement();
@@ -1581,7 +1714,7 @@
range.shrink(CKEDITOR.SHRINK_TEXT);
var commonAncestor = range.getCommonAncestor();
var viewRoot = editor.elementPath(commonAncestor).contains(function (element) {
- return element.data('oe-model') === 'ir.ui.view'
+ return element.data('oe-model') === 'ir.ui.view';
});
if (!viewRoot) { return null; }
// if viewRoot is the first link, don't edit it.
@@ -1589,7 +1722,7 @@
.contains('a', true);
}
- website.editor.FontIconsDialog = website.editor.Dialog.extend({
+ website.editor.FontIconsDialog = website.editor.Media.extend({
template: 'website.editor.dialog.font-icons',
events : _.extend({}, website.editor.Dialog.prototype.events, {
change: 'update_preview',
@@ -1607,20 +1740,6 @@
this.$('#fa-size').val(e.target.getAttribute('data-size'));
this.update_preview();
},
- 'input input#icon-search': function () {
- var needle = this.$('#icon-search').val();
- var icons = this.icons;
- if (needle) {
- icons = _(icons).filter(function (icon) {
- return icon.id.substring(3).indexOf(needle) !== -1;
- });
- }
-
- this.$('div.font-icons-icons').html(
- openerp.qweb.render(
- 'website.editor.dialog.font-icons.icons',
- {icons: icons}));
- },
}),
// List of FontAwesome icons in 4.0.3, extracted from the cheatsheet.
@@ -1630,10 +1749,6 @@
// where we still need to implement ``initSelection``)
// TODO: add id/name to the text in order to allow FAYT selection of icons?
icons: [{"text": "\uf000", "id": "fa-glass"}, {"text": "\uf001", "id": "fa-music"}, {"text": "\uf002", "id": "fa-search"}, {"text": "\uf003", "id": "fa-envelope-o"}, {"text": "\uf004", "id": "fa-heart"}, {"text": "\uf005", "id": "fa-star"}, {"text": "\uf006", "id": "fa-star-o"}, {"text": "\uf007", "id": "fa-user"}, {"text": "\uf008", "id": "fa-film"}, {"text": "\uf009", "id": "fa-th-large"}, {"text": "\uf00a", "id": "fa-th"}, {"text": "\uf00b", "id": "fa-th-list"}, {"text": "\uf00c", "id": "fa-check"}, {"text": "\uf00d", "id": "fa-times"}, {"text": "\uf00e", "id": "fa-search-plus"}, {"text": "\uf010", "id": "fa-search-minus"}, {"text": "\uf011", "id": "fa-power-off"}, {"text": "\uf012", "id": "fa-signal"}, {"text": "\uf013", "id": "fa-cog"}, {"text": "\uf014", "id": "fa-trash-o"}, {"text": "\uf015", "id": "fa-home"}, {"text": "\uf016", "id": "fa-file-o"}, {"text": "\uf017", "id": "fa-clock-o"}, {"text": "\uf018", "id": "fa-road"}, {"text": "\uf019", "id": "fa-download"}, {"text": "\uf01a", "id": "fa-arrow-circle-o-down"}, {"text": "\uf01b", "id": "fa-arrow-circle-o-up"}, {"text": "\uf01c", "id": "fa-inbox"}, {"text": "\uf01d", "id": "fa-play-circle-o"}, {"text": "\uf01e", "id": "fa-repeat"}, {"text": "\uf021", "id": "fa-refresh"}, {"text": "\uf022", "id": "fa-list-alt"}, {"text": "\uf023", "id": "fa-lock"}, {"text": "\uf024", "id": "fa-flag"}, {"text": "\uf025", "id": "fa-headphones"}, {"text": "\uf026", "id": "fa-volume-off"}, {"text": "\uf027", "id": "fa-volume-down"}, {"text": "\uf028", "id": "fa-volume-up"}, {"text": "\uf029", "id": "fa-qrcode"}, {"text": "\uf02a", "id": "fa-barcode"}, {"text": "\uf02b", "id": "fa-tag"}, {"text": "\uf02c", "id": "fa-tags"}, {"text": "\uf02d", "id": "fa-book"}, {"text": "\uf02e", "id": "fa-bookmark"}, {"text": "\uf02f", "id": "fa-print"}, {"text": "\uf030", "id": "fa-camera"}, {"text": "\uf031", "id": "fa-font"}, {"text": "\uf032", "id": "fa-bold"}, {"text": "\uf033", "id": "fa-italic"}, {"text": "\uf034", "id": "fa-text-height"}, {"text": "\uf035", "id": "fa-text-width"}, {"text": "\uf036", "id": "fa-align-left"}, {"text": "\uf037", "id": "fa-align-center"}, {"text": "\uf038", "id": "fa-align-right"}, {"text": "\uf039", "id": "fa-align-justify"}, {"text": "\uf03a", "id": "fa-list"}, {"text": "\uf03b", "id": "fa-outdent"}, {"text": "\uf03c", "id": "fa-indent"}, {"text": "\uf03d", "id": "fa-video-camera"}, {"text": "\uf03e", "id": "fa-picture-o"}, {"text": "\uf040", "id": "fa-pencil"}, {"text": "\uf041", "id": "fa-map-marker"}, {"text": "\uf042", "id": "fa-adjust"}, {"text": "\uf043", "id": "fa-tint"}, {"text": "\uf044", "id": "fa-pencil-square-o"}, {"text": "\uf045", "id": "fa-share-square-o"}, {"text": "\uf046", "id": "fa-check-square-o"}, {"text": "\uf047", "id": "fa-arrows"}, {"text": "\uf048", "id": "fa-step-backward"}, {"text": "\uf049", "id": "fa-fast-backward"}, {"text": "\uf04a", "id": "fa-backward"}, {"text": "\uf04b", "id": "fa-play"}, {"text": "\uf04c", "id": "fa-pause"}, {"text": "\uf04d", "id": "fa-stop"}, {"text": "\uf04e", "id": "fa-forward"}, {"text": "\uf050", "id": "fa-fast-forward"}, {"text": "\uf051", "id": "fa-step-forward"}, {"text": "\uf052", "id": "fa-eject"}, {"text": "\uf053", "id": "fa-chevron-left"}, {"text": "\uf054", "id": "fa-chevron-right"}, {"text": "\uf055", "id": "fa-plus-circle"}, {"text": "\uf056", "id": "fa-minus-circle"}, {"text": "\uf057", "id": "fa-times-circle"}, {"text": "\uf058", "id": "fa-check-circle"}, {"text": "\uf059", "id": "fa-question-circle"}, {"text": "\uf05a", "id": "fa-info-circle"}, {"text": "\uf05b", "id": "fa-crosshairs"}, {"text": "\uf05c", "id": "fa-times-circle-o"}, {"text": "\uf05d", "id": "fa-check-circle-o"}, {"text": "\uf05e", "id": "fa-ban"}, {"text": "\uf060", "id": "fa-arrow-left"}, {"text": "\uf061", "id": "fa-arrow-right"}, {"text": "\uf062", "id": "fa-arrow-up"}, {"text": "\uf063", "id": "fa-arrow-down"}, {"text": "\uf064", "id": "fa-share"}, {"text": "\uf065", "id": "fa-expand"}, {"text": "\uf066", "id": "fa-compress"}, {"text": "\uf067", "id": "fa-plus"}, {"text": "\uf068", "id": "fa-minus"}, {"text": "\uf069", "id": "fa-asterisk"}, {"text": "\uf06a", "id": "fa-exclamation-circle"}, {"text": "\uf06b", "id": "fa-gift"}, {"text": "\uf06c", "id": "fa-leaf"}, {"text": "\uf06d", "id": "fa-fire"}, {"text": "\uf06e", "id": "fa-eye"}, {"text": "\uf070", "id": "fa-eye-slash"}, {"text": "\uf071", "id": "fa-exclamation-triangle"}, {"text": "\uf072", "id": "fa-plane"}, {"text": "\uf073", "id": "fa-calendar"}, {"text": "\uf074", "id": "fa-random"}, {"text": "\uf075", "id": "fa-comment"}, {"text": "\uf076", "id": "fa-magnet"}, {"text": "\uf077", "id": "fa-chevron-up"}, {"text": "\uf078", "id": "fa-chevron-down"}, {"text": "\uf079", "id": "fa-retweet"}, {"text": "\uf07a", "id": "fa-shopping-cart"}, {"text": "\uf07b", "id": "fa-folder"}, {"text": "\uf07c", "id": "fa-folder-open"}, {"text": "\uf07d", "id": "fa-arrows-v"}, {"text": "\uf07e", "id": "fa-arrows-h"}, {"text": "\uf080", "id": "fa-bar-chart-o"}, {"text": "\uf081", "id": "fa-twitter-square"}, {"text": "\uf082", "id": "fa-facebook-square"}, {"text": "\uf083", "id": "fa-camera-retro"}, {"text": "\uf084", "id": "fa-key"}, {"text": "\uf085", "id": "fa-cogs"}, {"text": "\uf086", "id": "fa-comments"}, {"text": "\uf087", "id": "fa-thumbs-o-up"}, {"text": "\uf088", "id": "fa-thumbs-o-down"}, {"text": "\uf089", "id": "fa-star-half"}, {"text": "\uf08a", "id": "fa-heart-o"}, {"text": "\uf08b", "id": "fa-sign-out"}, {"text": "\uf08c", "id": "fa-linkedin-square"}, {"text": "\uf08d", "id": "fa-thumb-tack"}, {"text": "\uf08e", "id": "fa-external-link"}, {"text": "\uf090", "id": "fa-sign-in"}, {"text": "\uf091", "id": "fa-trophy"}, {"text": "\uf092", "id": "fa-github-square"}, {"text": "\uf093", "id": "fa-upload"}, {"text": "\uf094", "id": "fa-lemon-o"}, {"text": "\uf095", "id": "fa-phone"}, {"text": "\uf096", "id": "fa-square-o"}, {"text": "\uf097", "id": "fa-bookmark-o"}, {"text": "\uf098", "id": "fa-phone-square"}, {"text": "\uf099", "id": "fa-twitter"}, {"text": "\uf09a", "id": "fa-facebook"}, {"text": "\uf09b", "id": "fa-github"}, {"text": "\uf09c", "id": "fa-unlock"}, {"text": "\uf09d", "id": "fa-credit-card"}, {"text": "\uf09e", "id": "fa-rss"}, {"text": "\uf0a0", "id": "fa-hdd-o"}, {"text": "\uf0a1", "id": "fa-bullhorn"}, {"text": "\uf0f3", "id": "fa-bell"}, {"text": "\uf0a3", "id": "fa-certificate"}, {"text": "\uf0a4", "id": "fa-hand-o-right"}, {"text": "\uf0a5", "id": "fa-hand-o-left"}, {"text": "\uf0a6", "id": "fa-hand-o-up"}, {"text": "\uf0a7", "id": "fa-hand-o-down"}, {"text": "\uf0a8", "id": "fa-arrow-circle-left"}, {"text": "\uf0a9", "id": "fa-arrow-circle-right"}, {"text": "\uf0aa", "id": "fa-arrow-circle-up"}, {"text": "\uf0ab", "id": "fa-arrow-circle-down"}, {"text": "\uf0ac", "id": "fa-globe"}, {"text": "\uf0ad", "id": "fa-wrench"}, {"text": "\uf0ae", "id": "fa-tasks"}, {"text": "\uf0b0", "id": "fa-filter"}, {"text": "\uf0b1", "id": "fa-briefcase"}, {"text": "\uf0b2", "id": "fa-arrows-alt"}, {"text": "\uf0c0", "id": "fa-users"}, {"text": "\uf0c1", "id": "fa-link"}, {"text": "\uf0c2", "id": "fa-cloud"}, {"text": "\uf0c3", "id": "fa-flask"}, {"text": "\uf0c4", "id": "fa-scissors"}, {"text": "\uf0c5", "id": "fa-files-o"}, {"text": "\uf0c6", "id": "fa-paperclip"}, {"text": "\uf0c7", "id": "fa-floppy-o"}, {"text": "\uf0c8", "id": "fa-square"}, {"text": "\uf0c9", "id": "fa-bars"}, {"text": "\uf0ca", "id": "fa-list-ul"}, {"text": "\uf0cb", "id": "fa-list-ol"}, {"text": "\uf0cc", "id": "fa-strikethrough"}, {"text": "\uf0cd", "id": "fa-underline"}, {"text": "\uf0ce", "id": "fa-table"}, {"text": "\uf0d0", "id": "fa-magic"}, {"text": "\uf0d1", "id": "fa-truck"}, {"text": "\uf0d2", "id": "fa-pinterest"}, {"text": "\uf0d3", "id": "fa-pinterest-square"}, {"text": "\uf0d4", "id": "fa-google-plus-square"}, {"text": "\uf0d5", "id": "fa-google-plus"}, {"text": "\uf0d6", "id": "fa-money"}, {"text": "\uf0d7", "id": "fa-caret-down"}, {"text": "\uf0d8", "id": "fa-caret-up"}, {"text": "\uf0d9", "id": "fa-caret-left"}, {"text": "\uf0da", "id": "fa-caret-right"}, {"text": "\uf0db", "id": "fa-columns"}, {"text": "\uf0dc", "id": "fa-sort"}, {"text": "\uf0dd", "id": "fa-sort-asc"}, {"text": "\uf0de", "id": "fa-sort-desc"}, {"text": "\uf0e0", "id": "fa-envelope"}, {"text": "\uf0e1", "id": "fa-linkedin"}, {"text": "\uf0e2", "id": "fa-undo"}, {"text": "\uf0e3", "id": "fa-gavel"}, {"text": "\uf0e4", "id": "fa-tachometer"}, {"text": "\uf0e5", "id": "fa-comment-o"}, {"text": "\uf0e6", "id": "fa-comments-o"}, {"text": "\uf0e7", "id": "fa-bolt"}, {"text": "\uf0e8", "id": "fa-sitemap"}, {"text": "\uf0e9", "id": "fa-umbrella"}, {"text": "\uf0ea", "id": "fa-clipboard"}, {"text": "\uf0eb", "id": "fa-lightbulb-o"}, {"text": "\uf0ec", "id": "fa-exchange"}, {"text": "\uf0ed", "id": "fa-cloud-download"}, {"text": "\uf0ee", "id": "fa-cloud-upload"}, {"text": "\uf0f0", "id": "fa-user-md"}, {"text": "\uf0f1", "id": "fa-stethoscope"}, {"text": "\uf0f2", "id": "fa-suitcase"}, {"text": "\uf0a2", "id": "fa-bell-o"}, {"text": "\uf0f4", "id": "fa-coffee"}, {"text": "\uf0f5", "id": "fa-cutlery"}, {"text": "\uf0f6", "id": "fa-file-text-o"}, {"text": "\uf0f7", "id": "fa-building-o"}, {"text": "\uf0f8", "id": "fa-hospital-o"}, {"text": "\uf0f9", "id": "fa-ambulance"}, {"text": "\uf0fa", "id": "fa-medkit"}, {"text": "\uf0fb", "id": "fa-fighter-jet"}, {"text": "\uf0fc", "id": "fa-beer"}, {"text": "\uf0fd", "id": "fa-h-square"}, {"text": "\uf0fe", "id": "fa-plus-square"}, {"text": "\uf100", "id": "fa-angle-double-left"}, {"text": "\uf101", "id": "fa-angle-double-right"}, {"text": "\uf102", "id": "fa-angle-double-up"}, {"text": "\uf103", "id": "fa-angle-double-down"}, {"text": "\uf104", "id": "fa-angle-left"}, {"text": "\uf105", "id": "fa-angle-right"}, {"text": "\uf106", "id": "fa-angle-up"}, {"text": "\uf107", "id": "fa-angle-down"}, {"text": "\uf108", "id": "fa-desktop"}, {"text": "\uf109", "id": "fa-laptop"}, {"text": "\uf10a", "id": "fa-tablet"}, {"text": "\uf10b", "id": "fa-mobile"}, {"text": "\uf10c", "id": "fa-circle-o"}, {"text": "\uf10d", "id": "fa-quote-left"}, {"text": "\uf10e", "id": "fa-quote-right"}, {"text": "\uf110", "id": "fa-spinner"}, {"text": "\uf111", "id": "fa-circle"}, {"text": "\uf112", "id": "fa-reply"}, {"text": "\uf113", "id": "fa-github-alt"}, {"text": "\uf114", "id": "fa-folder-o"}, {"text": "\uf115", "id": "fa-folder-open-o"}, {"text": "\uf118", "id": "fa-smile-o"}, {"text": "\uf119", "id": "fa-frown-o"}, {"text": "\uf11a", "id": "fa-meh-o"}, {"text": "\uf11b", "id": "fa-gamepad"}, {"text": "\uf11c", "id": "fa-keyboard-o"}, {"text": "\uf11d", "id": "fa-flag-o"}, {"text": "\uf11e", "id": "fa-flag-checkered"}, {"text": "\uf120", "id": "fa-terminal"}, {"text": "\uf121", "id": "fa-code"}, {"text": "\uf122", "id": "fa-reply-all"}, {"text": "\uf122", "id": "fa-mail-reply-all"}, {"text": "\uf123", "id": "fa-star-half-o"}, {"text": "\uf124", "id": "fa-location-arrow"}, {"text": "\uf125", "id": "fa-crop"}, {"text": "\uf126", "id": "fa-code-fork"}, {"text": "\uf127", "id": "fa-chain-broken"}, {"text": "\uf128", "id": "fa-question"}, {"text": "\uf129", "id": "fa-info"}, {"text": "\uf12a", "id": "fa-exclamation"}, {"text": "\uf12b", "id": "fa-superscript"}, {"text": "\uf12c", "id": "fa-subscript"}, {"text": "\uf12d", "id": "fa-eraser"}, {"text": "\uf12e", "id": "fa-puzzle-piece"}, {"text": "\uf130", "id": "fa-microphone"}, {"text": "\uf131", "id": "fa-microphone-slash"}, {"text": "\uf132", "id": "fa-shield"}, {"text": "\uf133", "id": "fa-calendar-o"}, {"text": "\uf134", "id": "fa-fire-extinguisher"}, {"text": "\uf135", "id": "fa-rocket"}, {"text": "\uf136", "id": "fa-maxcdn"}, {"text": "\uf137", "id": "fa-chevron-circle-left"}, {"text": "\uf138", "id": "fa-chevron-circle-right"}, {"text": "\uf139", "id": "fa-chevron-circle-up"}, {"text": "\uf13a", "id": "fa-chevron-circle-down"}, {"text": "\uf13b", "id": "fa-html5"}, {"text": "\uf13c", "id": "fa-css3"}, {"text": "\uf13d", "id": "fa-anchor"}, {"text": "\uf13e", "id": "fa-unlock-alt"}, {"text": "\uf140", "id": "fa-bullseye"}, {"text": "\uf141", "id": "fa-ellipsis-h"}, {"text": "\uf142", "id": "fa-ellipsis-v"}, {"text": "\uf143", "id": "fa-rss-square"}, {"text": "\uf144", "id": "fa-play-circle"}, {"text": "\uf145", "id": "fa-ticket"}, {"text": "\uf146", "id": "fa-minus-square"}, {"text": "\uf147", "id": "fa-minus-square-o"}, {"text": "\uf148", "id": "fa-level-up"}, {"text": "\uf149", "id": "fa-level-down"}, {"text": "\uf14a", "id": "fa-check-square"}, {"text": "\uf14b", "id": "fa-pencil-square"}, {"text": "\uf14c", "id": "fa-external-link-square"}, {"text": "\uf14d", "id": "fa-share-square"}, {"text": "\uf14e", "id": "fa-compass"}, {"text": "\uf150", "id": "fa-caret-square-o-down"}, {"text": "\uf151", "id": "fa-caret-square-o-up"}, {"text": "\uf152", "id": "fa-caret-square-o-right"}, {"text": "\uf153", "id": "fa-eur"}, {"text": "\uf154", "id": "fa-gbp"}, {"text": "\uf155", "id": "fa-usd"}, {"text": "\uf156", "id": "fa-inr"}, {"text": "\uf157", "id": "fa-jpy"}, {"text": "\uf158", "id": "fa-rub"}, {"text": "\uf159", "id": "fa-krw"}, {"text": "\uf15a", "id": "fa-btc"}, {"text": "\uf15b", "id": "fa-file"}, {"text": "\uf15c", "id": "fa-file-text"}, {"text": "\uf15d", "id": "fa-sort-alpha-asc"}, {"text": "\uf15e", "id": "fa-sort-alpha-desc"}, {"text": "\uf160", "id": "fa-sort-amount-asc"}, {"text": "\uf161", "id": "fa-sort-amount-desc"}, {"text": "\uf162", "id": "fa-sort-numeric-asc"}, {"text": "\uf163", "id": "fa-sort-numeric-desc"}, {"text": "\uf164", "id": "fa-thumbs-up"}, {"text": "\uf165", "id": "fa-thumbs-down"}, {"text": "\uf166", "id": "fa-youtube-square"}, {"text": "\uf167", "id": "fa-youtube"}, {"text": "\uf168", "id": "fa-xing"}, {"text": "\uf169", "id": "fa-xing-square"}, {"text": "\uf16a", "id": "fa-youtube-play"}, {"text": "\uf16b", "id": "fa-dropbox"}, {"text": "\uf16c", "id": "fa-stack-overflow"}, {"text": "\uf16d", "id": "fa-instagram"}, {"text": "\uf16e", "id": "fa-flickr"}, {"text": "\uf170", "id": "fa-adn"}, {"text": "\uf171", "id": "fa-bitbucket"}, {"text": "\uf172", "id": "fa-bitbucket-square"}, {"text": "\uf173", "id": "fa-tumblr"}, {"text": "\uf174", "id": "fa-tumblr-square"}, {"text": "\uf175", "id": "fa-long-arrow-down"}, {"text": "\uf176", "id": "fa-long-arrow-up"}, {"text": "\uf177", "id": "fa-long-arrow-left"}, {"text": "\uf178", "id": "fa-long-arrow-right"}, {"text": "\uf179", "id": "fa-apple"}, {"text": "\uf17a", "id": "fa-windows"}, {"text": "\uf17b", "id": "fa-android"}, {"text": "\uf17c", "id": "fa-linux"}, {"text": "\uf17d", "id": "fa-dribbble"}, {"text": "\uf17e", "id": "fa-skype"}, {"text": "\uf180", "id": "fa-foursquare"}, {"text": "\uf181", "id": "fa-trello"}, {"text": "\uf182", "id": "fa-female"}, {"text": "\uf183", "id": "fa-male"}, {"text": "\uf184", "id": "fa-gittip"}, {"text": "\uf185", "id": "fa-sun-o"}, {"text": "\uf186", "id": "fa-moon-o"}, {"text": "\uf187", "id": "fa-archive"}, {"text": "\uf188", "id": "fa-bug"}, {"text": "\uf189", "id": "fa-vk"}, {"text": "\uf18a", "id": "fa-weibo"}, {"text": "\uf18b", "id": "fa-renren"}, {"text": "\uf18c", "id": "fa-pagelines"}, {"text": "\uf18d", "id": "fa-stack-exchange"}, {"text": "\uf18e", "id": "fa-arrow-circle-o-right"}, {"text": "\uf190", "id": "fa-arrow-circle-o-left"}, {"text": "\uf191", "id": "fa-caret-square-o-left"}, {"text": "\uf192", "id": "fa-dot-circle-o"}, {"text": "\uf193", "id": "fa-wheelchair"}, {"text": "\uf194", "id": "fa-vimeo-square"}, {"text": "\uf195", "id": "fa-try"}, {"text": "\uf196", "id": "fa-plus-square-o"}],
- init: function (editor, element) {
- this._super(editor);
- this.element = element;
- },
/**
* Initializes select2: in Chrome and Safari, <select> font apparently
* isn't customizable (?) and the fontawesome glyphs fail to appear.
@@ -1641,17 +1756,33 @@
start: function () {
return this._super().then(this.proxy('load_data'));
},
+ search: function (needle) {
+ var icons = this.icons;
+ if (needle) {
+ icons = _(icons).filter(function (icon) {
+ return icon.id.substring(3).indexOf(needle) !== -1;
+ });
+ }
+
+ this.$('div.font-icons-icons').html(
+ openerp.qweb.render(
+ 'website.editor.dialog.font-icons.icons',
+ {icons: icons}));
+ },
/**
* Removes existing FontAwesome classes on the bound element, and sets
* all the new ones if necessary.
*/
save: function () {
- var classes = this.element.className.split(/\s+/);
+ var style = this.media.$.attributes.style ? this.media.$.attributes.style.textContent : '';
+ var classes = (this.media.$.className||"").split(/\s+/);
var non_fa_classes = _.reject(classes, function (cls) {
return cls === 'fa' || /^fa-/.test(cls);
});
var final_classes = non_fa_classes.concat(this.get_fa_classes());
- this.element.className = final_classes.join(' ');
+ this.media.$.className = final_classes.join(' ');
+ this.media.renameNode("span");
+ this.media.$.attributes.style.textContent = style;
this._super();
},
/**
@@ -1662,7 +1793,7 @@
* which may not match the visual look of the element.
*/
load_data: function () {
- var classes = this.element.className.split(/\s+/);
+ var classes = (this.media&&this.media.$.className||"").split(/\s+/);
for (var i = 0; i < classes.length; i++) {
var cls = classes[i];
switch(cls) {
@@ -1701,7 +1832,9 @@
];
},
update_preview: function () {
+ this.$preview.empty();
var $preview = this.$('#fa-preview').empty();
+
var sizes = ['', 'fa-2x', 'fa-3x', 'fa-4x', 'fa-5x'];
var classes = this.get_fa_classes();
var no_sizes = _.difference(classes, sizes).join(' ');
@@ -1713,13 +1846,123 @@
.attr('data-size', size)
.addClass(size)
.addClass(no_sizes);
- if ((size && _.contains(classes, size)) || (!size && !selected)) {
+ if ((size && _.contains(classes, size)) || (classes[2] === "" && !selected)) {
+ this.$preview.append($p.clone());
+ this.$('#fa-size').val(size);
$p.addClass('font-icons-selected');
selected = true;
}
$preview.prepend($p);
}
- }
+ },
+ clear: function () {
+ this.media.$.className = this.media.$.className.replace(/(^|\s)(fa(\s|$)|fa-[^\s]*)/g, ' ');
+ },
+ });
+
+ website.editor.VideoDialog = website.editor.Media.extend({
+ template: 'website.editor.dialog.video',
+ events : _.extend({}, website.editor.Dialog.prototype.events, {
+ 'click input#urlvideo ~ button': 'get_video',
+ 'click input#embedvideo ~ button': 'get_embed_video',
+ 'change input#urlvideo': 'change_input',
+ 'keyup input#urlvideo': 'change_input',
+ 'change input#embedvideo': 'change_input',
+ 'keyup input#embedvideo': 'change_input'
+ }),
+ start: function () {
+ this.$iframe = this.$("iframe");
+ var $media = $(this.media && this.media.$);
+ if ($media.hasClass("media_iframe_video")) {
+ var src = $media.data('src');
+ this.$("input#urlvideo").val(src);
+ this.$("#autoplay").attr("checked", src.indexOf('autoplay=1') != -1);
+ this.get_video();
+ }
+ return this._super();
+ },
+ change_input: function (e) {
+ var $input = $(e.target);
+ var $button = $input.parent().find("button");
+ if ($input.val() === "") {
+ $button.addClass("btn-default").removeClass("btn-primary");
+ } else {
+ $button.removeClass("btn-default").addClass("btn-primary");
+ }
+ },
+ get_url: function () {
+ var video_id = this.$("#video_id").val();
+ var video_type = this.$("#video_type").val();
+ switch (video_type) {
+ case "youtube":
+ return "//www.youtube.com/embed/" + video_id + "?autoplay=" + (this.$("#autoplay").is(":checked") ? 1 : 0);
+ case "vimeo":
+ return "//player.vimeo.com/video/" + video_id + "?autoplay=" + (this.$("#autoplay").is(":checked") ? 1 : 0);
+ case "dailymotion":
+ return "//www.dailymotion.com/embed/video/" + video_id + "?autoplay=" + (this.$("#autoplay").is(":checked") ? 1 : 0);
+ default:
+ return video_id;
+ }
+ },
+ get_embed_video: function (event) {
+ event.preventDefault();
+ var embedvideo = this.$("input#embedvideo").val().match(/src=["']?([^"']+)["' ]?/);
+ if (embedvideo) {
+ this.$("input#urlvideo").val(embedvideo[1]);
+ this.get_video(event);
+ }
+ return false;
+ },
+ get_video: function (event) {
+ if (event) event.preventDefault();
+ var needle = this.$("input#urlvideo").val();
+ var video_id;
+ var video_type;
+
+ if (needle.indexOf(".youtube.") != -1) {
+ video_type = "youtube";
+ video_id = needle.match(/\.youtube\.[a-z]+\/(embed\/|watch\?v=)?([^\/?&]+)/i)[2];
+ } else if (needle.indexOf("//youtu.") != -1) {
+ video_type = "youtube";
+ video_id = needle.match(/youtube\.[a-z]+\/([^\/?&]+)/i)[1];
+ } else if (needle.indexOf("player.vimeo.") != -1 || needle.indexOf("//vimeo.") != -1) {
+ video_type = "vimeo";
+ video_id = needle.match(/vimeo\.[a-z]+\/(video\/)?([^?&]+)/i)[2];
+ } else if (needle.indexOf(".dailymotion.") != -1) {
+ video_type = "dailymotion";
+ video_id = needle.match(/dailymotion\.[a-z]+\/(embed\/)?(video\/)?([^\/?&]+)/i)[3];
+ } else {
+ video_type = "";
+ video_id = needle;
+ }
+
+ this.$("#video_id").val(video_id);
+ this.$("#video_type").val(video_type);
+
+ this.$iframe.attr("src", this.get_url());
+ return false;
+ },
+ save: function () {
+ var video_id = this.$("#video_id").val();
+ if (!video_id) {
+ this.$("button.btn-primary").click();
+ video_id = this.$("#video_id").val();
+ }
+ var video_type = this.$("#video_type").val();
+ var style = this.media.$.attributes.style ? this.media.$.attributes.style.textContent : '';
+ var $iframe = $(
+ '<div class="media_iframe_video" data-src="'+this.get_url()+'" style="'+style+'">'+
+ '<div class="css_editable_mode_display">&nbsp;</div>'+
+ '<iframe src="'+this.get_url()+'" frameborder="0" allowfullscreen="allowfullscreen"></iframe>'+
+ '</div>');
+ $(this.media.$).replaceWith($iframe);
+ this.media.$ = $iframe[0];
+ this._super();
+ },
+ clear: function () {
+ delete this.media.$.dataset.src;
+ this.media.$.className = this.media.$.className.replace(/(^|\s)media_iframe_video(\s|$)/g, ' ');
+ },
});
website.Observer = window.MutationObserver || window.WebkitMutationObserver || window.JsMutationObserver;
diff --git a/addons/website/static/src/js/website.snippets.animation.js b/addons/website/static/src/js/website.snippets.animation.js
index 56ad596d71a..1b8dfc0b320 100644
--- a/addons/website/static/src/js/website.snippets.animation.js
+++ b/addons/website/static/src/js/website.snippets.animation.js
@@ -148,4 +148,11 @@
});
},
});
+
+ website.snippet.animationRegistry.media_video = website.snippet.Animation.extend({
+ selector: ".media_iframe_video",
+ start: function () {
+ this.$target.html('<div class="css_editable_mode_display">&nbsp;</div><iframe src="'+this.$target.data("src")+'" frameborder="0" allowfullscreen="allowfullscreen"></iframe>');
+ },
+ });
})();
diff --git a/addons/website/static/src/js/website.snippets.editor.js b/addons/website/static/src/js/website.snippets.editor.js
index 52deeabf5e6..fac4f9ab357 100644
--- a/addons/website/static/src/js/website.snippets.editor.js
+++ b/addons/website/static/src/js/website.snippets.editor.js
@@ -154,6 +154,7 @@
this.on('rte:ready', this, function () {
self.snippets.$button.removeClass("hidden");
website.snippet.stop_animation();
+ website.snippet.start_animation(true, $(".media_iframe_video"));
});
return this._super.apply(this, arguments);
@@ -265,7 +266,8 @@
'$el': $style,
'selector-siblings': $style.data('selector-siblings'),
'selector-children': $style.data('selector-children'),
- 'selector-vertical-children': $style.data('selector-vertical-children')
+ 'selector-vertical-children': $style.data('selector-vertical-children'),
+ 'data': $style.data()
};
selector.push($style.data('selector'));
});
@@ -332,6 +334,7 @@
if (!$target.is(website.snippet.globalSelector)) {
$target = $target.parents(website.snippet.globalSelector).first();
}
+
if (!self.dom_filter($target).length) {
$target = false;
}
@@ -732,12 +735,15 @@
this.$target.data("snippet-option-ids", styles);
this.$overlay = this.$target.data('overlay');
this['snippet-option-id'] = snippet_id;
- this.$el = website.snippet.templateOptions[snippet_id].$el.find(">li").clone();
+ var $option = website.snippet.templateOptions[snippet_id].$el;
+ this.$el = $option.find(">li").clone();
+ this.data = $option.data();
this.required = this.$el.data("required");
this.set_active();
- this.$el.find('li[data-value] a').on('mouseover mouseout click', _.bind(this._mouse, this));
+ this.$el.find('li[data-value] a').on('mouseenter mouseleave click', _.bind(this._mouse, this));
+ this.$el.not(':not([data-value])').find("a").on('mouseenter mouseleave click', _.bind(this._mouse, this));
this.$target.on('snippet-style-reset', _.bind(this.set_active, this));
this.start();
@@ -745,7 +751,7 @@
_mouse: function (event) {
var self = this;
- if (event.type === 'mouseout') {
+ if (event.type === 'mouseleave') {
if (!this.over) return;
this.over = false;
} else if (event.type === 'click') {
@@ -755,7 +761,7 @@
}
var $prev, $next;
- if (event.type === 'mouseout') {
+ if (event.type === 'mouseleave') {
$prev = $(event.currentTarget).parent();
$next = this.$el.find("li[data-value].active");
} else {
@@ -837,7 +843,7 @@
var self = this;
// add or remove html class
- if (np.$prev && this.required) {
+ if (np.$prev) {
this.$target.removeClass(np.$prev.data('value') || "");
}
if (np.$next) {
@@ -927,7 +933,7 @@
drop_and_build_snippet: function() {
this.id = this.unique_id();
this.$target.attr("id", this.id);
- this.$target.find("[data-slide]").attr("href", "#" + this.id);
+ this.$target.find("[data-slide]").attr("data-target", "#" + this.id);
this.$target.find("[data-slide-to]").attr("data-target", "#" + this.id);
this.rebind_event();
@@ -1171,6 +1177,7 @@
dy = dy - dy%resize;
if (dy <= 0) dy = resize;
self.$target.css("height", dy+"px");
+ self.$target.css("overflow", "hidden");
self.on_resize(compass, null, dy);
self.BuildingBlock.cover_target(self.$overlay, self.$target);
return;
@@ -1211,6 +1218,7 @@
});
this.$overlay.find(".oe_handle.size .auto_size").on('click', function (event){
self.$target.css("height", "");
+ self.$target.css("overflow", "");
self.BuildingBlock.cover_target(self.$overlay, self.$target);
return false;
});
@@ -1425,6 +1433,88 @@
}
});
+ website.snippet.options.transform = website.snippet.Option.extend({
+ start: function () {
+ var self = this;
+ this._super();
+
+ this.$el.find(".clear-style").click(function (event) {
+ self.$target.removeClass("fa-spin").attr("style", "");
+ self.resetTransfo();
+ });
+
+ this.$el.find(".style").click(function (event) {
+ var settings = self.$target.data("transfo").settings;
+ self.$target.transfo({ hide: (settings.hide = !settings.hide) });
+ });
+
+ this.$overlay.find('.oe_snippet_clone, .oe_handles').addClass('hidden');
+
+ this.$overlay.find('[data-toggle="dropdown"]')
+ .on("mousedown", function () {
+ self.$target.transfo("hide");
+ });
+ },
+ resetTransfo: function () {
+ var self = this;
+ this.$target.transfo("destroy");
+ this.$target.transfo({
+ hide: true,
+ callback: function () {
+ var pos = $(this).data("transfo").$center.offset();
+ self.$overlay.css({
+ 'top': pos.top,
+ 'left': pos.left,
+ 'position': 'absolute',
+ });
+ self.$overlay.find(".oe_overlay_options").attr("style", "width:0; left:0!important; top:0;");
+ self.$overlay.find(".oe_overlay_options > .btn-group").attr("style", "width:160px; left:-80px;");
+ }});
+ this.$target.data('transfo').$markup
+ .on("mouseover", function () {
+ self.$target.trigger("mouseover");
+ })
+ .mouseover();
+ },
+ onFocus : function () {
+ this.resetTransfo();
+ },
+ onBlur : function () {
+ this.$target.transfo("hide");
+ },
+ });
+
+ website.snippet.options.media = website.snippet.Option.extend({
+ start: function () {
+ var self = this;
+ this._super();
+
+ website.snippet.start_animation(true, this.$target);
+
+ $(document.body).on("media-saved", self, function (event, prev , item) {
+ self.editor.onBlur();
+ self.BuildingBlock.make_active(false);
+ self.BuildingBlock.make_active($(item));
+ });
+
+ this.$el.find(".edition").click(function (event) {
+ event.preventDefault();
+ event.stopPropagation();
+ self.element = new CKEDITOR.dom.element(self.$target[0]);
+ new website.editor.MediaDialog(self, self.element).appendTo(document.body);
+ });
+ },
+ onFocus : function () {
+ var self = this;
+ if (this.$target.parent().data("oe-field") === "image") {
+ this.$overlay.addClass("hidden");
+ self.element = new CKEDITOR.dom.element(self.$target[0]);
+ new website.editor.MediaDialog(self, self.element).appendTo(document.body);
+ self.BuildingBlock.make_active(false);
+ }
+ },
+ });
+
website.snippet.Editor = openerp.Class.extend({
init: function (BuildingBlock, dom) {
@@ -1564,6 +1654,10 @@
if (this.selector_vertical_children === "")
this.selector_vertical_children = false;
+ if (!this.selector_siblings && !this.selector_children && !this.selector_vertical_children) {
+ this.$overlay.find(".oe_snippet_move").addClass('hidden');
+ }
+
if ($ul.find("li").length) {
$styles.removeClass("hidden");
diff --git a/addons/website/static/src/js/website.tour.banner.js b/addons/website/static/src/js/website.tour.banner.js
index 9c8afcd61e5..63ef120d9a1 100644
--- a/addons/website/static/src/js/website.tour.banner.js
+++ b/addons/website/static/src/js/website.tour.banner.js
@@ -35,7 +35,7 @@
element: 'button[data-action=snippet]',
placement: 'bottom',
title: _t("Insert building blocks"),
- content: _t("Click here to insert blocks of centent in the page."),
+ content: _t("Click here to insert blocks of content in the page."),
popover: { fixed: true },
},
{
diff --git a/addons/website/static/src/xml/website.editor.xml b/addons/website/static/src/xml/website.editor.xml
index 6edf553b7cb..669d5f42e2f 100644
--- a/addons/website/static/src/xml/website.editor.xml
+++ b/addons/website/static/src/xml/website.editor.xml
@@ -88,49 +88,85 @@
</form>
</t>
</t>
+ <t t-name="website.editor.dialog.media">
+ <div class="modal" tabindex="-1" role="dialog" aria-hidden="true">
+ <div class="modal-dialog select-media">
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
+ <h3 class="modal-title">Select a Media</h3>
+ </div>
+ <div class="modal-body">
+ <ul class="nav nav-tabs">
+ <li class="active"><a href="#editor-media-image" data-toggle="tab">Image</a></li>
+ <li><a href="#editor-media-icon" data-toggle="tab">Pictogram</a></li>
+ <li><a href="#editor-media-video" data-toggle="tab">Video</a></li>
+ <li class="search" style="float: right;">
+ <ul class="pager mb0 mt0">
+ <li class="previous disabled"><a href="#">← Previous</a></li>
+ <li class="next disabled"><a href="#">Next →</a></li>
+ </ul>
+ </li>
+ <li class="search" style="float: right;">
+ <form action="#">
+ <div class="form-group font-icons fa fa-search mb0">
+ <input type="search" class="form-control" id="icon-search"/>
+ </div>
+ </form>
+ </li>
+ </ul>
+
+ <!-- Tab panes -->
+ <div class="tab-content">
+ <div class="tab-pane fade in active" id="editor-media-image">
+
+ </div>
+ <div class="tab-pane fade" id="editor-media-icon">
+
+ </div>
+ <div class="tab-pane fade" id="editor-media-video">
+
+ </div>
+ </div>
+ </div>
+ <div class="modal-footer">
+ <button type="button" class="btn btn-primary save">Save</button>
+ <button type="button" class="btn hidden wait" disabled="disabled"/>
+ or
+ <a href="#" data-dismiss="modal" aria-hidden="true">Discard</a>
+ </div>
+ </div>
+ </div>
+ </div>
+ </t>
<t t-name="website.editor.dialog.image">
- <t t-call="website.editor.dialog">
- <t t-set="title">Image:</t>
- <div class="row">
- <form method="POST" action="/website/attach"
- enctype="multipart/form-data"
- target="fileframe"
- class="col-sm-8">
- <div class="text-center">
+ <div>
+ <form method="POST"
+ action="/website/attach"
+ enctype="multipart/form-data"
+ target="fileframe"
+ class="form-inline">
+ <div class="well">
+ <div class="form-group pull-left">
<input type="file" name="upload" accept="image/*" style="position: absolute; opacity: 0; width: 1px; height: 1px;"/>
- <button type="button" class="btn btn-primary btn-lg filepicker">
- Upload an image from your computer
- </button>
- <button type="button" class="btn btn-lg hidden wait" disabled="disabled"/>
- <p class="text-muted mt16">— or —</p>
+ <button type="button" class="btn btn-primary filepicker">Upload an image from your computer</button>
+ <button type="button" class="btn hidden wait" disabled="disabled">Uploading...</button>
</div>
- <div class="well">
- <a href="#existing" class="pull-right">Browse existing images</a>
- <h3 class="list-group-item-heading">Image URL</h3>
- <input type="text" class="form-control url"
- placeholder="http://openerp.com"/>
+ <div>
+ <span class="text-muted"> — or — </span>
+ <label for="iamgeurl">Add an image URL</label>
+ <div class="form-group btn-group">
+ <input type="text" name="url" class="form-control url pull-left" style="width: 320px;" id="iamgeurl" placeholder="http://openerp.com/logo.png"/>
+ <button class="btn btn-default" type="submit">Add</button>
+ </div>
</div>
- <input type="hidden" name="func"/>
- <div class="help-block"/>
- </form>
- <div class="col-sm-4 image-preview-container">
- <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAC0lEQVQIHWP4zwAAAgEBAMVfG14AAAAASUVORK5CYII%3D"
- class="pull-right img-rounded image-preview"
- width="100%"/>
- <img src="/web/static/src/img/throbber-large.gif"
- class="pull-right img-rounded wait hidden"
- width="100%"/>
- <select class="form-control image-style">
- <option value="">No styling</option>
- <option value="img-rounded">Rounded corners</option>
- <option value="img-thumbnail">Box</option>
- <option value="img-circle">Circle</option>
- <option value="shadow">Shadow</option>
- </select>
</div>
- </div>
- <iframe src="about:blank" name="fileframe" class="hidden"/>
- </t>
+ <input type="hidden" name="func"/>
+ <div class="help-block"/>
+ <div class="existing-attachments"/>
+ </form>
+ </div>
+ <iframe src="about:blank" name="fileframe" class="hidden"/>
</t>
<t t-name="website.editor.dialog.image.existing">
<div class="modal" tabindex="-1" role="dialog" aria-hidden="true">
@@ -153,15 +189,11 @@
</t>
<t t-name="website.editor.dialog.image.existing.content">
<div class="existing-attachments">
- <ul class="pager">
- <li class="previous disabled"><a href="#">← Previous</a></li>
- <li class="next disabled"><a href="#">Next →</a></li>
- </ul>
<div class="row mt16" t-foreach="rows" t-as="row">
<div class="col-sm-2 existing-attachment-cell"
t-foreach="row" t-as="attachment">
<i class="fa fa-times existing-attachment-remove" t-att-data-id="attachment.id"/>
- <img t-att-src="attachment.website_url" t-att-alt="attachment.name" class="img img-responsive"/>
+ <img t-att-src="attachment.website_url" t-att-alt="attachment.name" t-att-title="attachment.name" class="img img-responsive"/>
</div>
</div>
</div>
@@ -174,7 +206,7 @@
<li>
<a t-attf-href="/web#model=ir.ui.view&amp;id=#{view.id}">
<t t-esc="view.name"/>
- </a> (id <t t-esc="view.id"/>)
+ </a>
</li>
</ul>
</div>
@@ -217,49 +249,42 @@
</div>
</t>
- <t t-name="website.editor.hoverbutton">
- <button type="button" contenteditable="false"
- t-attf-class="btn btn-primary hover-edition-button #{classes or ''}">
- <t t-esc="label"/>
- </button>
+ <t t-name="website.editor.hoverbutton.link">
+ <button contentEditable="false" type="button" class="btn btn-primary hover-edition-button btn-xs">Change</button>
+ </t>
+
+ <t t-name="website.editor.hoverbutton.media">
+ <div contentEditable="false" class="hover-edition dropdown">
+ <a class="btn btn-primary btn-sm" data-toggle="dropdown" href="#">Customize</a>
+ <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
+ <li><a href="#" class="hover-edition-button">Change Media</a></li>
+ <li><a href="#" class="hover-style-button">Style</a></li>
+ <li class="dropdown-submenu">
+ <a href="#" tabindex="-1">Rotation</a>
+ <ul class="dropdown-menu">
+ <li data-value="fa-spin"><a>Spin</a></li>
+ <li data-value="fa-flip-horizontal"><a>Horizontal flip</a></li>
+ <li data-value="fa-flip-vertical"><a>Vertical flip</a></li>
+ </ul>
+ </li>
+ <li><a href="#" data-value="fa-border">border</a></li>
+ </ul>
+ </div>
</t>
<t t-name="website.editor.dialog.font-icons">
- <t t-call="website.editor.dialog">
- <t t-set="title">Icon:</t>
- <form>
- <div class="form-group" id="fa-preview">
+ <form action="#">
+ <input type="hidden" id="fa-icon"/>
+ <input type="hidden" id="fa-size"/>
+ <div class="font-icons-icons">
+ <t t-call="website.editor.dialog.font-icons.icons">
+ <t t-set="icons" t-value="widget.icons"/>
+ </t>
+ </div>
+ <div class="form-group mt32" id="fa-preview">
- </div>
- <div class="form-group font-icons fa fa-search">
- <input type="hidden" id="fa-icon" class="form-control"/>
- <input type="hidden" id="fa-size" class="form-control"/>
- <input type="search" class="form-control" id="icon-search"/>
- <div class="font-icons-icons">
- <t t-call="website.editor.dialog.font-icons.icons">
- <t t-set="icons" t-value="widget.icons"/>
- </t>
- </div>
- </div>
- <div class="form-group">
- <label for="fa-rotation">Rotation</label>
- <select id="fa-rotation" class="form-control">
- <option value="">None</option>
- <option value="fa-spin">Spin</option>
- <option value="fa-rotate-90">Rotate 90º</option>
- <option value="fa-rotate-180">Rotate 180º</option>
- <option value="fa-rotate-270">Rotate 270º</option>
- <option value="fa-flip-horizontal">Horizontal flip</option>
- <option value="fa-flip-vertical">Vertical flip</option>
- </select>
- </div>
- <div class="form-group">
- <label>
- <input type="checkbox" id="fa-border"/> border
- </label>
- </div>
- </form>
- </t>
+ </div>
+ </form>
</t>
<t t-name="website.editor.dialog.font-icons.icons">
<span t-foreach="icons" t-as="icon"
@@ -269,4 +294,50 @@
</span>
</t>
+ <t t-name="website.editor.dialog.video">
+ <form action="#" class="form-inline">
+ <div class="well">
+ <div class="form-group btn-group">
+ <span class="text-muted pull-right" style="margin-left:10px; line-height: 2em;">(Youtube, Vimeo, Dailymotion)</span>
+ <label for="urlvideo" style="width: 220px; line-height: 2em;" class="pull-left">Set a video URL</label>
+ <input type="text"
+ name="url"
+ class="form-control url pull-left"
+ style="width: 400px;"
+ id="urlvideo"
+ placeholder="//www.youtube.com/embed/yws1tbgNV7k"/>
+ <button class="btn btn-default">Preview</button>
+ </div>
+ <div class="form-group btn-group">
+ <label for="urlvideo" style="width: 220px; line-height: 2em;" class="pull-left"><span class="text-muted">— or —</span> Embed Video (HTML)</label>
+ <input type="text"
+ name="embed"
+ class="form-control url pull-left"
+ style="width: 400px;"
+ id="embedvideo"
+ placeholder='&lt;iframe src="//www.youtube.com/embed/yws1tbgNV7k"&gt;&lt;/iframe&gt;'/>
+ <button class="btn btn-default">Preview</button>
+ </div>
+ </div>
+
+ <div id="video-preview" style="width: 450px; margin: 0 auto;">
+ <div class="media_iframe_video">
+ <iframe
+ src=""
+ frameborder="0"
+ allowfullscreen="allowfullscreen"></iframe>
+ </div>
+ </div>
+
+ <input type="hidden" id="video_id" value=""/>
+ <input type="hidden" id="video_type" value=""/>
+
+ <div class="text-center mt32">
+ <div class="checkbox">
+ <label><input type="checkbox" id="autoplay"/> Autoplay</label>
+ </div>
+ </div>
+ </form>
+ </t>
+
</templates>
diff --git a/addons/website/static/src/xml/website.snippets.xml b/addons/website/static/src/xml/website.snippets.xml
index c5cf94d4791..b1853f366b0 100644
--- a/addons/website/static/src/xml/website.snippets.xml
+++ b/addons/website/static/src/xml/website.snippets.xml
@@ -39,8 +39,8 @@
<div class='oe_handle e readonly'><div></div></div>
<div class='oe_handle w readonly'><div></div></div>
<div class='oe_handle size readonly'>
+ <div class="oe_handle_button auto_size">Auto Resize</div>
<div class="oe_handle_button size">Resize</div>
- <div class="oe_handle_button auto_size">x</div>
</div>
<div class='oe_handle s readonly'><div></div></div>
</div>
diff --git a/addons/website/tests/test_requests.py b/addons/website/tests/test_requests.py
index 2a22ae04445..127aea274d5 100644
--- a/addons/website/tests/test_requests.py
+++ b/addons/website/tests/test_requests.py
@@ -6,6 +6,7 @@ import werkzeug.urls
import lxml.html
+import openerp
from openerp import tools
import cases
@@ -43,15 +44,23 @@ class CrawlSuite(unittest2.TestSuite):
def __init__(self, user=None, password=None):
super(CrawlSuite, self).__init__()
- self.opener = urllib2.OpenerDirector()
- self.opener.add_handler(urllib2.UnknownHandler())
- self.opener.add_handler(urllib2.HTTPHandler())
- self.opener.add_handler(urllib2.HTTPSHandler())
- self.opener.add_handler(urllib2.HTTPCookieProcessor())
- self.opener.add_handler(RedirectHandler())
+ registry = openerp.registry(tools.config['db_name'])
+ try:
+ # switch registry to test mode, so that requests can be made
+ registry.enter_test_mode()
- self._authenticate(user, password)
- self.user = user
+ self.opener = urllib2.OpenerDirector()
+ self.opener.add_handler(urllib2.UnknownHandler())
+ self.opener.add_handler(urllib2.HTTPHandler())
+ self.opener.add_handler(urllib2.HTTPSHandler())
+ self.opener.add_handler(urllib2.HTTPCookieProcessor())
+ self.opener.add_handler(RedirectHandler())
+
+ self._authenticate(user, password)
+ self.user = user
+
+ finally:
+ registry.leave_test_mode()
def _request(self, path):
return self.opener.open(urlparse.urlunsplit([
@@ -79,37 +88,45 @@ class CrawlSuite(unittest2.TestSuite):
assert auth.getcode() < 400, "Auth failure %d" % auth.getcode()
def _wrapped_run(self, result, debug=False):
- paths = [URL('/'), URL('/sitemap')]
- seen = set(paths)
-
- while paths:
- url = paths.pop(0)
- r = self._request(url.url)
- url.to_case(self.user, r).run(result)
-
- if r.info().gettype() != 'text/html':
- continue
-
- doc = lxml.html.fromstring(r.read())
- for link in doc.xpath('//a[@href]'):
- href = link.get('href')
-
- # avoid repeats, even for links we won't crawl no need to
- # bother splitting them if we've already ignored them
- # previously
- if href in seen: continue
- seen.add(href)
-
- parts = urlparse.urlsplit(href)
-
- if parts.netloc or \
- not parts.path.startswith('/') or \
- parts.path == '/web' or\
- parts.path.startswith('/web/') or \
- (parts.scheme and parts.scheme not in ('http', 'https')):
+ registry = openerp.registry(tools.config['db_name'])
+ try:
+ # switch registry to test mode, so that requests can be made
+ registry.enter_test_mode()
+
+ paths = [URL('/'), URL('/sitemap')]
+ seen = set(paths)
+
+ while paths:
+ url = paths.pop(0)
+ r = self._request(url.url)
+ url.to_case(self.user, r).run(result)
+
+ if r.info().gettype() != 'text/html':
continue
- paths.append(URL(href, url.url))
+ doc = lxml.html.fromstring(r.read())
+ for link in doc.xpath('//a[@href]'):
+ href = link.get('href')
+
+ # avoid repeats, even for links we won't crawl no need to
+ # bother splitting them if we've already ignored them
+ # previously
+ if href in seen: continue
+ seen.add(href)
+
+ parts = urlparse.urlsplit(href)
+
+ if parts.netloc or \
+ not parts.path.startswith('/') or \
+ parts.path == '/web' or\
+ parts.path.startswith('/web/') or \
+ (parts.scheme and parts.scheme not in ('http', 'https')):
+ continue
+
+ paths.append(URL(href, url.url))
+
+ finally:
+ registry.leave_test_mode()
class URL(object):
def __init__(self, url, source=None):
diff --git a/addons/website/views/snippets.xml b/addons/website/views/snippets.xml
index 3e27ffb227f..8ade1725e4e 100644
--- a/addons/website/views/snippets.xml
+++ b/addons/website/views/snippets.xml
@@ -39,8 +39,8 @@
</div>
</div>
</div>
- <a class="carousel-control left hidden" href="#myCarousel" data-slide="prev" style="width: 10%"><span class="glyphicon glyphicon-chevron-left"><span class="hidden">.</span></span></a>
- <a class="carousel-control right hidden" href="#myCarousel" data-slide="next" style="width: 10%"><span class="glyphicon glyphicon-chevron-right"><span class="hidden">.</span></span></a>
+ <div class="carousel-control left hidden" data-target="#myCarousel" data-slide="prev" style="width: 10%"><i class="fa fa-chevron-left"></i></div>
+ <div class="carousel-control right hidden" data-target="#myCarousel" data-slide="next" style="width: 10%"><i class="fa fa-chevron-right"></i></div>
</div>
</div>
@@ -522,7 +522,7 @@
</p>
</div>
<div class="col-md-3">
- <a href="page/contactus" class="btn btn-primary btn-lg pull-right mt8">
+ <a href="/page/website.contactus" class="btn btn-primary btn-lg pull-right mt8">
<i class="fa fa-arrow-right"></i>
Contact Us Now
</a>
@@ -942,6 +942,11 @@
data-selector-children=".content">
</div>
+ <div data-snippet-option-id='separator'
+ data-selector="hr"
+ data-selector-children=".oe_structure, [data-oe-type=html]">
+ </div>
+
<div data-snippet-option-id='parallax'
data-selector=".parallax">
<li class="dropdown-submenu">
@@ -957,6 +962,27 @@
</li>
</div>
+ <div data-snippet-option-id='media'
+ data-selector="img:not(.cke_iframe), .media_iframe_video, span.fa, i.fa, .glyphicon">
+ <li><a href="#" class="edition">Change...</a></li>
+ </div>
+
+ <div data-snippet-option-id='transform'
+ data-selector="img:not(.cke_iframe), .media_iframe_video, span.fa, i.fa">
+ <li class="dropdown-submenu">
+ <a tabindex="-1" href="#">Style</a>
+ <ul class="dropdown-menu" name="parallax-scroll">
+ <li data-value="img-rounded"><a>Rounded corners</a></li>
+ <li data-value="img-thumbnail"><a>Box</a></li>
+ <li data-value="img-circle"><a>Circle</a></li>
+ <li data-value="shadow"><a>Shadow</a></li>
+ <li data-value="fa-spin"><a>Spin</a></li>
+ </ul>
+ </li>
+ <li><a href="#" class="style">Transform</a></li>
+ <li><a href="#" class="clear-style">Reset Transformation</a></li>
+ </div>
+
</template>
diff --git a/addons/website/views/website_templates.xml b/addons/website/views/website_templates.xml
index 0cfba4d14ed..a9a9173099a 100644
--- a/addons/website/views/website_templates.xml
+++ b/addons/website/views/website_templates.xml
@@ -284,6 +284,8 @@
<script t-if="not translatable" type="text/javascript" src="/website/static/src/js/website.snippets.editor.js"></script>
<script t-if="not translatable" type="text/javascript" src="/website/static/src/js/website.ace.js"></script>
<script t-if="translatable" type="text/javascript" src="/website/static/src/js/website.translator.js"></script>
+
+ <script type="text/javascript" src="/website/static/src/js/jQuery.transfo.js"></script>
</xpath>
</template>
diff --git a/addons/website_blog/__openerp__.py b/addons/website_blog/__openerp__.py
index 97c163945af..831c180d51f 100644
--- a/addons/website_blog/__openerp__.py
+++ b/addons/website_blog/__openerp__.py
@@ -30,7 +30,7 @@ OpenERP Blog
""",
'author': 'OpenERP SA',
- 'depends': ['knowledge', 'website_mail'],
+ 'depends': ['knowledge', 'website_mail', 'website_partner'],
'data': [
'data/website_blog_data.xml',
'views/website_blog_views.xml',
diff --git a/addons/website_blog/controllers/main.py b/addons/website_blog/controllers/main.py
index 5cb678b5475..e2eac59678e 100644
--- a/addons/website_blog/controllers/main.py
+++ b/addons/website_blog/controllers/main.py
@@ -1,23 +1,4 @@
# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
import datetime
import werkzeug
@@ -29,6 +10,7 @@ from openerp.addons.website.models.website import slug
from openerp.osv.orm import browse_record
from openerp.tools.translate import _
from openerp import SUPERUSER_ID
+from openerp.tools import html2plaintext
class QueryURL(object):
@@ -62,12 +44,13 @@ class QueryURL(object):
class WebsiteBlog(http.Controller):
- _blog_post_per_page = 6
- _post_comment_per_page = 6
+ _blog_post_per_page = 20
+ _post_comment_per_page = 10
def nav_list(self):
blog_post_obj = request.registry['blog.post']
- groups = blog_post_obj.read_group(request.cr, request.uid, [], ['name', 'create_date'],
+ groups = blog_post_obj.read_group(
+ request.cr, request.uid, [], ['name', 'create_date'],
groupby="create_date", orderby="create_date asc", context=request.context)
for group in groups:
begin_date = datetime.datetime.strptime(group['__domain'][0][2], tools.DEFAULT_SERVER_DATETIME_FORMAT).date()
@@ -108,35 +91,27 @@ class WebsiteBlog(http.Controller):
def blog(self, blog=None, tag=None, page=1, **opt):
""" Prepare all values to display the blog.
- :param blog: blog currently browsed.
- :param tag: tag that is currently used to filter blog posts
- :param integer page: current page of the pager. Can be the blog or
- post pager.
- :param date: date currently used to filter blog posts (dateBegin_dateEnd)
-
:return dict values: values for the templates, containing
- - 'blog_posts': list of browse records that are the posts to display
- in a given blog, if not blog_post_id
- - 'blog': browse of the current blog, if blog_id
- - 'blogs': list of browse records of blogs
- - 'pager': the pager to display posts pager in a blog
- - 'tag': current tag, if tag_id
+ - 'blog': current blog
+ - 'blogs': all blogs for navigation
+ - 'pager': pager of posts
+ - 'tag': current tag
+ - 'tags': all tags, for navigation
- 'nav_list': a dict [year][month] for archives navigation
+ - 'date': date_begin optional parameter, used in archives navigation
+ - 'blog_url': help object to create URLs
"""
date_begin, date_end = opt.get('date_begin'), opt.get('date_end')
cr, uid, context = request.cr, request.uid, request.context
blog_post_obj = request.registry['blog.post']
- blog_posts = None
-
blog_obj = request.registry['blog.blog']
blog_ids = blog_obj.search(cr, uid, [], order="create_date asc", context=context)
blogs = blog_obj.browse(cr, uid, blog_ids, context=context)
domain = []
-
if blog:
domain += [('blog_id', '=', blog.id)]
if tag:
@@ -176,35 +151,29 @@ class WebsiteBlog(http.Controller):
'post_url': post_url,
'date': date_begin,
}
- return request.website.render("website_blog.blog_post_short", values)
+ response = request.website.render("website_blog.blog_post_short", values)
+ return response
@http.route([
- '/blogpost/<model("blog.post"):blog_post>',
+ '/blog/<model("blog.blog"):blog>/post/<model("blog.post"):blog_post>',
], type='http', auth="public", website=True, multilang=True)
- def blog_post(self, blog_post, tag_id=None, page=1, enable_editor=None, **post):
+ def blog_post(self, blog, blog_post, tag_id=None, page=1, enable_editor=None, **post):
""" Prepare all values to display the blog.
- :param blog_post: blog post currently browsed. If not set, the user is
- browsing the blog and a post pager is calculated.
- If set the user is reading the blog post and a
- comments pager is calculated.
- :param blog: blog currently browsed.
- :param tag: tag that is currently used to filter blog posts
- :param integer page: current page of the pager. Can be the blog or
- post pager.
- :param date: date currently used to filter blog posts (dateBegin_dateEnd)
-
- - 'enable_editor': editor control
-
:return dict values: values for the templates, containing
- - 'blog_post': browse of the current post, if blog_post_id
- - 'blog': browse of the current blog, if blog_id
+ - 'blog_post': browse of the current post
+ - 'blog': browse of the current blog
- 'blogs': list of browse records of blogs
- - 'pager': the pager to display comments pager in a blog post
- - 'tag': current tag, if tag_id
+ - 'tag': current tag, if tag_id in parameters
+ - 'tags': all tags, for tag-based navigation
+ - 'pager': a pager on the comments
- 'nav_list': a dict [year][month] for archives navigation
+ - 'next_post': next blog post, to direct the user towards the next interesting post
"""
+ cr, uid, context = request.cr, request.uid, request.context
+ tag_obj = request.registry['blog.tag']
+ blog_post_obj = request.registry['blog.post']
date_begin, date_end = post.get('date_begin'), post.get('date_end')
pager_url = "/blogpost/%s" % blog_post.id
@@ -226,62 +195,125 @@ class WebsiteBlog(http.Controller):
post_url = QueryURL('', ['blogpost'], blogpost=blog_post, tag_id=tag_id, date_begin=date_begin, date_end=date_end)
blog_url = QueryURL('', ['blog', 'tag'], blog=blog_post.blog_id, tag=tag, date_begin=date_begin, date_end=date_end)
- cr, uid, context = request.cr, request.uid, request.context
- blog_obj = request.registry['blog.blog']
- blog_ids = blog_obj.search(cr, uid, [], context=context)
- blogs = blog_obj.browse(cr, uid, blog_ids, context=context)
+ if not blog_post.blog_id.id == blog.id:
+ return request.redirect("/blog/%s/post/%s" % (slug(blog_post.blog_id), slug(blog_post)))
- tag_obj = request.registry['blog.tag']
- tag_ids = tag_obj.search(cr, uid, [], context=context)
- tags = tag_obj.browse(cr, uid, tag_ids, context=context)
+ tags = tag_obj.browse(cr, uid, tag_obj.search(cr, uid, [], context=context), context=context)
+
+ # Find next Post
+ visited_blogs = request.httprequest.cookies.get('visited_blogs') or ''
+ visited_ids = filter(None, visited_blogs.split(','))
+ visited_ids = map(lambda x: int(x), visited_ids)
+ if blog_post.id not in visited_ids:
+ visited_ids.append(blog_post.id)
+ next_post_id = blog_post_obj.search(cr, uid, [
+ ('id', 'not in', visited_ids),
+ ], order='ranking desc', limit=1, context=context)
+ if not next_post_id:
+ next_post_id = blog_post_obj.search(cr, uid, [('id', '!=', blog.id)], order='ranking desc', limit=1, context=context)
+ next_post = next_post_id and blog_post_obj.browse(cr, uid, next_post_id[0], context=context) or False
values = {
- 'blog': blog_post.blog_id,
- 'blogs': blogs,
'tags': tags,
'tag': tag,
+ 'blog': blog,
'blog_post': blog_post,
'main_object': blog_post,
- 'pager': pager,
'nav_list': self.nav_list(),
'enable_editor': enable_editor,
+ 'next_post': next_post,
'date': date_begin,
'post_url': post_url,
'blog_url': blog_url,
+ 'pager': pager,
}
- return request.website.render("website_blog.blog_post_complete", values)
+ response = request.website.render("website_blog.blog_post_complete", values)
+ response.set_cookie('visited_blogs', ','.join(map(str, visited_ids)))
+
+ request.session[request.session_id] = request.session.get(request.session_id, [])
+ if not (blog_post.id in request.session[request.session_id]):
+ request.session[request.session_id].append(blog_post.id)
+ # Increase counter
+ blog_post_obj.write(cr, SUPERUSER_ID, [blog_post.id], {
+ 'visits': blog_post.visits+1,
+ },context=context)
+ return response
+
+ def _blog_post_message(self, user, blog_post_id=0, **post):
+ cr, uid, context = request.cr, request.uid, request.context
+ blog_post = request.registry['blog.post']
+ partner_obj = request.registry['res.partner']
+ thread_obj = request.registry['mail.thread']
+ website = request.registry['website']
+
+ public_id = website.get_public_user(cr, uid, context)
+ if uid != public_id:
+ partner_ids = [user.partner_id.id]
+ else:
+ partner_ids = blog_post._find_partner_from_emails(
+ cr, SUPERUSER_ID, 0, [post.get('email')], context=context)
+ if not partner_ids or not partner_ids[0]:
+ partner_ids = [partner_obj.create(cr, SUPERUSER_ID, {'name': post.get('name'), 'email': post.get('email')}, context=context)]
+
+ message_id = blog_post.message_post(
+ cr, SUPERUSER_ID, int(blog_post_id),
+ body=post.get('comment'),
+ type='comment',
+ subtype='mt_comment',
+ author_id=partner_ids[0],
+ path=post.get('path', False),
+ context=dict(context, mail_create_nosubcribe=True))
+ return message_id
@http.route(['/blogpost/comment'], type='http', auth="public", methods=['POST'], website=True)
def blog_post_comment(self, blog_post_id=0, **post):
cr, uid, context = request.cr, request.uid, request.context
if post.get('comment'):
- user = request.registry['res.users'].browse(cr, SUPERUSER_ID, uid, context=context)
- group_ids = user.groups_id
- group_id = request.registry["ir.model.data"].get_object_reference(cr, uid, 'website_mail', 'group_comment')[1]
- if group_id in [group.id for group in group_ids]:
- blog_post = request.registry['blog.post']
- blog_post.check_access_rights(cr, uid, 'read')
- blog_post.message_post(
- cr, SUPERUSER_ID, int(blog_post_id),
- body=post.get('comment'),
- type='comment',
- subtype='mt_comment',
- author_id=user.partner_id.id,
- context=dict(context, mail_create_nosubcribe=True))
+ user = request.registry['res.users'].browse(cr, uid, uid, context=context)
+ blog_post = request.registry['blog.post']
+ blog_post.check_access_rights(cr, uid, 'read')
+ self._blog_post_message(user, blog_post_id, **post)
return werkzeug.utils.redirect(request.httprequest.referrer + "#comments")
+ def _get_discussion_detail(self, ids, publish=False, **post):
+ cr, uid, context = request.cr, request.uid, request.context
+ values = []
+ mail_obj = request.registry.get('mail.message')
+ for message in mail_obj.browse(cr, SUPERUSER_ID, ids, context=context):
+ values.append({
+ "id": message.id,
+ "author_name": message.author_id.name,
+ "author_image": message.author_id.image and \
+ ("data:image/png;base64,%s" % message.author_id.image) or \
+ '/website_blog/static/src/img/anonymous.png',
+ "date": message.date,
+ 'body': html2plaintext(message.body),
+ 'website_published' : message.website_published,
+ 'publish' : publish,
+ })
+ return values
+
+ @http.route(['/blogpost/post_discussion'], type='json', auth="public", website=True)
+ def post_discussion(self, blog_post_id=0, **post):
+ cr, uid, context = request.cr, request.uid, request.context
+ publish = request.registry['res.users'].has_group(cr, uid, 'base.group_website_publisher')
+ user = request.registry['res.users'].browse(cr, uid, uid, context=context)
+ id = self._blog_post_message(user, blog_post_id, **post)
+ return self._get_discussion_detail([id], publish, **post)
+
@http.route('/blogpost/new', type='http', auth="public", website=True, multilang=True)
def blog_post_create(self, blog_id, **post):
cr, uid, context = request.cr, request.uid, request.context
create_context = dict(context, mail_create_nosubscribe=True)
- new_blog_post_id = request.registry['blog.post'].create(
- request.cr, request.uid, {
- 'blog_id': blog_id,
- 'name': _("Blog Post Title"),
- 'content': '',
- 'website_published': False,
- }, context=create_context)
- return werkzeug.utils.redirect("/blogpost/%s?enable_editor=1" % new_blog_post_id)
+ new_blog_post_id = request.registry['blog.post'].create(cr, uid, {
+ 'blog_id': blog_id,
+ 'name': _("Blog Post Title"),
+ 'subtitle': _("Subtitle"),
+ 'content': '',
+ 'website_published': False,
+ }, context=create_context)
+ new_blog_post = request.registry['blog.post'].browse(cr, uid, new_blog_post_id, context=context)
+ return werkzeug.utils.redirect("/blog/%s/post/%s?enable_editor=1" % (slug(new_blog_post.blog_id), slug(new_blog_post)))
@http.route('/blogpost/duplicate', type='http', auth="public", website=True)
def blog_post_copy(self, blog_post_id, **post):
@@ -293,5 +325,31 @@ class WebsiteBlog(http.Controller):
"""
cr, uid, context = request.cr, request.uid, request.context
create_context = dict(context, mail_create_nosubscribe=True)
- new_blog_post_id = request.registry['blog.post'].copy(cr, uid, blog_post_id, {}, context=create_context)
- return werkzeug.utils.redirect("/blogpost/%s?enable_editor=1" % new_blog_post_id)
+ nid = request.registry['blog.post'].copy(cr, uid, blog_post_id, {}, context=create_context)
+ new_blog_post = request.registry['blog.post'].browse(cr, uid, nid, context=context)
+ post = request.registry['blog.post'].browse(cr, uid, nid, context)
+ return werkzeug.utils.redirect("/blog/%s/post/%s?enable_editor=1" % (slug(post.blog_id), slug(new_blog_post)))
+
+ @http.route('/blogpost/get_discussion/', type='json', auth="public", website=True)
+ def discussion(self, post_id=0, path=None, count=False, **post):
+ cr, uid, context = request.cr, request.uid, request.context
+ mail_obj = request.registry.get('mail.message')
+ domain = [('res_id', '=', int(post_id)), ('model', '=', 'blog.post'), ('path', '=', path)]
+ #check current user belongs to website publisher group
+ publish = request.registry['res.users'].has_group(cr, uid, 'base.group_website_publisher')
+ if not publish:
+ domain.append(('website_published', '=', True))
+ ids = mail_obj.search(cr, SUPERUSER_ID, domain, count=count)
+ if count:
+ return ids
+ return self._get_discussion_detail(ids, publish, **post)
+
+ @http.route('/blogpost/change_background', type='json', auth="public", website=True)
+ def change_bg(self, post_id=0, image=None, **post):
+ if not post_id:
+ return False
+ return request.registry['blog.post'].write(request.cr, request.uid, [int(post_id)], {'background_image': image}, request.context)
+
+ @http.route('/blog/get_user/', type='json', auth="public", website=True)
+ def get_user(self, **post):
+ return [False if request.session.uid else True]
diff --git a/addons/website_blog/data/website_blog_data.xml b/addons/website_blog/data/website_blog_data.xml
index a5a3aa3d8c9..efc25264633 100644
--- a/addons/website_blog/data/website_blog_data.xml
+++ b/addons/website_blog/data/website_blog_data.xml
@@ -2,7 +2,8 @@
<openerp>
<data noupdate="1">
<record id="blog_blog_1" model="blog.blog">
- <field name="name">News</field>
+ <field name="name">Our News</field>
+ <field name="subtitle">Sharing our evolution with passion</field>
<field name="description">Presentation of new OpenERP features</field>
</record>
diff --git a/addons/website_blog/data/website_blog_demo.xml b/addons/website_blog/data/website_blog_demo.xml
index 913c2ddc9b1..d6827220414 100644
--- a/addons/website_blog/data/website_blog_demo.xml
+++ b/addons/website_blog/data/website_blog_demo.xml
@@ -8,329 +8,199 @@
<field name="name">functional</field>
</record>
<record id="blog_tag_2" model="blog.tag">
- <field name="name">technical</field>
- </record>
- <record id="blog_tag_3" model="blog.tag">
<field name="name">website</field>
</record>
- <record id="blog_tag_4" model="blog.tag">
- <field name="name">pos</field>
- </record>
<!-- POSTS -->
<record id="blog_post_1" model="blog.post">
- <field name="name">OpenERP v8 New Features</field>
+ <field name="name">The Future of Emails</field>
+ <field name="subtitle">Ideas behing the OpenERP communication tools.</field>
<field name="blog_id" ref="blog_blog_1"/>
<field name="tag_ids" eval="[(6, 0, [ref('blog_tag_1')])]"/>
<field name="website_published" eval="True"/>
- <field name="website_meta_keywords">OpenERP, Point of Sale, Hardware, Interface, Payment Terminal, Store</field>
- <field name="website_meta_description">Open source Point of Sale with no installation required that runs online and offline.</field>
+ <field name="website_meta_keywords">OpenERP, email</field>
+ <field name="website_meta_description">The Future of Emails</field>
+ <field name="background_image">/website_blog/static/src/img/post1.jpg</field>
<field name="content"><![CDATA[
- <section data-snippet-id='image-text'>
- <div class="container">
- <div class="row">
- <div class="col-md-6 mt16 mb16">
- <img class="img-responsive shadow" src="/website/static/src/img/image_text.jpg"/>
- </div>
- <div class="col-md-6 mt16">
- <p>
- OpenERP's Point of Sale introduces a super clean
- interface with no installation required that runs
- online and offline on modern hardwares.
- </p><p>
- It's full integration with the company inventory
- and accounting, gives you real time statistics
- without the hassle of integrating several applications.
- </p>
- </div>
- </div>
- </div>
- </section>
- <section class="mt16 mb16" data-snippet-id='text-block'>
- <div class="container">
- <div class="row">
- <div class="col-md-12 text-center mt16 mb32">
- <h2>
- Linked with Project Management
- </h2>
- <h3 class="text-muted">Infinitely flexible. Incredibly easy to use.</h3>
- </div>
- <div class="col-md-12 mb16 mt16">
- <p>
- OpenERP's <b>collaborative and realtime</b> project
- management helps your team get work done. Keep
- track of everything, from the big picture to the
- minute details, from the customer contract to the
- billing.
- </p><p>
- Organize projects around <b>your own processes</b>. Work
- on tasks and issues using the kanban view, schedule
- tasks using the gantt chart and control deadlines
- in the calendar view. Every project may have it's
- own stages allowing teams to optimize their job.
- </p>
- </div>
- </div>
- </div>
+ <section class="mt16 mb16 readable">
+ <iframe width="361" height="200" src="http://www.youtube.com/embed/EkbBFmIWoTE" frameborder="0" allowfullscreen></iframe>
+ <p>
+ Emails are broken.
+ </p><p>
+ Emails make me waste my time. But I need them.
+ Given the importance that emails have in our lives,
+ it's incredible it's still one of the only software
+ areas that did not evolve in the past 20 years!
+ </p><p>
+ Reading my inbox is the most unproductive task I do
+ on a daily basis. I have to spend one full hour a
+ day to process my emails. All the junk flows in the
+ same inbox; spams, information that doesn't matter,
+ quoted answers of quoted answers, etc. At the end
+ of the hour, only 10 emails actually requested an
+ answer from me. With a good tool, I could have done
+ my job in 10 minutes!
+ </p>
</section>
- <section class="oe_dark mt16 mb16" data-snippet-id='big-picture'>
- <div class="container">
- <div class="row">
- <div class="col-md-12 text-center mt32 mb32">
- <h2>Work with the hardware you already have...</h2>
- </div>
- <div class="col-md-12">
- <img class="img-responsive" src="/website/static/src/img/big_picture.png" style="margin: 0 auto;"/>
- </div>
- <div class="col-md-6 col-md-offset-3 mb16 mt16">
- <p class="text-center">
- <b>No installation required</b>
- </p>
- <p class="text-center">
- OpenERP's Point of Sale introduces a super clean
- interface with no installation required that runs
- online and offline on modern hardware. Laptops,
- tablets, industrial POS, it runs on everything.
- </p>
- <p class="text-center">
- <a href="/page/website.contactus">Get more information »</a>
- </p>
- </div>
- </div>
- </div>
+ <section class="mt16 mb16 readable">
+ <p>
+ At OpenERP, we build tools to bring productivity to
+ enterprises. As emails and information flows are one of
+ the biggest wastes of time in companies, we have to fix
+ this.
+ </p><p>
+ To disrupt emails, you need more than just another user
+ interface. We need to rethink the whole communication flow.
+ </p>
+ <h3>The Communication Mechanism of OpenERP</h3>
+ <p>
+ Here are the ideas behing the OpenERP communication tools:
+ </p>
+ <ul>
+ <li>
+ Get Things Done: your inbox is a
+ todo list. You should be able to process (not only
+ read) the inbox and easily mark messages for future
+ actions. Every inbox should be empty after having
+ been processed; no more overload of information.
+ <img class="img-responsive" src="/website_blog/static/src/img/mail-sc-00.png"/>
+ </li><li>
+ Keep control of what you want to receive or don't want
+ to receive. People should never receive spam. You
+ should follow/unfollow any kind of information in one
+ click.
+ </li><li>
+ Productivity is key: our smart user
+ interface does not require you to click on every mail
+ to read a thread. Reading a full thread, replying,
+ attaching documents is super fast.
+ <img class="img-responsive" src="/website_blog/static/src/img/mail-sc-03.png"/>
+ </li><li>
+ A mix of push & pull: Today, people
+ are victims of what others decide to push to them.
+ OpenERP differentiates:
+ <ul>
+ <li>
+ Messages "for information":
+ you can pull them when you need some specific
+ information; they are not required to be read
+ every day.You receive only what you decided
+ to follow.This accounts for 90% of your daily
+ emails.Use the "Inbox" menu for these.
+ </li><li>
+ Messages "for action": they
+ require your immediate attention and you need
+ to process them all. This accounts for 10%
+ of your daily emails. Use the "To: me" menu
+ for these.
+ </li>
+ </ul>
+ </li><li>
+ Focus on the Content: Everything is
+ stripped to emphasize on the real message. No more
+ welcome introductions, greetings, signatures and legal
+ notes.We standardize the layout of each message.
+ (signatures are on the profile of a contact, not in
+ every message)
+ </li><li>
+ Folders and mailing lists are great tools but too
+ complex in traditional email clients. In OpenERP, a
+ group of contacts that share a discussion can be
+ created with one click. Every group should have it's
+ own email address.
+ </li>
+ </ul>
</section>
-
]]>
</field>
</record>
<record id="blog_post_2" model="blog.post">
- <field name="name">New Hardware Integration</field>
- <field name="blog_id" ref="blog_blog_1"/>
- <field name="tag_ids" eval="[(6, 0, [ref('blog_tag_1')])]"/>
- <field name="content">
-<![CDATA[<section class="mt16 mb16" data-snippet-id='big-picture'>
- <div class="container">
- <div class="row">
- <div class="col-md-12">
- <img class="img-responsive" src="/website/static/src/img/big_picture.png" style="margin: 0 auto;"/>
- </div>
- <div class="col-md-6 col-md-offset-3 mb16 mt16">
- <p class="text-center">
- <b>New Features Launched</b>
- </p>
- <p class="text-center">
- OpenERP's Point of Sale introduces a super clean
- interface with no installation required that runs
- online and offline on modern hardware. Laptops,
- tablets, industrial POS, it runs on everything.
- </p>
- </div>
- </div>
- </div>
- </section>
- <section data-snippet-id='pricing'>
- <div class="container">
- <div class="row">
- <div class="col-md-12 text-center mt16 mb32">
- <h2>Our Offers</h2>
- </div>
-
- <div class="col-md-4">
- <div class="panel panel-info">
- <!-- Default panel contents -->
- <div class="panel-heading text-center">
- <h2 style="margin: 0">Beginner</h2>
- <p style="margin: 0" class="text-muted">
- Starter package
- </p>
- </div>
- <div class="panel-body text-center text-muted" style="background-color: rgba(0,0,0,0.1)">
- <h2 style="margin: 0"><span>$</span><b style="font-size: 60px">450</b><small>.00</small></h2>
- <div>per month</div>
- </div>
-
- <!-- List group -->
- <ul class="list-group">
- <li class="list-group-item">Battery: 8 hours</li>
- <li class="list-group-item">Screen: 2.5 inch</li>
- <li class="list-group-item">Weight: 1.1 ounces</li>
- <li class="list-group-item">No support</li>
- </ul>
- <div class="panel-footer text-center">
- <p class="text-muted">
- <i>Free shipping, satisfied or reimbursed.</i>
- </p>
- <a href="/page/website.contactus" class="btn btn-primary btn-lg">Order now</a>
- </div>
- </div>
- </div>
- <div class="col-md-4">
- <div class="panel panel-primary">
- <!-- Default panel contents -->
- <div class="panel-heading text-center">
- <h2 style="margin: 0">Professional</h2>
- <p style="margin: 0">
- Enterprise package
- </p>
- </div>
- <div class="panel-body text-center text-muted" style="background-color: rgba(0,0,0,0.1)">
- <h2 style="margin: 0"><span>$</span><b style="font-size: 60px">590</b><small>.00</small></h2>
- <div>per month</div>
- </div>
-
- <!-- List group -->
- <ul class="list-group">
- <li class="list-group-item">Battery: 12 hours</li>
- <li class="list-group-item">Screen: 2.8 inch</li>
- <li class="list-group-item">Weight: 1.2 ounces</li>
- <li class="list-group-item">Limited support</li>
- </ul>
- <div class="panel-footer text-center">
- <p class="text-muted">
- <i>Free shipping, satisfied or reimbursed.</i>
- </p>
- <a href="/page/website.contactus" class="btn btn-primary btn-lg">Order now</a>
- </div>
- </div>
- </div>
- <div class="col-md-4">
- <div class="panel panel-info">
- <!-- Default panel contents -->
- <div class="panel-heading text-center">
- <h2 style="margin: 0">Expert</h2>
- <p style="margin: 0" class="text-muted">
- The top of the top
- </p>
- </div>
- <div class="panel-body text-center text-muted" style="background-color: rgba(0,0,0,0.1)">
- <h2 style="margin: 0"><span>$</span><b style="font-size: 60px">890</b><small>.00</small></h2>
- <div>per month</div>
- </div>
-
- <!-- List group -->
- <ul class="list-group">
- <li class="list-group-item">Battery: 20 hours</li>
- <li class="list-group-item">Screen: 2.8 inch</li>
- <li class="list-group-item">Weight: 1.2 ounces</li>
- <li class="list-group-item">Unlimited support</li>
- </ul>
- <div class="panel-footer text-center">
- <p class="text-muted">
- <i>Free shipping, satisfied or reimbursed.</i>
- </p>
- <a href="/page/website.contactus" class="btn btn-primary btn-lg">Contact us</a>
- </div>
- </div>
-
- </div>
- </div>
- </div>
- </section>
-
-
-]]>
-</field>
- </record>
-
- <record id="blog_post_3" model="blog.post">
- <field name="name">Touchscreen Point of Sale for 6.1</field>
+ <field name="name">Integrating your CMS and E-Commerce</field>
+ <field name="subtitle">Building your company's website and selling your products online easy.</field>
<field name="blog_id" ref="blog_blog_1"/>
+ <field name="website_published" eval="True"/>
<field name="tag_ids" eval="[(6, 0, [ref('blog_tag_1'), ref('blog_tag_2')])]"/>
- <field name="website_meta_keywords">Point of Sale, Hardware, Interface, Payment Terminal, Store</field>
- <field name="website_meta_description">Point of Sale with no installation required that runs online and offline.</field>
+ <field name="background_image">/website_blog/static/src/img/post2.jpg</field>
<field name="content">
-<![CDATA[<p>The brand new OpenERP touchscreen point of sale is available with 6.1 which allows you
-to manage your shop sales very easily. It's fully web based so that you don't
-have to install or deploy any software and all the sales shops can be easily
-consolidated. It works in connected and disconnected modes so that you can
-continue to sell even if you lose your internet connection.</p>
-<img src="http://www.openerp.com/sites/default/files/fileattach/POS(2).png" alt="">
-<h3>Here's a summary of its main features and benefits:</h3>
-<ul>
- <li>100% WEB based</li>
- <li>available for any touchscreen device (ipod, ipad, any tablet)mobile (with portable devices)</li>
- <li>no installation required</li>
- <li>no synchronization needed, completely integrated</li>
- <li>continue working even when your connection is down or if you close your browser, data won't be lost</li>
- <li>fully web based with a clean interface smart interface</li>
-</ul>
-<p>You have different options to select your products. You can do it through the
-barcode reader, just browse through the categories you have put in place (ie.
-drinks, snacks, meals, etc.), or text search in case neither of the other
-options work for you. For example, if you need to use the POS for your restaurant,
-your employees can record multiple tickets at the same time without having to wait
-to process one transaction at a time. In addition, you can facilitate payments,
-the application allows multiple payment methods.</p>
-<p>The POS application is so simple and accessible to use that your shop or
-restaurant will never need any other tool to manage orders. Due to its smart
-and user-friendly interface you don't need any training to learn how to use it.
-Think of it as an out-of-the-box solution to boost your business' productivity.
-</p>
-]]>
-</field>
- </record>
-
- <record id="blog_post_4" model="blog.post">
- <field name="name">Announcing a New Partnership</field>
- <field name="blog_id" ref="blog_blog_1"/>
- <field name="tag_ids" eval="[(6, 0, [ref('blog_tag_1')])]"/>
- <field name="website_published" eval="True"/>
- <field name="website_meta_keywords">OpenERP, Partnership, News, Accounting</field>
- <field name="website_meta_description">Our company partners with OpenERP to develop accounting best practices.</field>
- <field name="content"><![CDATA[
- <section data-snippet-id='image-text'>
- <div class="container">
- <div class="row">
- <div class="col-md-6 mt16 mb16">
- <img class="img-responsive shadow" src="/website/static/src/img/text_image.png"/>
- </div>
- <div class="col-md-6 mt16">
- <p>
- We are proud to announce a new partnership with
- the company OpenERP. Their open source application suite
- will allow us to reach new markets, specifically in
- the accounting area.
- </p><p>
- The full integration with the company inventory
- and accounting, will give our customers real time statistics
- without the hassle of integrating several applications.
- </p>
- </div>
- </div>
+<![CDATA[<section class="row readable">
+ <div class="col-md-12 mb32">
+ <img class="img-responsive" src="/website_blog/static/src/img/CMS_WMS_screens.jpg"/>
</div>
- </section>
- <section class="mt16 mb16" data-snippet-id='text-block'>
- <div class="container">
- <div class="row">
- <div class="col-md-12 text-center mt16 mb32">
- <h2>
- OpenERP Project Management
- </h2>
- <h3 class="text-muted">Infinitely flexible. Incredibly easy to use.</h3>
- </div>
- <div class="col-md-12 mb16 mt16">
- <p>
- OpenERP's <b>collaborative and realtime</b> project
- management helps your team get work done. Keep
- track of everything, from the big picture to the
- minute details, from the customer contract to the
- billing.
- </p><p>
- Organize projects around <b>your own processes</b>. Work
- on tasks and issues using the kanban view, schedule
- tasks using the gantt chart and control deadlines
- in the calendar view. Every project may have it's
- own stages allowing teams to optimize their job.
- </p>
- </div>
- </div>
+ <div class="col-md-6 col-md-offset-3 mb16 mt16">
+ <p class="text-center">
+ New Features Launched
+ </p>
+ <p class="text-center">
+ To add to an already comprehensive set of OpenERP
+ features, a website content management system (CMS
+ or WMS) has been developed and a beta release is
+ available from today, 31st January 2014.
+ </p>
</div>
</section>
+ <section class="readable">
+ <p>
+ OpenERP claims to be 'the Open Source software that makes
+ building your company's website and selling your products
+ online easy'. So how true is this statement?
+ </p><p>
+ "OpenERP's latest launch will allow a business to go from
+ zero to trading online quicker than ever before,” Stuart
+ Mackintosh, MD of Open Source specialist and OpenERP
+ integration partner, OpusVL, explains. “The investment
+ required to have a fully automated business system is
+ dramatically reduced, enabling the small and medium
+ enterprise to compete at a level of functionality and
+ performance previously reserved for the big IT investors."
+ </p>
+ <blockquote>
+ <p>
+ "Finally, the leading edge is being brought to the masses.
+ It will now be the turn of the big players to catch up to
+ the superior technologies of the SME."
+ </p>
+ </blockquote>
+ <p>
+ "This is another clever and highly disruptive move by
+ OpenERP,which will force other technology providers to
+ take another look at the value they are providing to ensure
+ that their 'solutions' can still compete."
+ </p><p>
+ "OpenERP now competes on many fronts, with no real
+ competition out there to knock them off the top spot.
+ With the launch of their integrated CMS and Ecommerce
+ systems,it only elevates their position as one of the leading
+ lights in the open source revolution. It will be at least 5
+ years before another ERP or CMS provider will be able to
+ compete at this level due to the technology currently
+ employed by most industry providers."
+ </p>
+ <h4>Adding to industry leading technology</h4>
+ <p>
+ Like many modern website editors, with OpenERP you can edit
+ content in-line, enabling you to see exactly what you are
+ changing and ensure your changes suit the context.
+ </p><p>
+ However, unlike other web content management systems, it
+ fully integrates into the back-end database. This means
+ that when you edit a product description, image or price,
+ it updates the product database in real time, providing a
+ true self-service window into the business.
+ </p><p>
+ This provides a single source of data for your company and
+ removes the need to create offline synchronisation between
+ website and product database.
+ </p><p>
+ As it comes, there is a default website based on Bootstrap
+ 3, the latest industry standard for rapid development of
+ multi-device websites backed by Twitter, so can be directly
+ integrated with many web tools and works across all devices
+ by default.
+ </p>
+ </section>
]]>
</field>
</record>
-
-
</data>
</openerp>
diff --git a/addons/website_blog/doc/blog_blog.rst b/addons/website_blog/doc/blog_blog.rst
new file mode 100644
index 00000000000..8c5f80ab8e4
--- /dev/null
+++ b/addons/website_blog/doc/blog_blog.rst
@@ -0,0 +1,20 @@
+_blog_blog:
+
+blog.blog
+=========
+In ``blog.blog``, added field ``subtitle`` which Indicates the subtitle of blogs.
+ - ``subtitle``: fields.char('Blog Subtitle')
+
+mail.message
+============
+In ``mail.message``, added field ``discussion`` which Indicates the unique identification
+of paragraph on blog post.
+ - ``discussion``: fields.char('Discussion Unique Name')
+
+blog.post
+=========
+Fields
+++++++
+ - ``sub_title`` : contains the subtitle of every blog post.
+ - ``visits`` : Indicates the number of visits on evry blog post.
+ - ``ranking`` : Indicates the ranking on every blog post.
diff --git a/addons/website_blog/doc/changelog.rst b/addons/website_blog/doc/changelog.rst
index 8b6131b5806..42f2fd7e170 100644
--- a/addons/website_blog/doc/changelog.rst
+++ b/addons/website_blog/doc/changelog.rst
@@ -7,3 +7,29 @@ Changelog
----------------
- created ``website_blog`` menu, build on defunct document_page module.
+ - added new feature ``Inline Discussion`` , that will allow a user to comment
+ on every paragraph on blog post
+ - added new feature ``Select to Tweet``, that will alllow a user tweet a selected
+ text from blog to post , directly on twitter.
+
+
+
+WebsiteBlog(controller)
+=======================
+Methods
++++++++
+ - ``blog`` : remove routing related to date.
+ - ``blog_post`` : updated with , suggestion of next post to the user based on
+ cookie and number of views.
+ - ``discussion`` : added method , contains a detail of discussion on every paragraph,
+ if count is true it only return len of ids else return full detail.
+ def discussion(self, post_id=0, discussion=None, count=False, **post)
+ - ``post_discussion`` : added methodt, that allow to post discussion on any paragraph.
+ def post_discussion(self, blog_post_id=0, **post)
+ - ``change_bg`` : added method allow a user to change background image on blog
+ post from front-end.
+ def change_bg(self, post_id=0, image=None, **post)
+ - ``get_user`` : added method , that will return True if user is public else False.
+ def get_user(self, **post):
+ return [False if request.session.uid else True]
+
diff --git a/addons/website_blog/doc/controller.rst b/addons/website_blog/doc/controller.rst
new file mode 100644
index 00000000000..727368aab8c
--- /dev/null
+++ b/addons/website_blog/doc/controller.rst
@@ -0,0 +1,21 @@
+.. _controller:
+
+WebsiteBlog(controller)
+=======================
+Methods
++++++++
+ - ``blog`` : remove routing related to date.
+ - ``blog_post`` : updated with , suggestion of next post to the user based on
+ cookie and number of views.
+ - ``discussion`` : added method , contains a detail of discussion on every paragraph,
+ if count is true it only return len of ids else return full detail.
+ def discussion(self, post_id=0, discussion=None, count=False, **post)
+ - ``post_discussion`` : added methodt, that allow to post discussion on any paragraph.
+ def post_discussion(self, blog_post_id=0, **post)
+ - ``change_bg`` : added method allow a user to change background image on blog
+ post from front-end.
+ def change_bg(self, post_id=0, image=None, **post)
+ - ``get_user`` : added method , that will return True if user is public else False.
+ def get_user(self, **post):
+ return [False if request.session.uid else True]
+
diff --git a/addons/website_blog/models/__init__.py b/addons/website_blog/models/__init__.py
index fb5368a71c5..083e1ef6660 100644
--- a/addons/website_blog/models/__init__.py
+++ b/addons/website_blog/models/__init__.py
@@ -1 +1,2 @@
+import mail_message
import website_blog
diff --git a/addons/website_blog/models/mail_message.py b/addons/website_blog/models/mail_message.py
new file mode 100644
index 00000000000..e1b60f6ad20
--- /dev/null
+++ b/addons/website_blog/models/mail_message.py
@@ -0,0 +1,13 @@
+# -*- coding: utf-8 -*-
+
+from openerp.osv import osv, fields
+
+
+class MailMessage(osv.Model):
+ _inherit = 'mail.message'
+
+ _columns = {
+ 'path': fields.char(
+ 'Discussion Path', select=1,
+ help='Used to display messages in a paragraph-based chatter using a unique path;'),
+ }
diff --git a/addons/website_blog/models/website_blog.py b/addons/website_blog/models/website_blog.py
index e132e4c5e15..031856fff10 100644
--- a/addons/website_blog/models/website_blog.py
+++ b/addons/website_blog/models/website_blog.py
@@ -1,32 +1,15 @@
# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-Today OpenERP SA (<http://www.openerp.com>).
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
+from datetime import datetime
+import difflib
+import lxml
+import random
from openerp import tools
from openerp import SUPERUSER_ID
from openerp.osv import osv, fields
from openerp.tools.translate import _
-import difflib
-
class Blog(osv.Model):
_name = 'blog.blog'
@@ -35,12 +18,9 @@ class Blog(osv.Model):
_order = 'name'
_columns = {
- 'name': fields.char('Name', required=True),
+ 'name': fields.char('Blog Name', required=True),
+ 'subtitle': fields.char('Blog Subtitle'),
'description': fields.text('Description'),
- 'blog_post_ids': fields.one2many(
- 'blog.post', 'blog_id',
- 'Blogs',
- ),
}
@@ -52,9 +32,6 @@ class BlogTag(osv.Model):
_columns = {
'name': fields.char('Name', required=True),
- 'blog_post_ids': fields.many2many(
- 'blog.post', string='Posts',
- ),
}
@@ -62,37 +39,20 @@ class BlogPost(osv.Model):
_name = "blog.post"
_description = "Blog Post"
_inherit = ['mail.thread', 'website.seo.metadata']
- _order = 'write_date DESC'
- # maximum number of characters to display in summary
- _shorten_max_char = 250
+ _order = 'id DESC'
- def get_shortened_content(self, cr, uid, ids, name, arg, context=None):
+ def _compute_ranking(self, cr, uid, ids, name, arg, context=None):
res = {}
- for page in self.browse(cr, uid, ids, context=context):
- try:
- body_short = tools.html_email_clean(
- page.content,
- remove=True,
- shorten=True,
- max_length=self._shorten_max_char,
- expand_options={
- 'oe_expand_container_tag': 'div',
- 'oe_expand_container_class': 'oe_mail_expand text-center',
- 'oe_expand_container_content': '',
- 'oe_expand_a_href': '/blogpost/%d' % page.id,
- 'oe_expand_a_class': 'oe_mail_expand btn btn-info',
- 'oe_expand_separator_node': 'br',
- },
- protect_sections=True,
- )
- except Exception:
- body_short = False
- res[page.id] = body_short
+ for blog_post in self.browse(cr, uid, ids, context=context):
+ age = datetime.now() - datetime.strptime(blog_post.create_date, tools.DEFAULT_SERVER_DATETIME_FORMAT)
+ res[blog_post.id] = blog_post.visits * (0.5+random.random()) / max(3, age.days)
return res
_columns = {
'name': fields.char('Title', required=True, translate=True),
- 'content_image': fields.binary('Background Image'),
+ 'subtitle': fields.char('Sub Title', translate=True),
+ 'author_id': fields.many2one('res.partner', 'Author'),
+ 'background_image': fields.binary('Background Image'),
'blog_id': fields.many2one(
'blog.blog', 'Blog',
required=True, ondelete='cascade',
@@ -101,32 +61,22 @@ class BlogPost(osv.Model):
'blog.tag', string='Tags',
),
'content': fields.html('Content', translate=True),
- 'shortened_content': fields.function(
- get_shortened_content,
- type='html',
- string='Shortened Content',
- help="Shortened content of the page that serves as a summary"
- ),
# website control
'website_published': fields.boolean(
'Publish', help="Publish on the website"
),
- 'website_published_datetime': fields.datetime(
- 'Publish Date'
- ),
- # TDE TODO FIXME: when website_mail/mail_thread.py inheritance work -> this field won't be necessary
'website_message_ids': fields.one2many(
'mail.message', 'res_id',
domain=lambda self: [
- '&', ('model', '=', self._name), ('type', '=', 'comment')
+ '&', '&', ('model', '=', self._name), ('type', '=', 'comment'), ('path', '=', False)
],
string='Website Messages',
help="Website communication history",
),
- # technical stuff: history, menu (to keep ?)
'history_ids': fields.one2many(
'blog.post.history', 'post_id',
- 'History', help='Last post modifications'
+ 'History', help='Last post modifications',
+ deprecated='This field will be removed for OpenERP v9.'
),
# creation / update stuff
'create_date': fields.datetime(
@@ -145,11 +95,71 @@ class BlogPost(osv.Model):
'res.users', 'Last Contributor',
select=True, readonly=True,
),
+ 'visits': fields.integer('No of Views'),
+ 'ranking': fields.function(_compute_ranking, string='Ranking', type='float'),
}
+
_defaults = {
- 'website_published': False
+ 'name': _('Blog Post Title'),
+ 'subtitle': _('Subtitle'),
+ 'author_id': lambda self, cr, uid, ctx=None: self.pool['res.users'].browse(cr, uid, uid, context=ctx).partner_id.id,
}
+ def html_tag_nodes(self, html, attribute=None, tags=None, context=None):
+ """ Processing of html content to tag paragraphs and set them an unique
+ ID.
+ :return result: (html, mappin), where html is the updated html with ID
+ and mapping is a list of (old_ID, new_ID), where old_ID
+ is None is the paragraph is a new one. """
+ mapping = []
+ if not html:
+ return html, mapping
+ if tags is None:
+ tags = ['p']
+ if attribute is None:
+ attribute = 'data-unique-id'
+ counter = 0
+
+ # form a tree
+ root = lxml.html.fragment_fromstring(html, create_parent='div')
+ if not len(root) and root.text is None and root.tail is None:
+ return html, mapping
+
+ # check all nodes, replace :
+ # - img src -> check URL
+ # - a href -> check URL
+ for node in root.iter():
+ if not node.tag in tags:
+ continue
+ ancestor_tags = [parent.tag for parent in node.iterancestors()]
+ if ancestor_tags:
+ ancestor_tags.pop()
+ ancestor_tags.append('counter_%s' % counter)
+ new_attribute = '/'.join(reversed(ancestor_tags))
+ old_attribute = node.get(attribute)
+ node.set(attribute, new_attribute)
+ mapping.append((old_attribute, counter))
+ counter += 1
+
+ html = lxml.html.tostring(root, pretty_print=False, method='html')
+ # this is ugly, but lxml/etree tostring want to put everything in a 'div' that breaks the editor -> remove that
+ if html.startswith('<div>') and html.endswith('</div>'):
+ html = html[5:-6]
+ return html, mapping
+
+ def _postproces_content(self, cr, uid, id, content=None, context=None):
+ if content is None:
+ content = self.browse(cr, uid, id, context=context).content
+ if content is False:
+ return content
+ content, mapping = self.html_tag_nodes(content, attribute='data-chatter-id', tags=['p'], context=context)
+ for old_attribute, new_attribute in mapping:
+ if not old_attribute:
+ continue
+ msg_ids = self.pool['mail.message'].search(cr, SUPERUSER_ID, [('path', '=', old_attribute)], context=context)
+ self.pool['mail.message'].write(cr, SUPERUSER_ID, msg_ids, {'path': new_attribute}, context=context)
+ return content
+
def create_history(self, cr, uid, ids, vals, context=None):
for i in ids:
history = self.pool.get('blog.post.history')
@@ -163,12 +173,16 @@ class BlogPost(osv.Model):
def create(self, cr, uid, vals, context=None):
if context is None:
context = {}
+ if 'content' in vals:
+ vals['content'] = self._postproces_content(cr, uid, None, vals['content'], context=context)
create_context = dict(context, mail_create_nolog=True)
post_id = super(BlogPost, self).create(cr, uid, vals, context=create_context)
self.create_history(cr, uid, [post_id], vals, context)
return post_id
def write(self, cr, uid, ids, vals, context=None):
+ if 'content' in vals:
+ vals['content'] = self._postproces_content(cr, uid, None, vals['content'], context=context)
result = super(BlogPost, self).write(cr, uid, ids, vals, context)
self.create_history(cr, uid, ids, vals, context)
return result
@@ -183,10 +197,6 @@ class BlogPost(osv.Model):
})
return super(BlogPost, self).copy(cr, uid, id, default=default, context=context)
- def img(self, cr, uid, ids, field='image_small', context=None):
- post = self.browse(cr, SUPERUSER_ID, ids[0], context=context)
- return "/website/image?model=%s&field=%s&id=%s" % ('res.users', field, post.create_uid.id)
-
class BlogPostHistory(osv.Model):
_name = "blog.post.history"
@@ -215,5 +225,3 @@ class BlogPostHistory(osv.Model):
raise osv.except_osv(_('Warning!'), _('There are no changes in revisions.'))
diff = difflib.HtmlDiff()
return diff.make_table(line1, line2, "Revision-%s" % (v1), "Revision-%s" % (v2), context=True)
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/website_blog/static/lib/contentshare.js b/addons/website_blog/static/lib/contentshare.js
new file mode 100644
index 00000000000..9bfda158703
--- /dev/null
+++ b/addons/website_blog/static/lib/contentshare.js
@@ -0,0 +1,63 @@
+(function(){
+ $.fn.share = function(options) {
+ var option = $.extend($.fn.share.defaults,options);
+ $.extend($.fn.share,{
+ init : function(shareable) {
+ var self = this;
+ $.fn.share.defaults.shareable = shareable;
+ $.fn.share.defaults.shareable.on('mouseup',function(){
+ self.popOver();
+ });
+ $.fn.share.defaults.shareable.on('mousedown',function(){
+ self.destroy();
+ });
+ },
+ getContent : function() {
+ var current_url = window.location.href
+ var selected_text = this.getSelection('string').substring(0,option.maxLength-(current_url.length+option.author_name.length+7));
+ var text = encodeURIComponent('\"'+selected_text+'\" '+'--@'+option.author_name+' '+current_url)
+ return '<a onclick="window.open(\''+option.shareLink+text+'\',\'_'+option.target+'\',\'location=yes,height=570,width=520,scrollbars=yes,status=yes\')"><i class="fa fa-twitter fa-lg"/></a>';
+ },
+ getSelection : function(share) {
+ if(window.getSelection){
+ return (share=='string')?String(window.getSelection().getRangeAt(0)).replace(/\s{2,}/g, ' '):window.getSelection().getRangeAt(0);
+ }
+ else if(document.selection){
+ return (share=='string')?document.selection.createRange().text.replace(/\s{2,}/g, ' '):document.selection.createRange();
+ }
+ },
+ popOver : function() {
+ this.destroy();
+ if(this.getSelection('string').length < option.minLength)
+ return;
+ var data = this.getContent();
+ var range = this.getSelection();
+ var newNode = document.createElement("mark");
+ range.surroundContents(newNode);
+ $('mark').addClass(option.className);
+ $('.'+option.className).popover({trigger:'manual', placement: option.placement, html: true
+ , content:function(){
+ return data;
+ }
+ });
+ $('.'+option.className).popover('show');
+ },
+ destroy : function(){
+ $('.'+option.className).popover('hide');
+ $('mark').contents().unwrap();
+ $('mark').remove();
+ }
+ });
+ $.fn.share.init(this);
+ };
+
+ $.fn.share.defaults = {
+ shareLink : "http://twitter.com/intent/tweet?text=",
+ minLength : 5,
+ maxLength : 140,
+ target : "blank",
+ className : "share",
+ placement : "top",
+ };
+
+}());
diff --git a/addons/website_blog/static/src/css/website_blog.css b/addons/website_blog/static/src/css/website_blog.css
index f7355ce783d..9097e3af31f 100644
--- a/addons/website_blog/static/src/css/website_blog.css
+++ b/addons/website_blog/static/src/css/website_blog.css
@@ -9,6 +9,12 @@
display: block;
}
+.read_width {
+ max-width: 700px;
+ margin-left: auto;
+ margin-right: auto;
+}
+
.blog_content a.oe_mail_expand:after {
content: " →";
}
@@ -20,3 +26,127 @@ p.post-meta {
position: relative;
top: -5px;
}
+
+div#blog_angle_down a:hover {
+ text-decoration: none;
+}
+
+.cover {
+ -webkit-background-size: cover;
+ -moz-background-size: cover;
+ -o-background-size: cover;
+ background-size: cover;
+ background-position: center;
+ background-repeat: no-repeat;
+ background-color: black;
+ color: white;
+ position: relative;
+}
+.cover .blog_title {
+ position: absolute;
+ text-align: center;
+ top: 20%;
+ left: 0;
+ right: 0;
+}
+.cover .blog_title h1 {
+ font-weight: bold;
+}
+
+.cover_footer {
+ min-height: 350px;
+ height: 65vh;
+ cursor: pointer;
+}
+
+/*Inline Discussion */
+.discussion {
+ padding: 5px 10px 10px;
+ position: absolute;
+ top: 0;
+ left: 0;
+ line-height: 16px;
+ font-size: 13px;
+ font-weight: bold;
+ font-family: sans-serif;
+ text-align: center;
+ z-index: 7;
+}
+.discussion > a {
+ opacity: 0;
+ display: block;
+ overflow: hidden;
+ width: 20px;
+ height: 17px;
+ color: white;
+ text-decoration: none;
+ cursor: pointer;
+ background: #bbbbbb;
+ -webkit-border-radius: 2px;
+ -moz-border-radius: 2px;
+ -ms-border-radius: 2px;
+ -o-border-radius: 2px;
+ border-radius: 2px;
+ -webkit-transition: all 0.5s;
+ -moz-transition: all 0.5s;
+ -o-transition: all 0.5s;
+ transition: all 0.5s;
+}
+.discussion > a.has-comments {
+ opacity: 0.6;
+}
+
+.discussion-contain:hover .discussion > a {
+ opacity: 1;
+}
+
+.discussion > a:after {
+ border-right: 7px solid transparent;
+ border-top: 7px solid #bbbbbb;
+ right: 19px;
+ top: 22px;
+ height: 0;
+ width: 0;
+ display: block;
+ content: " ";
+ position: absolute;
+ -webkit-transition: all 0.5s;
+ -moz-transition: all 0.5s;
+ -o-transition: all 0.5s;
+ transition: all 0.5s;
+}
+.discussion:hover > a, .discussion.hovered > a {
+ opacity: 1;
+ background: #57ad68;
+}
+.discussion:hover > a:after, .discussion.hovered > a:after {
+ border-top-color: #57ad68;
+}
+
+#discussions_wrapper {
+ position: absolute;
+ top: 0;
+ left: 0;
+}
+
+#discussions_overlay {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background: rgba(0, 0, 0, 0.5);
+ z-index: 8;
+ display: none;
+}
+
+.discussion .popover-content {
+ max-height: 250px;
+ width: 250px;
+ overflow: auto;
+ font-weight: normal;
+}
+
+mark + .popover {
+ cursor: pointer;
+}
diff --git a/addons/website_blog/static/src/css/website_blog.sass b/addons/website_blog/static/src/css/website_blog.sass
index 4691dde83c2..6342c6b99a2 100644
--- a/addons/website_blog/static/src/css/website_blog.sass
+++ b/addons/website_blog/static/src/css/website_blog.sass
@@ -1,5 +1,4 @@
@charset "utf-8"
-
@import "compass/css3"
.css_website_mail
@@ -10,6 +9,11 @@
&:first-of-type
display: block
+.read_width
+ max-width: 700px
+ margin-left: auto
+ margin-right: auto
+
.blog_content
a.oe_mail_expand:after
content: " →"
@@ -20,3 +24,113 @@ p.post-meta
position: relative
top: -5px
+div#blog_angle_down
+ a:hover
+ text-decoration: none
+
+.cover
+ -webkit-background-size: cover
+ -moz-background-size: cover
+ -o-background-size: cover
+ background-size: cover
+ background-position: center
+ background-repeat: no-repeat
+ background-color: #000
+ color: #fff
+ position: relative
+ .blog_title
+ position: absolute
+ text-align: center
+ top: 20%
+ left: 0
+ right: 0
+ h1
+ font-weight: bold
+
+.cover_footer
+ min-height : 350px
+ height: 65vh
+ cursor: pointer
+
+/*Inline Discussion
+
+.discussion
+ padding: 5px 10px 10px
+ position: absolute
+ top: 0
+ left: 0
+ line-height: 16px
+ font-size: 13px
+ font-weight: bold
+ font-family: sans-serif
+ text-align: center
+ z-index: 7
+ > a
+ opacity: 0
+ display: block
+ overflow: hidden
+ width: 20px
+ height: 17px
+ color: white
+ text-decoration: none
+ cursor: pointer
+ background: #bbbbbb
+ -webkit-border-radius: 2px
+ -moz-border-radius: 2px
+ -ms-border-radius: 2px
+ -o-border-radius: 2px
+ border-radius: 2px
+ -webkit-transition: all 0.5s
+ -moz-transition: all 0.5s
+ -o-transition: all 0.5s
+ transition: all 0.5s
+ &.has-comments
+ opacity: .6
+
+.discussion-contain:hover .discussion > a
+ opacity: 1
+
+.discussion
+ > a:after
+ border-right: 7px solid transparent
+ border-top: 7px solid #bbbbbb
+ right: 19px
+ top: 22px
+ height: 0
+ width: 0
+ display: block
+ content: " "
+ position: absolute
+ -webkit-transition: all 0.5s
+ -moz-transition: all 0.5s
+ -o-transition: all 0.5s
+ transition: all 0.5s
+ &:hover > a, &.hovered > a
+ opacity: 1
+ background: #57AD68
+ &:hover > a:after, &.hovered > a:after
+ border-top-color: #57AD68
+
+#discussions_wrapper
+ position: absolute
+ top: 0
+ left: 0
+
+#discussions_overlay
+ position: fixed
+ top: 0
+ left: 0
+ right: 0
+ bottom: 0
+ background: rgba(0, 0, 0, 0.5)
+ z-index: 8
+ display: none
+
+.discussion .popover-content
+ max-height: 250px
+ width: 250px
+ overflow: auto
+ font-weight: normal
+
+mark + .popover
+ cursor: pointer
diff --git a/addons/website_blog/static/src/img/CMS_WMS_screens.jpg b/addons/website_blog/static/src/img/CMS_WMS_screens.jpg
new file mode 100644
index 00000000000..08fc4aafc41
--- /dev/null
+++ b/addons/website_blog/static/src/img/CMS_WMS_screens.jpg
Binary files differ
diff --git a/addons/website_blog/static/src/img/anonymous.png b/addons/website_blog/static/src/img/anonymous.png
new file mode 100644
index 00000000000..6461bf735f1
--- /dev/null
+++ b/addons/website_blog/static/src/img/anonymous.png
Binary files differ
diff --git a/addons/website_blog/static/src/img/mail-sc-00.png b/addons/website_blog/static/src/img/mail-sc-00.png
new file mode 100644
index 00000000000..dbb14b4da36
--- /dev/null
+++ b/addons/website_blog/static/src/img/mail-sc-00.png
Binary files differ
diff --git a/addons/website_blog/static/src/img/mail-sc-03.png b/addons/website_blog/static/src/img/mail-sc-03.png
new file mode 100644
index 00000000000..3011ef129b5
--- /dev/null
+++ b/addons/website_blog/static/src/img/mail-sc-03.png
Binary files differ
diff --git a/addons/website_blog/static/src/img/post1.jpg b/addons/website_blog/static/src/img/post1.jpg
new file mode 100644
index 00000000000..f3e3aa852a6
--- /dev/null
+++ b/addons/website_blog/static/src/img/post1.jpg
Binary files differ
diff --git a/addons/website_blog/static/src/img/post2.jpg b/addons/website_blog/static/src/img/post2.jpg
new file mode 100644
index 00000000000..8f6002a40db
--- /dev/null
+++ b/addons/website_blog/static/src/img/post2.jpg
Binary files differ
diff --git a/addons/website_blog/static/src/js/website_blog.editor.js b/addons/website_blog/static/src/js/website_blog.editor.js
index 1c5deef56f7..103b2bee1e7 100644
--- a/addons/website_blog/static/src/js/website_blog.editor.js
+++ b/addons/website_blog/static/src/js/website_blog.editor.js
@@ -27,7 +27,38 @@
}).then(function (cat_id) {
document.location = '/blogpost/new?blog_id=' + cat_id;
});
- }
+ },
}),
+ edit: function () {
+ $('.popover').remove();
+ this._super();
+ var vHeight = $(window).height();
+ $('body').on('click','#change_cover',_.bind(this.change_bg,{},vHeight));
+ $('body').on('click', '#clear_cover',_.bind(this.clean_bg,{},vHeight));
+ },
+ save : function() {
+ var res = this._super();
+ if ($('.cover').length) {
+ openerp.jsonRpc("/blogpost/change_background", 'call', {
+ 'post_id' : $('#blog_post_name').attr('data-oe-id'),
+ 'image' : $('.cover').css('background-image').replace(/url\(|\)|"|'/g,''),
+ });
+ }
+ return res;
+ },
+ clean_bg : function(vHeight) {
+ $('.js_fullheight').css({"background-image":'none', 'min-height': vHeight});
+ },
+ change_bg : function(vHeight) {
+ var self = this;
+ var editor = new website.editor.ImageDialog();
+ editor.on('start', self, function (o) {
+ o.url = $('.js_fullheight').length ? $('.js_fullheight').css('background-image').replace(/url\(|\)|"|'/g,'') : '';
+ });
+ editor.on('save', self, function (o) {
+ $('.js_fullheight').css({"background-image": o.url && o.url !== "" ? 'url(' + o.url + ')' : "", 'min-height': vHeight})
+ });
+ editor.appendTo('body');
+ },
});
})();
diff --git a/addons/website_blog/static/src/js/website_blog.inline.discussion.js b/addons/website_blog/static/src/js/website_blog.inline.discussion.js
new file mode 100644
index 00000000000..56851c3939c
--- /dev/null
+++ b/addons/website_blog/static/src/js/website_blog.inline.discussion.js
@@ -0,0 +1,199 @@
+// Inspired from https://github.com/tsi/inlineDisqussions
+(function () {
+
+ 'use strict';
+
+ var website = openerp.website,
+ qweb = openerp.qweb;
+ website.add_template_file('/website_blog/static/src/xml/website_blog.inline.discussion.xml');
+ website.blog_discussion = openerp.Class.extend({
+ init: function(options) {
+ var self = this ;
+ self.discus_identifier;
+ var defaults = {
+ position: 'right',
+ post_id: $('#blog_post_name').attr('data-blog-id'),
+ content : false,
+ public_user: false,
+ };
+ self.settings = $.extend({}, defaults, options);
+ self.do_render(self);
+ },
+ do_render: function(data) {
+ var self = this;
+ if ($('#discussions_wrapper').length === 0 && self.settings.content.length > 0) {
+ $('<div id="discussions_wrapper"></div>').insertAfter($('#blog_content'));
+ }
+ // Attach a discussion to each paragraph.
+ $(self.settings.content).each(function(i) {
+ self.discussion_handler(i, $(this));
+ });
+ // Hide the discussion.
+ $('html').click(function(event) {
+ if($(event.target).parents('#discussions_wrapper, .main-discussion-link-wrp').length === 0) {
+ self.hide_discussion();
+ }
+ if(!$(event.target).hasClass('discussion-link') && !$(event.target).parents('.popover').length){
+ if($('.move_discuss').length){
+ $('[enable_chatter_discuss=True]').removeClass('move_discuss');
+ $('[enable_chatter_discuss=True]').animate({
+ 'marginLeft': "+=40%"
+ });
+ $('#discussions_wrapper').animate({
+ 'marginLeft': "+=250px"
+ });
+ }
+ }
+ });
+ },
+ prepare_data : function(identifier, comment_count) {
+ var self = this;
+ return openerp.jsonRpc("/blogpost/get_discussion/", 'call', {
+ 'post_id': self.settings.post_id,
+ 'path': identifier,
+ 'count': comment_count, //if true only get length of total comment, display on discussion thread.
+ })
+ },
+ discussion_handler : function(i, node) {
+ var self = this;
+ var identifier = node.attr('data-chatter-id');
+ if (identifier) {
+ self.prepare_data(identifier, true).then( function (data) {
+ self.prepare_discuss_link(data, identifier, node);
+ });
+ }
+ },
+ prepare_discuss_link : function(data, identifier, node) {
+ var self = this;
+ var cls = data > 0 ? 'discussion-link has-comments' : 'discussion-link';
+ var a = $('<a class="'+ cls +' css_editable_mode_hidden" />')
+ .attr('data-discus-identifier', identifier)
+ .attr('data-discus-position', self.settings.position)
+ .text(data > 0 ? data : '+')
+ .attr('data-contentwrapper', '.mycontent')
+ .wrap('<div class="discussion" />')
+ .parent()
+ .appendTo('#discussions_wrapper');
+ a.css({
+ 'top': node.offset().top,
+ 'left': self.settings.position == 'right' ? node.outerWidth() + node.offset().left: node.offset().left - a.outerWidth()
+ });
+ // node.attr('data-discus-identifier', identifier)
+ node.mouseover(function() {
+ a.addClass("hovered");
+ }).mouseout(function() {
+ a.removeClass("hovered");
+ });
+
+ a.delegate('a.discussion-link', "click", function(e) {
+ e.preventDefault();
+ if(!$('.move_discuss').length){
+ $('[enable_chatter_discuss=True]').addClass('move_discuss');
+ $('[enable_chatter_discuss=True]').animate({
+ 'marginLeft': "-=40%"
+ });
+ $('#discussions_wrapper').animate({
+ 'marginLeft': "-=250px"
+ });
+ }
+ if ($(this).is('.active')) {
+ e.stopPropagation();
+ self.hide_discussion();
+ }
+ else {
+ self.get_discussion($(this), function(source) {});
+ }
+ });
+ },
+ get_discussion : function(source, callback) {
+ var self = this;
+ var identifier = source.attr('data-discus-identifier');
+ self.hide_discussion();
+ self.discus_identifier = identifier;
+ var elt = $('a[data-discus-identifier="'+identifier+'"]');
+ elt.append(qweb.render("website.blog_discussion.popover", {'identifier': identifier , 'options': self.settings}));
+ var comment = '';
+ self.prepare_data(identifier,false).then(function(data){
+ _.each(data, function(res){
+ comment += qweb.render("website.blog_discussion.comment", {'res': res});
+ });
+ $('.discussion_history').html('<ul class="media-list">'+comment+'</ul>');
+ self.create_popover(elt, identifier);
+ // Add 'active' class.
+ $('a.discussion-link, a.main-discussion-link').removeClass('active').filter(source).addClass('active');
+ elt.popover('hide').filter(source).popover('show');
+ callback(source);
+ });
+ },
+ create_popover : function(elt, identifier) {
+ var self = this;
+ elt.popover({
+ placement:'right',
+ trigger:'manual',
+ html:true, content:function(){
+ return $($(this).data('contentwrapper')).html();
+ }
+ }).parent().delegate(self).on('click','button#comment_post',function(e) {
+ e.stopImmediatePropagation();
+ self.post_discussion(identifier);
+ });
+ },
+ validate : function(public_user){
+ var comment = $(".popover textarea#inline_comment").val();
+ if (public_user){
+ var author_name = $('.popover input#author_name').val();
+ var author_email = $('.popover input#author_email').val();
+ if(!comment || !author_name || !author_email){
+ if (!author_name)
+ $('div#author_name').addClass('has-error');
+ else
+ $('div#author_name').removeClass('has-error');
+ if (!author_email)
+ $('div#author_email').addClass('has-error');
+ else
+ $('div#author_email').removeClass('has-error');
+ if(!comment)
+ $('div#inline_comment').addClass('has-error');
+ else
+ $('div#inline_comment').removeClass('has-error');
+ return false
+ }
+ }
+ else if(!comment) {
+ $('div#inline_comment').addClass('has-error');
+ return false
+ }
+ $("div#inline_comment").removeClass('has-error');
+ $('div#author_name').removeClass('has-error');
+ $('div#author_email').removeClass('has-error');
+ $(".popover textarea#inline_comment").val('');
+ $('.popover input#author_name').val('');
+ $('.popover input#author_email').val('');
+ return [comment, author_name, author_email]
+ },
+ post_discussion : function(identifier) {
+ var self = this;
+ var val = self.validate(self.settings.public_user)
+ if(!val) return
+ openerp.jsonRpc("/blogpost/post_discussion", 'call', {
+ 'blog_post_id': self.settings.post_id,
+ 'path': self.discus_identifier,
+ 'comment': val[0],
+ 'name' : val[1],
+ 'email': val[2],
+ }).then(function(res){
+ $(".popover ul.media-list").prepend(qweb.render("website.blog_discussion.comment", {'res': res[0]}))
+ var ele = $('a[data-discus-identifier="'+ self.discus_identifier +'"]');
+ ele.text(_.isNaN(parseInt(ele.text())) ? 1 : parseInt(ele.text())+1)
+ ele.addClass('has-comments');
+ });
+ },
+ hide_discussion : function() {
+ var self = this;
+ $('a[data-discus-identifier="'+ self.discus_identifier+'"]').popover('destroy');
+ $('a.discussion-link').removeClass('active');
+ }
+
+ });
+
+})();
diff --git a/addons/website_blog/static/src/js/website_blog.js b/addons/website_blog/static/src/js/website_blog.js
new file mode 100644
index 00000000000..3217bf1a04d
--- /dev/null
+++ b/addons/website_blog/static/src/js/website_blog.js
@@ -0,0 +1,40 @@
+$(document).ready(function() {
+
+ function page_transist(event) {
+ event.preventDefault();
+ newLocation = $('.js_next')[0].href;
+ var top = $('.cover_footer').offset().top;
+ $('.cover_footer').animate({
+ height: $(window).height()+'px'
+ }, 300);
+ $('html, body').animate({
+ scrollTop: top
+ }, 300, 'swing', function() {
+ window.location.href = newLocation;
+ });
+ }
+ function animate(event) {
+ event.preventDefault();
+ event.stopImmediatePropagation();
+ var target = $(this.hash);
+ $('html, body').stop().animate({
+ 'scrollTop': target.offset().top - 32
+ }, 500, 'swing', function () {
+ window.location.hash = 'blog_content';
+ });
+ }
+
+ var content = $("div[enable_chatter_discuss='True']").find('p[data-chatter-id]');
+ if (content) {
+ openerp.jsonRpc("/blog/get_user/", 'call', {}).then(function(data){
+ $('#discussions_wrapper').empty();
+ new openerp.website.blog_discussion({'content' : content, 'public_user':data[0]});
+ });
+ }
+
+ $('.js_fullheight').css('min-height', $(window).height());
+ $(".js_tweet").share({'author_name':$('#blog_author').text()});
+ $('.cover_footer').on('click',page_transist);
+ $('a[href^="#blog_content"]').on('click', animate);
+
+});
diff --git a/addons/website_blog/static/src/xml/website_blog.inline.discussion.xml b/addons/website_blog/static/src/xml/website_blog.inline.discussion.xml
new file mode 100644
index 00000000000..8c1cda26265
--- /dev/null
+++ b/addons/website_blog/static/src/xml/website_blog.inline.discussion.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<templates id="template" xml:space="preserve">
+ <t t-name="website.blog_discussion.comment">
+ <li class="media">
+ <div class="pull-left">
+ <img class="media-object img-circle" t-att-src="res.author_image" style="width: 30px;"/>
+ </div>
+ <div t-attf-class="pull-right btn-group js_publish_management #{res.website_published and 'css_published' or 'css_unpublished'} #{res.publish ? '' : 'hidden'}" data-object="mail.message" t-att-data-id="res.id">
+ <button class="btn btn-danger btn-xs js_publish_btn">Not Published</button>
+ <button class="btn btn-success btn-xs js_publish_btn">Published</button>
+ </div>
+ <div class="media-body">
+ <div t-esc='res.body'/>
+ <small class="text-muted">
+ by
+ <span t-esc='res.author_name'/>
+ </small>
+ </div>
+ </li>
+ </t>
+ <t t-name="website.blog_discussion.popover">
+ <div class="mycontent hidden">
+ <input name="discussion" t-att-value="identifier" type="hidden"/>
+ <input name="blog_post_id" t-att-value="options.post_id" type="hidden"/>
+ <div id="inline_comment">
+ <textarea class="mb8 form-control" rows="2" id="inline_comment" placeholder="Write a comment..."/>
+ </div>
+ <div id="author_name">
+ <input id="author_name" name="user_name" t-attf-class="form-control #{options.public_user ? '' : 'hidden'}" placeholder="Your name..."/>
+ </div>
+ <div id="author_email">
+ <input id="author_email" name="user_email" t-attf-class="mt8 mb8 form-control #{options.public_user ? '' : 'hidden'}" placeholder="Your Email..."/>
+ </div>
+ <button id='comment_post' class="btn btn-primary btn-xs mb8">Post</button>
+ <div class="discussion_history"/>
+ </div>
+ </t>
+</templates>
diff --git a/addons/website_blog/views/website_blog_templates.xml b/addons/website_blog/views/website_blog_templates.xml
index 1fd1d7adfa9..fa6c6af53c6 100644
--- a/addons/website_blog/views/website_blog_templates.xml
+++ b/addons/website_blog/views/website_blog_templates.xml
@@ -21,21 +21,17 @@
<t t-call="website.layout">
<div id="wrap">
<div class="oe_structure"/>
- <section groups="base.group_website_publisher">
- <div class="container text-center mt16">
- <div class="alert alert-warning alert-dismissable">
- <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&amp;times;</button>
- <p>
- This page is great to improve your <strong>Search Engine Optimization</strong>;
- You can review titles, keywords and descriptions of all blogs at once.
- </p><p>
- You should <strong>add a banner on the top</strong> as it is a frequent landing page for new visitors.
- <span class="text-muted">This box will not be visible to your visitors.</span>
- </p>
- </div>
- </div>
- </section>
<section class="container">
+ <div class="alert alert-warning alert-dismissable mt16" groups="base.group_website_publisher">
+ <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&amp;times;</button>
+ <p>
+ This page is great to improve your <strong>Search Engine Optimization</strong>;
+ You can review titles, keywords and descriptions of all blogs at once.
+ </p><p>
+ You should <strong>add a banner on the top</strong> as it is a frequent landing page for new visitors.
+ <span class="text-muted">This box will not be visible to your visitors.</span>
+ </p>
+ </div>
<t t-call="website.pager" >
<t t-set="classname">pull-right</t>
</t>
@@ -93,55 +89,80 @@
</t>
</template>
-
-<!-- Blog Post Summary -->
-<template id="blog_post_short" name="Blog Post Summary">
+<!-- Blog Post List: Displaying a list of Blog Posts -->
+<template id="blog_post_short" name="Blog Posts">
<t t-call="website_blog.index">
- <div t-if="not blog_posts" class="container mb64">
- <p class="css_editable_hidden">
- <h1>No blog post yet.</h1>
- </p>
- <t groups="base.group_website_publisher">
- <t groups="base.group_document_user">
- <p>Click on "Content" on the top menu to write your first blog post.</p>
- </t>
- </t>
- </div>
- <t t-foreach="blog_posts" t-as="blog_post">
- <div t-att-data-publish="blog_post.website_published and 'on' or 'off'">
- <h2 class="text-center">
- <a t-attf-href="#{post_url(blogpost=blog_post)}" t-field="blog_post.name"></a>
- </h2>
- <p class="post-meta text-muted text-center" name='blog_post_data'>
- <span class="fa fa-calendar oe_date"> <span t-field="blog_post.create_date"/> &amp;nbsp;</span>
- <span t-if="len(blog_post.message_ids) &gt; 0" class="fa fa-comment-o">
- <a t-attf-href="#{post_url(blogpost=blog_post)}#comments">
- <t t-if="len(blog_post.message_ids) &lt;= 1" ><t t-esc="len(blog_post.message_ids)"/> comment</t>
- <t t-if="len(blog_post.message_ids) > 1"><t t-esc="len(blog_post.message_ids)"/> comments</t>
- </a>
- </span>
- <span t-if="not blog_post.website_published" class="label label-danger">not published</span>
- </p>
- <div t-raw="blog_post.shortened_content" class="blog_content"/>
- <hr/>
- </div>
+ <div class="oe_structure">
+ <section class="mb0">
+ <div class="container">
+ <div class="row">
+ <t t-call="website.pager" >
+ <t t-set="classname">pull-right</t>
+ </t>
+ <div class="col-md-12 mb32 mt16 text-center">
+ <h1 t-field="blog.name"/>
+ <h3 class="text-muted" t-field="blog.subtitle"/>
+ </div>
+ </div>
+ </div>
+ </section>
+ </div>
+ <div class="container">
+ <div class="row">
+ <div class="col-md-8 col-md-offset-2" t-ignore="True" id="main_column">
- </t>
- </t>
-</template>
+ <div t-if="not blog_posts" class="container mb64">
+ <p class="css_editable_hidden">
+ <h1>No blog post yet.</h1>
+ </p>
+ <p groups="base.group_document_user">
+ Click on "Content" on the top menu to write your first blog post.
+ </p>
+ </div>
-<!-- Options: Blog Post Summary: hide author -->
-<template id="opt_blog_post_short_author" name="Author"
- inherit_option_id="website_blog.blog_post_short">
- <xpath expr="//span[@class='fa fa-calendar oe_date']" position="after">
- <span class="fa fa-user"> By <span t-field="blog_post.create_uid"/> &amp;nbsp;</span>
- </xpath>
+ <div t-foreach="blog_posts" t-as="blog_post" class="mb32">
+
+ <img class="img-circle pull-right mt16"
+ t-att-src="'/website/image?model=res.partner&amp;field=image_small&amp;id='+str(blog_post.author_id.id)"
+ style="width: 50px;"/>
+
+ <a t-attf-href="/blog/#{ slug(blog_post.blog_id) }/post/#{ slug(blog_post) }">
+ <h2 t-field="blog_post.name" class="mb4"/>
+ </a>
+
+ <div class="text-muted">
+ <h4
+ t-field="blog_post.subtitle"
+ class="mb4 mt4"/>
+ <div name='blog_post_data' class='mb0'>
+ <span t-field="blog_post.author_id" style="display: inline-block;" t-field-options='{
+ "widget": "contact",
+ "fields": ["name"]
+ }'/>
+ &#5760; <span t-field="blog_post.create_date" t-field-options='{"format": "MMMM yyyy"}'/>
+ <span t-if="len(blog_post.message_ids) &gt; 0">
+ &#5760; <t t-esc="len(blog_post.message_ids)"/>
+ <t t-if="len(blog_post.message_ids) &lt;= 1" >comment</t>
+ <t t-if="len(blog_post.message_ids) > 1">comments</t>
+ </span>
+
+ <span t-if="not blog_post.website_published" class="label label-danger">not published</span>
+ </div>
+ </div>
+
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div class="oe_structure"/>
+ </t>
</template>
-<!-- Option: Blog Post Summary: show tags -->
+<!-- Option: Blog Post List: show tags -->
<template id="opt_blog_post_short_tags" name="Tags"
inherit_option_id="website_blog.blog_post_short" inherit_id="website_blog.blog_post_short">
- <xpath expr="//p[@name='blog_post_data']" position="after">
+ <xpath expr="//div[@name='blog_post_data']" position="inside">
<p class="post-meta text-muted text-center" t-if="len(blog_post.tag_ids)">
<span class="fa fa-tags"/>
<t t-foreach="blog_post.tag_ids" t-as="tag">
@@ -153,56 +174,95 @@
<!-- Blog Post Complete -->
<template id="blog_post_complete" name="Blog Post">
- <t t-call="website_blog.index">
+ <t t-call="website_blog.index">
- <t t-call="website.publish_management">
- <t t-set="object" t-value="blog_post"/>
- <t t-set="publish_edit" t-value="True"/>
- <t t-set="action" t-value="'website_blog.action_blog_post'"/>
- <li>
- <form class="duplicate hidden" action="/blogpost/duplicate">
- <input name="blog_post_id" t-att-value="blog_post.id"/>
- </form>
- <a href="#" class="duplicate" onclick="$(this).prev('form').submit()">Duplicate</a>
- </li>
- </t>
-
- <div id="title">
- <h1 class="text-center" t-field="blog_post.name"/>
- <p class="post-meta text-muted text-center" name="blog_post_data">
- <span class="fa fa-calendar oe_date"> <span t-field="blog_post.create_date"/> &amp;nbsp;</span>
- <span t-if="len(blog_post.message_ids) &gt; 0" class="fa fa-comment-o"> With
- <a t-attf-href="#comments">
- <t t-if="len(blog_post.message_ids) &lt;= 1" ><t t-esc="len(blog_post.message_ids)"/> comment</t>
- <t t-if="len(blog_post.message_ids) > 1"><t t-esc="len(blog_post.message_ids)"/> comments</t>
+ <div class="cover js_fullheight" id="title" t-attf-style="background-image: url(#{blog_post.background_image})" t-ignore="True">
+ <div class="container">
+ <div class="container text-right mt16">
+ <div class="btn-group css_non_editable_mode_hidden">
+ <a id="change_cover" class="btn btn-primary">
+ Change Cover
</a>
- </span>
- </p>
+ <a id="clear_cover" class="btn btn-danger">
+ <span class="fa fa-times"/>
+ </a>
+ </div>
+ <t t-call="website.publish_management">
+ <t t-set="object" t-value="blog_post"/>
+ <t t-set="publish_edit" t-value="True"/>
+ <li>
+ <form class="duplicate hidden" action="/blogpost/duplicate">
+ <input name="blog_post_id" t-att-value="blog_post.id"/>
+ </form>
+ <a href="#" class="duplicate" onclick="$(this).prev('form').submit()">Duplicate</a>
+ </li>
+ </t>
+ </div>
+ </div>
+ <div class="blog_title">
+ <h1 t-field="blog_post.name" id="blog_post_name" t-att-data-blog-id="blog_post.id"/>
+ <h2 t-field="blog_post.subtitle"/>
+ <p class="post-meta text-muted text-center" name="blog_post_data"/>
+ <div>
+ <img class="img-circle" t-att-src="'/website/image?model=res.partner&amp;field=image_small&amp;id='+str(blog_post.author_id.id)" style="width: 30px; margin-right: 10px;"/>
+ <span t-field="blog_post.author_id" style="display: inline-block;" t-field-options='{
+ "widget": "contact",
+ "fields": ["name"]
+ }'/>
+ </div>
+ <div t-if="blog_post.background_image" id="blog_angle_down">
+ <strong><a href="#blog_content" class="fa fa-angle-down fa-3x fa-inverse mt32"/></strong>
+ </div>
+ </div>
</div>
- <div t-field="blog_post.content"/>
+ <div id="blog_content" t-field="blog_post.content" class="mt32"/>
- <section id="comments" class="container">
+ <section id="comments" class="read_width">
+ <hr/>
<ul class="media-list" id="comments-list">
<li t-foreach="blog_post.website_message_ids" t-as="message" class="media">
+ <span class="pull-left">
+ <img class="media-object img img-circle" t-att-src="'/website/image?model=mail.message&amp;field=author_avatar&amp;id='+str(message.id)" style="width: 30px"/>
+ </span>
<div class="media-body">
- <img class="media-object pull-left" t-att-src="'/website/image?model=res.partner&amp;field=image_small&amp;id='+str(message.author_id.id)" style="width: 50px; margin-right: 10px;"/>
- <div class="media-body">
- <t t-call="website.publish_short">
- <t t-set="object" t-value="message"/>
- </t>
- <h5 class="media-heading">
- <span t-field="message.author_id"/> <small>on <span t-field="message.date"/></small>
- </h5>
- <div t-field="message.body"/>
- </div>
+ <t t-call="website.publish_short">
+ <t t-set="object" t-value="message"/>
+ </t>
+ <!-- <strong t-field="message.author_id"/> -->
+ <span t-field="message.author_id" style="display: inline-block;" t-field-options='{
+ "widget": "contact",
+ "fields": ["name"]
+ }'/>
+ <span class="text-muted">on <span t-field="message.date"/></span>
+ <div t-field="message.body"/>
</div>
</li>
</ul>
</section>
+
+ <t t-if="next_post">
+ <div class="cover cover_footer mb0 text-center" t-attf-style="background-image: url(#{next_post.background_image})" t-ignore="True">
+ <div class="blog_title">
+ <a class="hidden js_next" t-attf-href="/blog/#{ slug(next_post.blog_id) }/post/#{ slug(next_post) }/#wrap"/>
+ <h1 t-field="next_post.name"/>
+ <h2 t-field="next_post.subtitle"/>
+ <div>
+ <img class="img-circle" t-att-src="'/website/image?model=res.partner&amp;field=image_small&amp;id='+str(next_post.author_id.id)" style="width: 30px; margin-right: 10px;"/>
+ <span t-field="next_post.author_id" style="display: inline-block;" t-field-options='{
+ "widget": "contact",
+ "fields": ["name"]
+ }'/>
+ </div>
+ <p class="mt32">Read Next <span class="fa fa-long-arrow-right"/></p>
+ </div>
+ </div>
</t>
+
+ </t>
</template>
+<!-- Options: Blog Post: breadcrumb -->
<template id="blog_breadcrumb" name="Breadcrumb"
inherit_option_id="website_blog.blog_post_complete">
<xpath expr="//div[@id='title']" position="before">
@@ -222,39 +282,44 @@
</xpath>
</template>
-
<!-- Options: Blog Post: user can reply -->
-<template id="opt_blog_post_complete_comment" name="Allow Comments"
- inherit_option_id="website_blog.blog_post_complete" inherit_id="website_blog.blog_post_complete"
+<template id="opt_blog_post_complete_comment" name="Allow blog post comment"
+ inherit_option_id="website_blog.blog_post_complete"
groups="website_mail.group_comment">
<xpath expr="//ul[@id='comments-list']" position="before">
- <section class="mb32 css_editable_mode_hidden">
+ <section class="mb32 read_width css_editable_mode_hidden">
<form id="comment" t-attf-action="/blogpost/comment" method="POST">
- <input name="blog_post_id" t-att-value="blog_post.id" type="hidden"/>
- <img class="img pull-left img-rounded" t-att-src="'/website/image?model=res.partner&amp;field=image_small&amp;id='+str(user_id.partner_id.id)" style="width: 50px; margin-right: 10px;"/>
- <div class="pull-left mb32" style="width: 75%%">
- <textarea rows="3" name="comment" class="form-control" placeholder="Write a comment..."></textarea>
- <button type="submit" class="btn btn-primary mt8">Post</button>
+ <div class="media">
+ <span class="pull-left">
+ <img class="img img-circle media-object" t-att-src="'/website/image?model=res.partner&amp;field=image_small&amp;id='+str(user_id.partner_id.id)" style="width: 30px"/>
+ </span>
+ <div class="media-body">
+ <input name="blog_post_id" t-att-value="blog_post.id" type="hidden"/>
+ <textarea rows="3" name="comment" class="form-control" placeholder="Write a comment..."></textarea>
+ <button type="submit" class="btn btn-primary mt8">Post</button>
+ </div>
</div>
</form>
</section>
- <div class="clearfix"/>
</xpath>
</template>
-<!-- Options: Blog Post: hide author -->
-<template id="opt_blog_post_complete_author" name="Authors"
+<!-- Options: Blog Post: user can select text for tweet -->
+<template id="opt_blog_post_select_to_tweet" name="Select to Tweet"
inherit_option_id="website_blog.blog_post_complete">
- <xpath expr="//span[@class='fa fa-calendar oe_date']" position="after">
- <span class="fa fa-user"> By <span t-field="blog_post.create_uid"/> &amp;nbsp;</span>
+ <xpath expr="//div[@id='blog_content']" position="attributes">
+ <attribute name="class">js_tweet mt32</attribute>
+ </xpath>
+ <xpath expr="//div[@id='title']//div[@class='blog_title']" position="attributes">
+ <attribute name="class">blog_title js_tweet</attribute>
</xpath>
</template>
-<!-- Options: Blog Post: show blog -->
-<template id="opt_blog_post_complete_blog" name="Blog"
+<!-- Options: Blog Post: user can add Inline Discussion -->
+<template id="opt_blog_post_inline_discussion" name="Allow comment in text"
inherit_option_id="website_blog.blog_post_complete">
- <xpath expr="//span[@class='fa fa-calendar oe_date']" position="after">
- <span class="fa fa-folder-open"> In <span t-field="blog_post.blog_id"/> &amp;nbsp;</span>
+ <xpath expr="//div[@id='blog_content']" position="attributes">
+ <attribute name="enable_chatter_discuss">True</attribute>
</xpath>
</template>
@@ -276,6 +341,9 @@
<t t-call="website.layout">
<t t-set="head">
<link rel='stylesheet' href='/website_blog/static/src/css/website_blog.css'/>
+ <script type="text/javascript" src="/website_blog/static/src/js/website_blog.inline.discussion.js"></script>
+ <script type="text/javascript" src="/website_blog/static/src/js/website_blog.js"/>
+ <script type="text/javascript" src="/website_blog/static/lib/contentshare.js"/>
</t>
<div id="wrap" class="js_blog">
<t t-raw="0"/>
@@ -283,23 +351,19 @@
</t>
</template>
-<!-- Option: Right Column for extra info -->
+<!-- Option:Right Column for extra info -->
<template id="index_right" name="Right Column"
- inherit_option_id="website_blog.index">
- <xpath expr="//div[@id='wrap']" position="replace">
- <div class="container mt16 js_website_blog">
- <div class="row">
- <div class="col-lg-8 col-sm-8" id="blog_left_column">
- <t t-raw="0"/>
- </div>
- <div class="col-lg-3 col-lg-offset-1 col-sm-4" id="blog_right_column"/>
- </div>
- </div>
+ inherit_option_id="website_blog.blog_post_short">
+ <xpath expr="//div[@id='main_column']" position="attributes">
+ <attribute name="class">col-sm-8</attribute>
+ </xpath>
+ <xpath expr="//div[@id='main_column']" position="after">
+ <div class="col-lg-3 col-lg-offset-1 col-sm-4" id="blog_right_column"/>
</xpath>
</template>
-<!-- Option: Right Column: tags -->
+<!-- Option:Right Column: tags -->
<template id="opt_blog_rc_tags" name="Tags"
inherit_option_id="website_blog.index_right">
<xpath expr="//div[@id='blog_right_column']" position="inside">
@@ -316,7 +380,7 @@
</xpath>
</template>
-<!-- Option: Right Column: archives -->
+<!-- Option:Right Column: archives -->
<template id="opt_blog_rc_history" name="Archives"
inherit_option_id="website_blog.index_right">
<xpath expr="//div[@id='blog_right_column']" position="inside">
@@ -333,7 +397,7 @@
</xpath>
</template>
-<!-- Option: Right Column: about us -->
+<!-- Option:Right Column: about us -->
<template id="opt_blog_rc_about_us" name="About Us" priority="2"
inherit_option_id="website_blog.index_right">
<xpath expr="//div[@id='blog_right_column']" position="inside">
@@ -350,7 +414,7 @@
</xpath>
</template>
-<!-- Option: Right Column: follow us -->
+<!-- Option:Right Column: follow us -->
<template id="opt_blog_rc_follow_us" name="Follow us" priority="4"
inherit_option_id="website_blog.index_right">
<xpath expr="//div[@id='blog_right_column']" position="inside">
@@ -377,7 +441,7 @@
</xpath>
</template>
-<!-- Option: Right Column: blogs -->
+<!-- Option:Right Column: blogs -->
<template id="opt_blog_rc_blogs" name="Our Blogs" priority="6"
inherit_option_id="website_blog.index_right">
<xpath expr="//div[@id='blog_right_column']" position="inside">
diff --git a/addons/website_blog/views/website_blog_views.xml b/addons/website_blog/views/website_blog_views.xml
index 114c9d6961f..a3a359a1f62 100644
--- a/addons/website_blog/views/website_blog_views.xml
+++ b/addons/website_blog/views/website_blog_views.xml
@@ -56,9 +56,15 @@
<sheet>
<h1><field name="name" placeholder="Name"/></h1>
<field name="tag_ids" widget="many2many_tags"/>
+ <field name="subtitle" placeholder="Blog Subtitle"/>
<group>
+ <field name="background_image"/>
<field name="blog_id"/>
</group>
+ <group>
+ <field name="visits"/>
+ <field name="ranking" invisible="1"/>
+ </group>
<field name="content" placeholder="e.g. Once upon a time..." widget="html"/>
<group string="Technical" groups="base.group_no_one">
<field name="write_uid" context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'base.group_document_user']}"/>
@@ -155,5 +161,6 @@
name="Page History"
res_model="blog.post.history"
src_model="blog.post"/>
+
</data>
</openerp>
diff --git a/addons/website_event_track/models/event.py b/addons/website_event_track/models/event.py
index 716aac6bff4..359b7df0067 100644
--- a/addons/website_event_track/models/event.py
+++ b/addons/website_event_track/models/event.py
@@ -27,14 +27,14 @@ class event_track_tag(osv.osv):
_name = "event.track.tag"
_order = 'name'
_columns = {
- 'name': fields.char('Event Track Tag')
+ 'name': fields.char('Event Track Tag', translate=True)
}
class event_tag(osv.osv):
_name = "event.tag"
_order = 'name'
_columns = {
- 'name': fields.char('Event Tag')
+ 'name': fields.char('Event Tag', translate=True)
}
#
@@ -45,7 +45,7 @@ class event_track_stage(osv.osv):
_name = "event.track.stage"
_order = 'sequence'
_columns = {
- 'name': fields.char('Track Stage'),
+ 'name': fields.char('Track Stage', translate=True),
'sequence': fields.integer('Sequence')
}
_defaults = {
@@ -160,7 +160,7 @@ class event_sponsors_type(osv.osv):
_name = "event.sponsor.type"
_order = "sequence"
_columns = {
- "name": fields.char('Sponsor Type', required=True),
+ "name": fields.char('Sponsor Type', required=True, translate=True),
"sequence": fields.integer('Sequence')
}
diff --git a/addons/website_partner/website_partner_demo.xml b/addons/website_partner/website_partner_demo.xml
index bedd472cc2a..8909001b790 100644
--- a/addons/website_partner/website_partner_demo.xml
+++ b/addons/website_partner/website_partner_demo.xml
@@ -2,6 +2,13 @@
<openerp>
<data>
+ <record id="base.partner_root" model="res.partner">
+ <field name="website_published">True</field>
+ </record>
+ <record id="base.partner_demo" model="res.partner">
+ <field name="website_published">True</field>
+ </record>
+
<record id="base.res_partner_9" model="res.partner">
<field name="website_published">True</field>
</record>
diff --git a/addons/website_report/views/layouts.xml b/addons/website_report/views/layouts.xml
index f5deb483374..ef6639de499 100644
--- a/addons/website_report/views/layouts.xml
+++ b/addons/website_report/views/layouts.xml
@@ -72,15 +72,24 @@
</xpath>
<xpath expr='//body[@class="container"]/div[@id="wrapwrap"]' position="before">
- <t t-set="languages" t-value="website.get_languages() if website else list()"/>
- <ul class="list-inline js_language_selector mt16" t-if="(len(languages) &gt; 1 or editable)">
- <li t-foreach="languages" t-as="lg">
- <a t-att-href="url_for('', lang=lg[0]) + '?' + keep_query()"
- t-att-data-default-lang="editable and 'true' if lg[0] == website.default_lang_code else None">
- <t t-esc="lg[1].split('/').pop()"/>
- </a>
- </li>
- </ul>
+ <t t-set="languages" t-value="website.get_languages() if website else None"/>
+ <t t-if="languages">
+ <ul class="list-inline js_language_selector mt16" t-if="(len(languages) &gt; 1 or editable)">
+ <li t-foreach="languages" t-as="lg">
+ <a t-att-href="url_for('', lang=lg[0]) + '?' + keep_query()"
+ t-att-data-default-lang="editable and 'true' if lg[0] == website.default_lang_code else None">
+ <t t-esc="lg[1].split('/').pop()"/>
+ </a>
+ </li>
+ <li groups="base.group_website_publisher">
+ <t t-set="url_return" t-value="url_for('', '[lang]') + '?' + keep_query()"/>
+ <a t-attf-href="/web#action=base.action_view_base_language_install&amp;website_id=#{website.id}&amp;url_return=#{url_return}">
+ <i class="fa fa-plus-circle"/>
+ Add a language...
+ </a>
+ </li>
+ </ul>
+ </t>
</xpath>
</template>
</data>
diff --git a/addons/website_sale/static/src/js/website.tour.shop.js b/addons/website_sale/static/src/js/website.tour.shop.js
index adb4a9e556c..6291f2fc54e 100644
--- a/addons/website_sale/static/src/js/website.tour.shop.js
+++ b/addons/website_sale/static/src/js/website.tour.shop.js
@@ -66,39 +66,23 @@
},
{
waitNot: '.product_price .oe_currency_value:containsExact(1.00)',
- element: '#wrap img.img:first',
+ element: '#wrap img.product_detail_img',
placement: 'top',
title: _t("Update image"),
content: _t("Click here to set an image describing your product."),
},
{
- element: 'button.hover-edition-button:visible',
+ element: 'img[alt=ipad]',
placement: 'top',
- title: _t("Update image"),
- content: _t("Click here to set an image describing your product."),
- },
- {
- wait: 500,
- element: '.well a.pull-right',
- placement: 'bottom',
- title: _t("Select an Image"),
- content: _t("Let's select an existing image."),
- popover: { fixed: true },
- },
- {
- element: 'img[alt=imac]',
- placement: 'bottom',
title: _t("Select an Image"),
- content: _t("Let's select an imac image."),
- popover: { fixed: true },
+ content: _t("Let's select an ipad image."),
},
{
- waitNot: 'img[alt=imac]',
+ waitFor: '.media_selected img[alt=ipad]',
element: '.modal-content button.save',
- placement: 'bottom',
- title: _t("Select this Image"),
- content: _t("Click to add the image to the product decsription."),
- popover: { fixed: true },
+ placement: 'top',
+ title: _t("Save this Image"),
+ content: _t("Click on save to add the image to the product decsription."),
},
{
waitNot: '.modal-content:visible',