Changes to bank rec

This commit is contained in:
Novapoint Group
2013-03-15 13:30:52 -04:00
committed by Sandy Carter
parent 49ad6087c2
commit 5977932978
3 changed files with 15 additions and 10 deletions

View File

@@ -26,12 +26,12 @@ class account_move_line(osv.osv):
_inherit='account.move.line'
_columns = {
'cleared_bank_account': fields.boolean('Cleared? ', help='Check if the transaction has cleared from the bank'),
'bank_acc_rec_statement_id': fields.many2one('bank.acc.rec.statement', 'Bank Acc Rec Statement', help="The Bank Acc Rec Statement linked with the journal item"),
'draft_assigned_to_statement': fields.boolean('Assigned to Statement? ', help='Check if the move line is assigned to statement lines')
'cleared_bank_account': fields.boolean('Cleared? ', help='Check if the transaction has cleared from the bank'),
'bank_acc_rec_statement_id': fields.many2one('bank.acc.rec.statement', 'Bank Acc Rec Statement', help="The Bank Acc Rec Statement linked with the journal item"),
'draft_assigned_to_statement': fields.boolean('Assigned to Statement? ', help='Check if the move line is assigned to statement lines')
}
account_move_line()
account_move_line()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@@ -21,8 +21,8 @@
##############################################################################
import time
from osv import fields, osv
from tools.translate import _
from openerp.osv import fields, osv
from openerp.tools.translate import _
import decimal_precision as dp
class bank_acc_rec_statement(osv.osv):
@@ -186,7 +186,10 @@ class bank_acc_rec_statement(osv.osv):
res[statement.id]['cleared_balance'] = round(res[statement.id]['sum_of_debits'] - res[statement.id]['sum_of_credits'], account_precision)
res[statement.id]['difference'] = round((statement.ending_balance - statement.starting_balance) - res[statement.id]['cleared_balance'], account_precision)
return res
def refresh_record(self, cr, uid, ids, context=None):
return self.write(cr, uid, ids, {}, context=context)
def onchange_account_id(self, cr, uid, ids, account_id, ending_date, suppress_ending_date_filter, context=None):
account_move_line_obj = self.pool.get('account.move.line')
statement_line_obj = self.pool.get('bank.acc.rec.statement.line')
@@ -300,8 +303,7 @@ class bank_acc_rec_statement_line(osv.osv):
# Prevent manually adding new statement line.
# This would allow only onchange method to pre-populate statement lines based on the filter rules.
if not vals.get('move_line_id', False):
raise osv.except_osv(_('Processing Error'),\
_('You cannot add any new bank statement line manually as of this revision!'))
raise osv.except_osv(_('Processing Error'),_('You cannot add any new bank statement line manually as of this revision!'))
account_move_line_obj.write(cr, uid, [vals['move_line_id']], {'draft_assigned_to_statement': True}, context=context)
return super(bank_acc_rec_statement_line, self).create(cr, uid, vals, context=context)

View File

@@ -30,7 +30,8 @@
<button name="action_cancel" type="object" states="draft,to_be_reviewed" string="Cancel" icon="gtk-cancel"/>
<button name="action_review" type="object" states="draft" string="Ready for Review" icon="gtk-go-forward"/>
<button name="action_process" type="object" states="to_be_reviewed" string="Process" icon="gtk-apply"/>
<button name="action_cancel_draft" states="cancel,done" string="Set to Draft" type="object" icon="gtk-convert"/>
<button name="action_cancel_draft" states="cancel,done" string="Set to Draft" type="object" icon="gtk-convert"/>
<button name='refresh_record' string='Refresh' type='object'/>
<field name="state" widget="statusbar" nolabel="1"/>
</header>
<sheet>
@@ -45,6 +46,7 @@
</group>
<notebook colspan="5">
<page string="Journal Items">
<label for='account_label' string='Deposits, Credits, and Interest'/>
<field colspan="4" mode="tree" name="debit_move_line_ids" nolabel="1" widget="one2many_list" height="300">
<form string="Deposits, Credits, and Interest" version="7.0">
<field name="cleared_bank_account"/>
@@ -68,6 +70,7 @@
<field name="move_line_id"/>
</tree>
</field>
<label for='account_label2' string='Checks, Withdrawals, Debits, and Service Charges'/>
<field colspan="4" mode="tree" name="credit_move_line_ids" nolabel="1" widget="one2many_list" height="300">
<form string="Checks, Withdrawals, Debits, and Service Charges" version="7.0">
<field name="cleared_bank_account"/>