diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py index 44044243597..6fe56bc7f12 100644 --- a/addons/account/__openerp__.py +++ b/addons/account/__openerp__.py @@ -116,12 +116,10 @@ for a particular financial year and for preparation of vouchers there is a modul 'account_assert_test.xml', 'ir_sequence_view.xml', 'company_view.xml', - 'board_account_view.xml', 'edi/invoice_action_data.xml', 'account_bank_view.xml', 'res_config_view.xml', 'account_pre_install.yml', - 'views/report_vat.xml', 'views/report_invoice.xml', 'views/report_trialbalance.xml', diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index b48e842caf5..446ebc83703 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -430,6 +430,19 @@ class account_move_line(osv.osv): elif line.reconcile_partial_id: res[line.id] = str(line.reconcile_partial_id.name) return res + + def _get_move_from_reconcile(self, cr, uid, ids, context=None): + move = {} + for r in self.pool.get('account.move.reconcile').browse(cr, uid, ids, context=context): + for line in r.line_partial_ids: + move[line.move_id.id] = True + for line in r.line_id: + move[line.move_id.id] = True + move_line_ids = [] + if move: + move_line_ids = self.pool.get('account.move.line').search(cr, uid, [('journal_id','in',move.keys())], context=context) + return move_line_ids + _columns = { 'name': fields.char('Name', size=64, required=True), @@ -445,7 +458,8 @@ class account_move_line(osv.osv): 'statement_id': fields.many2one('account.bank.statement', 'Statement', help="The bank statement used for bank reconciliation", select=1), 'reconcile_id': fields.many2one('account.move.reconcile', 'Reconcile', readonly=True, ondelete='set null', select=2), 'reconcile_partial_id': fields.many2one('account.move.reconcile', 'Partial Reconcile', readonly=True, ondelete='set null', select=2), - 'reconcile': fields.function(_get_reconcile, type='char', string='Reconcile Ref'), + 'reconcile': fields.function(_get_reconcile, type='char', string='Reconcile Ref', store={ + 'account.move.line': (lambda self, cr, uid, ids, c={}: ids, ['reconcile_id','reconcile_partial_id'], 50),'account.move.reconcile': (_get_move_from_reconcile, None, 50)}), 'amount_currency': fields.float('Amount Currency', help="The amount expressed in an optional other currency if it is a multi-currency entry.", digits_compute=dp.get_precision('Account')), 'amount_residual_currency': fields.function(_amount_residual, string='Residual Amount in Currency', multi="residual", help="The residual amount on a receivable or payable of a journal entry expressed in its currency (maybe different of the company currency)."), 'amount_residual': fields.function(_amount_residual, string='Residual Amount', multi="residual", help="The residual amount on a receivable or payable of a journal entry expressed in the company currency."), @@ -628,7 +642,7 @@ class account_move_line(osv.osv): (_check_date, 'The date of your Journal Entry is not in the defined period! You should change the date or remove this constraint from the journal.', ['date']), (_check_currency, 'The selected account of your Journal Entry forces to provide a secondary currency. You should remove the secondary currency on the account or select a multi-currency view on the journal.', ['currency_id']), (_check_currency_and_amount, "You cannot create journal items with a secondary currency without recording both 'currency' and 'amount currency' field.", ['currency_id','amount_currency']), - (_check_currency_amount, 'The amount expressed in the secondary currency must be positive when the journal item is a debit and negative when if it is a credit.', ['amount_currency']), + (_check_currency_amount, 'The amount expressed in the secondary currency must be positive when account is debited and negative when account is credited.', ['amount_currency']), (_check_currency_company, "You cannot provide a secondary currency if it is the same than the company one." , ['currency_id']), ] diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 48d6320fbc3..8e2cc6452c0 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -384,6 +384,7 @@ + @@ -881,6 +882,7 @@ + @@ -891,6 +893,12 @@ + + + + + + @@ -1628,6 +1636,7 @@ +