diff --git a/account_move_line_search_extension/__openerp__.py b/account_move_line_search_extension/__openerp__.py index 89de8a22f..a2c14ac60 100644 --- a/account_move_line_search_extension/__openerp__.py +++ b/account_move_line_search_extension/__openerp__.py @@ -22,7 +22,7 @@ { 'name': 'Journal Items Search Extension', - 'version': '0.5', + 'version': '0.6', 'license': 'AGPL-3', 'author': 'Noviat', 'category': 'Accounting & Finance', diff --git a/account_move_line_search_extension/account_view.xml b/account_move_line_search_extension/account_view.xml index 560a6e814..a375d5bdb 100644 --- a/account_move_line_search_extension/account_view.xml +++ b/account_move_line_search_extension/account_view.xml @@ -3,7 +3,7 @@ - {'account_move_line_search_extension':1} + {'account_move_line_search_extension': 1, 'analytic_journal_id': 1} Journal Items Search All account.move.line @@ -18,16 +18,5 @@ groups="account.group_account_user" /> - - amlse.view.move.line.tree - account.move.line - - - - False - - - - diff --git a/account_move_line_search_extension/ir_actions.py b/account_move_line_search_extension/ir_actions.py index df2e04778..ef3a30fdd 100644 --- a/account_move_line_search_extension/ir_actions.py +++ b/account_move_line_search_extension/ir_actions.py @@ -26,7 +26,7 @@ from openerp import models class ir_actions_act_window(models.Model): _inherit = 'ir.actions.act_window' - def __init__(self, pool, cr): + def _get_amlse_act_id(self, cr): module = 'account_move_line_search_extension' xml_id = 'action_account_move_line_search_extension' cr.execute( @@ -35,7 +35,10 @@ class ir_actions_act_window(models.Model): "AND module = %s AND name = %s ", (module, xml_id)) res = cr.fetchone() - self._amlse_act_id = res and res[0] + return res and res[0] + + def __init__(self, pool, cr): + self._amlse_act_id = self._get_amlse_act_id(cr) super(ir_actions_act_window, self).__init__(pool, cr) def _amlse_add_groups(self, cr, uid, context): @@ -51,6 +54,8 @@ class ir_actions_act_window(models.Model): context = {} res = super(ir_actions_act_window, self).read( cr, uid, ids, fields=fields, context=context, load=load) + if not self._amlse_act_id: + self._amlse_act_id = self._get_amlse_act_id(cr) if ids == [self._amlse_act_id]: amlse_act = res[0] if amlse_act.get('context'):