Odoo-8 modify journal items list view

In Odoo-8 there is list view for journal items, in that there are two selection field one for account journal and second is for account period.

enter image description here

What I want to do

I would like to remove default value from period and journal.

I would also like to filter period in which only open period will be loaded.

What I have done so far

I have tried to set default value for period and journal by just setting _defaults but then filter wasn't worked.

Upvotes: 1

Views: 180

Answers (1)

gdaramouskas
gdaramouskas

Reputation: 3747

Check the file located in: addons/account/static/src/xml/account_move_line_quickadd.xml

This file defines the view you are referring to.

The file: addons/account/static/src/js/account_move_line_quickadd.js

is the js file that sets the default values. If you take a look at the js file you will see that at some point the default_get method of the account_move_line model is called.

What you can do is either modify the js (by extending the widget of course) or you can go and override the default_get method of the account_move_line model and do your work there.

Upvotes: 1

Related Questions