Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


[Resolved] Want having no pre-selected filters in journal items

on 7/10/15, 7:43 AM 716 views


I'm trying to replace period and journal default filter from journal entries ( Menu Account/Journal entries/Journal items) by blank.

These default filters are defined in addons/account/static/src/js/account_move_line_quickadd.js

45:            defs.push(mod.call("default_get", [['journal_id','period_id'],self.dataset.context]).then(function(result) {
46: self.current_period = result['period_id'];
47: self.current_journal = result['journal_id'];
48: }));

I'm not already comfortable with javascript. But, if I remove line 46 and 47, it works fine.

Now, I want to do that without modify account module. So I tried to make a module and I read this doc page: https://doc.odoo.com/trunk/training/web_framework/

Here is my code:

openerp.mymodule.quickadd = function (instance) {
instance.mymodule.quickadd = instance.web.account.QuickAddListView.extend({
var tmp = this._super.apply(this, arguments);
var self = this;
var defs = [];
this.$el.parent().prepend(QWeb.render("AccountMoveLineQuickAdd", {widget: this}));

this.$el.parent().find('.oe_account_select_journal').change(function() {
self.current_journal = this.value === '' ? null : parseInt(this.value);
self.do_search(self.last_domain, self.last_context, self.last_group_by);
this.$el.parent().find('.oe_account_select_period').change(function() {
self.current_period = this.value === '' ? null : parseInt(this.value);
self.do_search(self.last_domain, self.last_context, self.last_group_by);
this.on('edit:after', this, function () {
self.$el.parent().find('.oe_account_select_journal').attr('disabled', 'disabled');
self.$el.parent().find('.oe_account_select_period').attr('disabled', 'disabled');
this.on('save:after cancel:after', this, function () {
var mod = new instance.web.Model("account.move.line", self.dataset.context, self.dataset.domain);
defs.push(mod.call("default_get", [['journal_id','period_id'],self.dataset.context]).then(function(result) {
defs.push(mod.call("list_journals", []).then(function(result) {
self.journals = result;
defs.push(mod.call("list_periods", []).then(function(result) {
self.periods = result;
return $.when(tmp, defs);

But, that doesn't work.

Is someone can help me please?

You mean you totally want to remove both selection from there? you want all the journal items to be display?

Anil R. Kesariya
on 7/10/15, 1:46 PM

Just want no period and no journal pre-selected. Thanks for your answer …

L'Heureux-Cyclage, Ludovic CHEVALIER
on 7/10/15, 2:19 PM

Ray Carnes

--Ray Carnes--
| 9 7 9
Greater Los Angeles, United States
--Ray Carnes--

Senior Odoo Analyst

OpenERP 6.1, 7.0 and Odoo 8.0, 9.0 (Since 2012)

Completed Functional and Technical Training.

Major Skills:

  • Needs Discovery and Requirements Analysis;

  • Function and Technical Specifications;

  • Project Planning;

  • Prototyping and Proof of concepts;

  • Data migration;

  • Configuration & Customization (UI and modules);

  • Integration - data, business logic and service levels;

  • Training and Knowledge transfer;

  • Go Live support;

  • Help desk;

  • Version Migration.

I have over 20 years of experience empowering and enabling users with enterprise information systems that make a real and measurable difference in their ability to proactively manage their businesses and organizations. 

Ray Carnes
On 12/22/15, 8:50 PM

Have you seen that a module has already been created to address this?


OpenERP 7.0 implements a custom javascript search view for move lines. This search view shows dropdowns for period and journal. By default, these are set to the default journal and (current) period.

This module leaves the search view extension for move lines intact, but disables the default search values for the dropdowns so that you do not have to disable these before entering your own search queries.

Great. This is that I wanted to do. It's a regrettable that no one has showned me that before. Thanks.

L'Heureux-Cyclage, Ludovic CHEVALIER
on 12/23/15, 4:36 AM
On 7/11/15, 4:31 AM

I've made a module to override javascript file

static/src/js/account_move_line_quickadd.js of account module to remove selectable fields (period and journal).

The module is here:


OK. I've just made this module: http://git.heureux-cyclage.org/?p=burette/account_move_line_nofilters.git;a=summary But, when I go to Account/Journal entries/Journal items , no records appear. I have to select a period and a journal to begin to see them. I would all record to be listed by default when we click to this menu. Can someone help me please?

L'Heureux-Cyclage, Ludovic CHEVALIER
on 7/13/15, 6:31 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 7/10/15, 7:43 AM
Seen: 716 times
Last updated: 12/23/15, 4:37 AM