summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Ledoux dle@openerp.com <>2012-11-09 13:34:23 +0100
committerDenis Ledoux dle@openerp.com <>2012-11-09 13:34:23 +0100
commita6d97dccbd83a472aab48c148dacba5cc3f2bafd (patch)
tree22d57a493aff445e2beaa0996c8272ec0eb5f4e6
parenta13b8fd089abffbb7a76f3d8e400803505c540d5 (diff)
[ADD]Changes of context
bzr revid: dle@openerp.com-20121109123423-3tkugord76afa2r9
-rw-r--r--addons/account/__openerp__.py1
-rw-r--r--addons/account/account_view.xml4
-rw-r--r--addons/account/static/src/js/account_move_reconciliation.js65
3 files changed, 3 insertions, 67 deletions
diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py
index 39feb2cd546..2641367edb3 100644
--- a/addons/account/__openerp__.py
+++ b/addons/account/__openerp__.py
@@ -128,6 +128,7 @@ for a particular financial year and for preparation of vouchers there is a modul
],
'js': [
'static/src/js/account_move_reconciliation.js',
+ 'static/src/js/account_move_line_quickadd.js',
],
'qweb' : [
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index 6dbab2cd5e9..73980aecbd9 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -1059,9 +1059,9 @@
<field name="model">account.move.line</field>
<field eval="24" name="priority"/>
<field name="arch" type="xml">
- <tree_account_move_line_quickadd colors="red:state == 'draft';black:state == 'valid'" string="Journal Items to Reconcile" create="false" version="7.0" editable="bottom">
+ <tree_account_move_line_quickadd colors="red:state == 'draft';black:state == 'valid'" string="Journal Items to Reconcile" create="true" on_write="on_create_write" version="7.0" editable="bottom">
<field name="date"/>
- <field name="move_id"/>
+ <field name="move_id" required="0"/>
<field name="ref"/>
<field name="invoice"/>
<field name="name"/>
diff --git a/addons/account/static/src/js/account_move_reconciliation.js b/addons/account/static/src/js/account_move_reconciliation.js
index d1ad07b8a5f..eed56632808 100644
--- a/addons/account/static/src/js/account_move_reconciliation.js
+++ b/addons/account/static/src/js/account_move_reconciliation.js
@@ -125,69 +125,4 @@ openerp.account = function (instance) {
this._super.apply(this, arguments);
},
});
-
- instance.web.views.add('tree_account_move_line_quickadd', 'instance.web.account.QuickAddListView');
- instance.web.account.QuickAddListView = instance.web.ListView.extend({
- init: function() {
- var self = this;
- this._super.apply(this, arguments);
- this.journals = [];
- this.periods = [];
- this.current_journal = null;
- this.current_period = null;
- },
- load_list: function() {
- var self = this;
- var tmp = this._super.apply(this, arguments);
-
- this.$el.prepend(QWeb.render("AccountMoveLineQuickAdd", {widget: this}));
-
- this.$("#oe_account_select_journal").change(function() {
- self.current_journal = parseInt(this.value);
- self.do_search(self.last_domain, self.last_context, self.last_group_by);
- });
- this.$("#oe_account_select_period").change(function() {
- self.current_period = parseInt(this.value);
- self.do_search(self.last_domain, self.last_context, self.last_group_by);
- });
-
- return tmp;
- },
- do_search: function(domain, context, group_by) {
- var self = this;
- this.last_domain = domain;
- this.last_context = context;
- this.last_group_by = group_by;
- this.old_search = _.bind(this._super, this);
- var mod = new instance.web.Model("account.move.line", context, domain);
- var getarray = [];
- getarray.push(mod.call("list_journals", []).pipe(function(result) {
- self.journals = result;
- }));
- getarray.push(mod.call("list_periods", []).pipe(function(result) {
- self.periods = result;
- }));
- $.when.apply($, getarray).done(function () {
- self.search_by_journal_period();
- });
- },
- search_by_journal_period: function() {
- var self = this;
- var fct = function() {
- compoundDomain = new instance.web.CompoundDomain(self.last_domain,
- [
- ["journal_id", "=", self.current_journal === null ? self.journals[0][0] : self.current_journal],
- ["period_id", "=", self.current_period === null ? self.journals[0][0] :self.current_period]
- ]);
- return self.old_search(compoundDomain, self.last_context, self.last_group_by);
- };
- return fct();
- },
-
- do_select: function (ids, records) {
- this.trigger('record_selected')
- this._super.apply(this, arguments);
- },
- });
-
};