Jordi Ballester
7 years ago
36 changed files with 2218 additions and 8562 deletions
-
1.gitignore
-
7account_financial_report/__manifest__.py
-
1365account_financial_report/i18n/account_financial_report.pot
-
1365account_financial_report/i18n/account_financial_report_qweb.pot
-
1385account_financial_report/i18n/es.po
-
1386account_financial_report/i18n/fr.po
-
1376account_financial_report/i18n/hr_HR.po
-
1376account_financial_report/i18n/nl_NL.po
-
1385account_financial_report/i18n/pt.po
-
22account_financial_report/report/aged_partner_balance.py
-
17account_financial_report/report/general_ledger.py
-
17account_financial_report/report/open_items.py
-
317account_financial_report/report/templates/aged_partner_balance.xml
-
121account_financial_report/report/templates/general_ledger.xml
-
164account_financial_report/report/templates/open_items.xml
-
97account_financial_report/report/templates/trial_balance.xml
-
20account_financial_report/report/trial_balance.py
-
10account_financial_report/static/src/css/report.css
-
109account_financial_report/static/src/js/account_financial_report_backend.js
-
37account_financial_report/static/src/js/account_financial_report_widgets.js
-
2account_financial_report/tests/abstract_test.py
-
2account_financial_report/tests/test_aged_partner_balance.py
-
2account_financial_report/tests/test_general_ledger.py
-
2account_financial_report/tests/test_open_items.py
-
2account_financial_report/tests/test_trial_balance.py
-
28account_financial_report/view/account_view.xml
-
9account_financial_report/view/report_aged_partner_balance.xml
-
9account_financial_report/view/report_general_ledger.xml
-
9account_financial_report/view/report_open_items.xml
-
45account_financial_report/view/report_template.xml
-
9account_financial_report/view/report_trial_balance.xml
-
20account_financial_report/wizard/aged_partner_balance_wizard.py
-
24account_financial_report/wizard/general_ledger_wizard.py
-
19account_financial_report/wizard/open_items_wizard.py
-
19account_financial_report/wizard/trial_balance_wizard.py
-
2account_tax_balance/models/account_tax.py
1365
account_financial_report/i18n/account_financial_report.pot
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1365
account_financial_report/i18n/account_financial_report_qweb.pot
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1385
account_financial_report/i18n/es.po
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1386
account_financial_report/i18n/fr.po
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1376
account_financial_report/i18n/hr_HR.po
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1376
account_financial_report/i18n/nl_NL.po
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1385
account_financial_report/i18n/pt.po
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,109 @@ |
|||||
|
odoo.define('account_financial_report.account_financial_report_backend', function (require) { |
||||
|
'use strict'; |
||||
|
|
||||
|
var core = require('web.core'); |
||||
|
var Widget = require('web.Widget'); |
||||
|
var ControlPanelMixin = require('web.ControlPanelMixin'); |
||||
|
var session = require('web.session'); |
||||
|
var ReportWidget = require('account_financial_report.account_financial_report_widget'); |
||||
|
var framework = require('web.framework'); |
||||
|
var crash_manager = require('web.crash_manager'); |
||||
|
|
||||
|
var QWeb = core.qweb; |
||||
|
|
||||
|
var report_backend = Widget.extend(ControlPanelMixin, { |
||||
|
// Stores all the parameters of the action.
|
||||
|
events: { |
||||
|
'click .o_account_financial_reports_print': 'print', |
||||
|
'click .o_account_financial_reports_export': 'export', |
||||
|
}, |
||||
|
init: function(parent, action) { |
||||
|
this.actionManager = parent; |
||||
|
this.given_context = {}; |
||||
|
this.odoo_context = action.context; |
||||
|
this.controller_url = action.context.url; |
||||
|
if (action.context.context) { |
||||
|
this.given_context = action.context.context; |
||||
|
} |
||||
|
this.given_context.active_id = action.context.active_id || action.params.active_id; |
||||
|
this.given_context.model = action.context.active_model || false; |
||||
|
this.given_context.ttype = action.context.ttype || false; |
||||
|
return this._super.apply(this, arguments); |
||||
|
}, |
||||
|
willStart: function() { |
||||
|
return $.when(this.get_html()); |
||||
|
}, |
||||
|
set_html: function() { |
||||
|
var self = this; |
||||
|
var def = $.when(); |
||||
|
if (!this.report_widget) { |
||||
|
this.report_widget = new ReportWidget(this, this.given_context); |
||||
|
def = this.report_widget.appendTo(this.$el); |
||||
|
} |
||||
|
def.then(function () { |
||||
|
self.report_widget.$el.html(self.html); |
||||
|
}); |
||||
|
}, |
||||
|
start: function() { |
||||
|
this.set_html(); |
||||
|
return this._super(); |
||||
|
}, |
||||
|
// Fetches the html and is previous report.context if any, else create it
|
||||
|
get_html: function() { |
||||
|
var self = this; |
||||
|
var defs = []; |
||||
|
return this._rpc({ |
||||
|
model: this.given_context.model, |
||||
|
method: 'get_html', |
||||
|
args: [self.given_context], |
||||
|
context: self.odoo_context, |
||||
|
}) |
||||
|
.then(function (result) { |
||||
|
self.html = result.html; |
||||
|
defs.push(self.update_cp()); |
||||
|
return $.when.apply($, defs); |
||||
|
}); |
||||
|
}, |
||||
|
// Updates the control panel and render the elements that have yet to be rendered
|
||||
|
update_cp: function() { |
||||
|
if (!this.$buttons) { |
||||
|
|
||||
|
} |
||||
|
var status = { |
||||
|
breadcrumbs: this.actionManager.get_breadcrumbs(), |
||||
|
cp_content: {$buttons: this.$buttons}, |
||||
|
}; |
||||
|
return this.update_control_panel(status); |
||||
|
}, |
||||
|
do_show: function() { |
||||
|
this._super(); |
||||
|
this.update_cp(); |
||||
|
}, |
||||
|
print: function(e) { |
||||
|
var self = this; |
||||
|
this._rpc({ |
||||
|
model: this.given_context.model, |
||||
|
method: 'print_report', |
||||
|
args: [this.given_context.active_id, 'qweb-pdf'], |
||||
|
context: self.odoo_context, |
||||
|
}).then(function(result){ |
||||
|
self.do_action(result); |
||||
|
}); |
||||
|
}, |
||||
|
export: function(e) { |
||||
|
var self = this; |
||||
|
this._rpc({ |
||||
|
model: this.given_context.model, |
||||
|
method: 'print_report', |
||||
|
args: [this.given_context.active_id, 'xlsx'], |
||||
|
context: self.odoo_context, |
||||
|
}) |
||||
|
.then(function(result){ |
||||
|
self.do_action(result); |
||||
|
}); |
||||
|
}, |
||||
|
}); |
||||
|
|
||||
|
core.action_registry.add("account_financial_report_backend", report_backend); |
||||
|
return report_backend; |
||||
|
}); |
@ -0,0 +1,37 @@ |
|||||
|
odoo.define('account_financial_report.account_financial_report_widget', function |
||||
|
(require) { |
||||
|
'use strict'; |
||||
|
|
||||
|
var core = require('web.core'); |
||||
|
var Widget = require('web.Widget'); |
||||
|
|
||||
|
var QWeb = core.qweb; |
||||
|
|
||||
|
var _t = core._t; |
||||
|
|
||||
|
var accountFinancialReportWidget = Widget.extend({ |
||||
|
events: { |
||||
|
'click .o_account_financial_reports_web_action': 'boundLink', |
||||
|
}, |
||||
|
init: function(parent) { |
||||
|
this._super.apply(this, arguments); |
||||
|
}, |
||||
|
start: function() { |
||||
|
return this._super.apply(this, arguments); |
||||
|
}, |
||||
|
boundLink: function(e) { |
||||
|
var res_model = $(e.target).data('res-model') |
||||
|
var res_id = $(e.target).data('active-id') |
||||
|
return this.do_action({ |
||||
|
type: 'ir.actions.act_window', |
||||
|
res_model: res_model, |
||||
|
res_id: res_id, |
||||
|
views: [[false, 'form']], |
||||
|
target: 'current' |
||||
|
}); |
||||
|
}, |
||||
|
}); |
||||
|
|
||||
|
return accountFinancialReportWidget; |
||||
|
|
||||
|
}); |
@ -0,0 +1,9 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<template id="report_aged_partner_balance"> |
||||
|
<div class="container o_account_financial_reports_page"> |
||||
|
<t t-call="account_financial_report.report_buttons"/> |
||||
|
<t t-call="account_financial_report.report_aged_partner_balance_base"/> |
||||
|
</div> |
||||
|
</template> |
||||
|
</odoo> |
@ -0,0 +1,9 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<template id="report_general_ledger"> |
||||
|
<div class="container o_account_financial_reports_page"> |
||||
|
<t t-call="account_financial_report.report_buttons"/> |
||||
|
<t t-call="account_financial_report.report_general_ledger_base"/> |
||||
|
</div> |
||||
|
</template> |
||||
|
</odoo> |
@ -0,0 +1,9 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<template id="report_open_items"> |
||||
|
<div class="container o_account_financial_reports_page"> |
||||
|
<t t-call="account_financial_report.report_buttons"/> |
||||
|
<t t-call="account_financial_report.report_open_items_base"/> |
||||
|
</div> |
||||
|
</template> |
||||
|
</odoo> |
@ -0,0 +1,45 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
|
||||
|
<template id="account_financial_report_assets_backend" |
||||
|
name="account_financial_report assets" inherit_id="web.assets_backend"> |
||||
|
<xpath expr="." position="inside"> |
||||
|
<link href="/account_financial_report/static/src/css/report.css" rel="stylesheet"/> |
||||
|
<script type="text/javascript" |
||||
|
src="/account_financial_report/static/src/js/account_financial_report_backend.js"/> |
||||
|
<script type="text/javascript" |
||||
|
src="/account_financial_report/static/src/js/account_financial_report_widgets.js"/> |
||||
|
</xpath> |
||||
|
</template> |
||||
|
<template id="report_buttons"> |
||||
|
<div class="button_row"> |
||||
|
<button class="o_account_financial_reports_print btn btn-sm oe_button"><span class="fa fa-print"/> Print</button> |
||||
|
<button class="o_account_financial_reports_export btn btn-sm oe_button"><span class="fa fa-download"/> Export</button> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<record id="action_report_general_ledger" model="ir.actions.client"> |
||||
|
<field name="name">General Ledger</field> |
||||
|
<field name="tag">account_financial_report_backend</field> |
||||
|
<field name="context" eval="{'active_model': 'report_general_ledger'}" /> |
||||
|
</record> |
||||
|
|
||||
|
<record id="action_report_open_items" model="ir.actions.client"> |
||||
|
<field name="name">Open Items</field> |
||||
|
<field name="tag">account_financial_report_backend</field> |
||||
|
<field name="context" eval="{'active_model': 'report_open_items'}" /> |
||||
|
</record> |
||||
|
|
||||
|
<record id="action_report_trial_balance" model="ir.actions.client"> |
||||
|
<field name="name">Trial Balance</field> |
||||
|
<field name="tag">account_financial_report_backend</field> |
||||
|
<field name="context" eval="{'active_model': 'report_trial_balance'}" /> |
||||
|
</record> |
||||
|
|
||||
|
<record id="action_report_aged_partner_balance" model="ir.actions.client"> |
||||
|
<field name="name">Aged Partner Balance</field> |
||||
|
<field name="tag">account_financial_report_backend</field> |
||||
|
<field name="context" eval="{'active_model': 'report_aged_partner_balance'}" /> |
||||
|
</record> |
||||
|
|
||||
|
</odoo> |
@ -0,0 +1,9 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<template id="report_trial_balance"> |
||||
|
<div class="container o_account_financial_reports_page"> |
||||
|
<t t-call="account_financial_report.report_buttons"/> |
||||
|
<t t-call="account_financial_report.report_trial_balance_base"/> |
||||
|
</div> |
||||
|
</template> |
||||
|
</odoo> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue