diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index 3f608c62e7c..d4a731fb3b7 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -1170,7 +1170,7 @@
-
+
account.move.line
form
tree,form
+ {'search_default_posted': 1}
This view is used by accountants in order to record entries massively in OpenERP. If you want to record a supplier invoice, start by recording the line of the expense account, OpenERP will propose to you automatically the Tax related to this account and the counter-part "Account Payable".
diff --git a/addons/account/installer.py b/addons/account/installer.py
index b1be04f7c70..0301126a373 100644
--- a/addons/account/installer.py
+++ b/addons/account/installer.py
@@ -95,6 +95,25 @@ class account_installer(osv.osv_memory):
'bank_accounts_id': _get_default_accounts,
'charts': _get_default_charts
}
+
+ def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
+ res = super(account_installer, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar,submenu=False)
+ configured_cmp = []
+ unconfigured_cmp = []
+ cmp_select = []
+ company_ids = self.pool.get('res.company').search(cr, uid, [], context=context)
+ cr.execute("SELECT company_id FROM account_account WHERE account_account.parent_id IS NULL")
+ for r in cr.fetchall():
+ configured_cmp.append(r[0])
+ unconfigured_cmp = list(set(company_ids)-set(configured_cmp))
+ if unconfigured_cmp:
+ for line in self.pool.get('res.company').browse(cr, uid, unconfigured_cmp):
+ cmp_select.append((line.id,line.name))
+ for field in res['fields']:
+ if field == 'company_id':
+ res['fields'][field]['domain'] = unconfigured_cmp
+ res['fields'][field]['selection'] = cmp_select
+ return res
def on_change_tax(self, cr, uid, id, tax):
return {'value': {'purchase_tax': tax}}
diff --git a/addons/account/wizard/account_chart.py b/addons/account/wizard/account_chart.py
index f4c360cd253..e8f0e432d69 100644
--- a/addons/account/wizard/account_chart.py
+++ b/addons/account/wizard/account_chart.py
@@ -33,8 +33,9 @@ class account_chart(osv.osv_memory):
help = 'Keep empty for all open fiscal years'),
'period_from': fields.many2one('account.period', 'Start period'),
'period_to': fields.many2one('account.period', 'End period'),
- 'target_move': fields.selection([('all', 'All Entries'),
- ('posted', 'All Posted Entries')], 'Target Moves', required = True),
+ 'target_move': fields.selection([('posted', 'All Posted Entries'),
+ ('all', 'All Entries'),
+ ], 'Target Moves', required = True),
}
def onchange_fiscalyear(self, cr, uid, ids, fiscalyear_id=False, context=None):
@@ -92,7 +93,7 @@ class account_chart(osv.osv_memory):
return result
_defaults = {
- 'target_move': 'all'
+ 'target_move': 'posted'
}
account_chart()
diff --git a/addons/account/wizard/account_move_journal.py b/addons/account/wizard/account_move_journal.py
index 72ae65f83b9..5f4616075fc 100644
--- a/addons/account/wizard/account_move_journal.py
+++ b/addons/account/wizard/account_move_journal.py
@@ -21,7 +21,7 @@
from lxml import etree
-from osv import osv
+from osv import osv, fields
from tools.translate import _
import tools
@@ -29,6 +29,15 @@ class account_move_journal(osv.osv_memory):
_name = "account.move.journal"
_description = "Move journal"
+ _columns = {
+ 'target_move': fields.selection([('posted', 'All Posted Entries'),
+ ('all', 'All Entries'),
+ ], 'Target Moves', required=True),
+ }
+
+ _defaults = {
+ 'target_move': 'posted'
+ }
def _get_period(self, cr, uid, context={}):
"""
Return default account period value
@@ -93,6 +102,8 @@ class account_move_journal(osv.osv_memory):
view = """