diff --git a/account_mass_reconcile/README.rst b/account_mass_reconcile/README.rst index 51acbd9c..d11d7f7d 100644 --- a/account_mass_reconcile/README.rst +++ b/account_mass_reconcile/README.rst @@ -44,8 +44,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. -If you spotted it first, help us smashing it by providing a detailed and welcomed feedback -`here `_. +If you spotted it first, help us smashing it by providing a detailed and welcomed feedback. Credits diff --git a/account_mass_reconcile/__openerp__.py b/account_mass_reconcile/__openerp__.py index b1dba197..598548bf 100644 --- a/account_mass_reconcile/__openerp__.py +++ b/account_mass_reconcile/__openerp__.py @@ -5,7 +5,7 @@ { "name": "Mass Reconcile", - "version": "9.0.1.3.1", + "version": "9.0.1.0.0", "depends": ["account", "account_full_reconcile"], "author": "Akretion,Camptocamp,Odoo Community Association (OCA)", "website": "http://www.akretion.com/", diff --git a/account_mass_reconcile/models/mass_reconcile.py b/account_mass_reconcile/models/mass_reconcile.py index e21ae392..42e1c53b 100644 --- a/account_mass_reconcile/models/mass_reconcile.py +++ b/account_mass_reconcile/models/mass_reconcile.py @@ -97,26 +97,28 @@ class AccountMassReconcile(models.Model): _inherit = ['mail.thread'] _description = 'account mass reconcile' - @api.one + @api.multi @api.depends('account') def _get_total_unrec(self): obj_move_line = self.env['account.move.line'] - self.unreconciled_count = obj_move_line.search_count( - [('account_id', '=', self.account.id), - ('reconciled', '=', False)]) + for rec in self: + rec.unreconciled_count = obj_move_line.search_count( + [('account_id', '=', rec.account.id), + ('reconciled', '=', False)]) - @api.one + @api.multi @api.depends('history_ids') def _last_history(self): # do a search() for retrieving the latest history line, # as a read() will badly split the list of ids with 'date desc' # and return the wrong result. history_obj = self.env['mass.reconcile.history'] - last_history_rs = history_obj.search( - [('mass_reconcile_id', '=', self.id)], - limit=1, order='date desc' - ) - self.last_history = last_history_rs or False + for rec in self: + last_history_rs = history_obj.search( + [('mass_reconcile_id', '=', rec.id)], + limit=1, order='date desc' + ) + rec.last_history = last_history_rs or False name = fields.Char(string='Name', required=True) account = fields.Many2one('account.account', diff --git a/account_mass_reconcile/models/mass_reconcile_history.py b/account_mass_reconcile/models/mass_reconcile_history.py index e3da7dc8..028c6087 100644 --- a/account_mass_reconcile/models/mass_reconcile_history.py +++ b/account_mass_reconcile/models/mass_reconcile_history.py @@ -13,14 +13,13 @@ class MassReconcileHistory(models.Model): _rec_name = 'mass_reconcile_id' _order = 'date DESC' - @api.one + @api.multi @api.depends('reconcile_ids') def _get_reconcile_line_ids(self): - move_line_ids = [] - for reconcile in self.reconcile_ids: - move_lines = reconcile.mapped('reconciled_line_ids') - move_line_ids.extend(move_lines.ids) - self.reconcile_line_ids = move_line_ids + for rec in self: + rec.reconcile_line_ids = rec.mapped( + 'reconcile_ids.reconciled_line_ids' + ).ids mass_reconcile_id = fields.Many2one( 'account.mass.reconcile', diff --git a/account_mass_reconcile/security/ir.model.access.csv b/account_mass_reconcile/security/ir.model.access.csv index 604bd9c4..fb696697 100644 --- a/account_mass_reconcile/security/ir.model.access.csv +++ b/account_mass_reconcile/security/ir.model.access.csv @@ -2,8 +2,8 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink access_mass_reconcile_options_acc_user,mass.reconcile.options,model_mass_reconcile_options,account.group_account_user,1,0,0,0 access_account_mass_reconcile_method_acc_user,account.mass.reconcile.method,model_account_mass_reconcile_method,account.group_account_user,1,0,0,0 access_account_mass_reconcile_acc_user,account.mass.reconcile,model_account_mass_reconcile,account.group_account_user,1,1,0,0 -access_mass_reconcile_options_acc_mgr,mass.reconcile.options,model_mass_reconcile_options,account.group_account_user,1,0,0,0 -access_account_mass_reconcile_method_acc_mgr,account.mass.reconcile.method,model_account_mass_reconcile_method,account.group_account_user,1,1,1,1 -access_account_mass_reconcile_acc_mgr,account.mass.reconcile,model_account_mass_reconcile,account.group_account_user,1,1,1,1 +access_mass_reconcile_options_acc_mgr,mass.reconcile.options,model_mass_reconcile_options,account.group_account_manager,1,0,0,0 +access_account_mass_reconcile_method_acc_mgr,account.mass.reconcile.method,model_account_mass_reconcile_method,account.group_account_manager,1,1,1,1 +access_account_mass_reconcile_acc_mgr,account.mass.reconcile,model_account_mass_reconcile,account.group_account_manager,1,1,1,1 access_mass_reconcile_history_acc_user,mass.reconcile.history,model_mass_reconcile_history,account.group_account_user,1,1,1,0 access_mass_reconcile_history_acc_mgr,mass.reconcile.history,model_mass_reconcile_history,account.group_account_manager,1,1,1,1