Small corrections

bzr revid: nicolas.vanhoren@openerp.com-20121109125618-kdj4w7dv88dmepi1
This commit is contained in:
niv-openerp 2012-11-09 13:56:18 +01:00
parent 3f034c27a4
commit 4c7f0a9e06
2 changed files with 7 additions and 9 deletions

View File

@ -40,17 +40,15 @@ openerp.account = function (instance) {
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", []).then(function(result) {
return new instance.web.Model("account.move.line", context, domain);
$.when(mod.call("list_journals", []).then(function(result) {
self.journals = result;
}));
getarray.push(mod.call("list_periods", []).then(function(result) {
}),mod.call("list_periods", []).then(function(result) {
self.periods = result;
}));
$.when.apply($, getarray).done(function () {
})).then(function () {
self.current_journal = self.current_journal === null ? self.journals[0][0] : self.current_journal;
self.current_period = self.current_period === null ? self.periods[0][0] :self.current_period;
var tmp = self.search_by_journal_period();
return self.search_by_journal_period();
});
},
search_by_journal_period: function() {

View File

@ -8,7 +8,7 @@
Journal :
<select id="oe_account_select_journal">
<t t-foreach="widget.journals" t-as="journal">
<option t-if=" journal[0] === widget.current_journal" t-att-value="journal[0]" t-att-selected="'selected'">
<option t-if=" journal[0] === widget.current_journal" t-att-value="journal[0]" selected="selected">
<t t-esc="journal[1]"/>
</option>
<option t-if="journal[0] !== widget.current_journal" t-att-value="journal[0]">
@ -19,7 +19,7 @@
Period :
<select id="oe_account_select_period">
<t t-foreach="widget.periods" t-as="period">
<option t-if=" period[0] === widget.current_period" t-att-value="period[0]" t-att-selected="'selected'">
<option t-if=" period[0] === widget.current_period" t-att-value="period[0]" selected="selected">
<t t-esc="period[1]"/>
</option>
<option t-if=" period[0] !== widget.current_period" t-att-value="period[0]">