Vo Minh Thu (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-consistent-account-cash-statement-vmt 
into lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-consistent-account-cash-statement-vmt/+merge/63866
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-consistent-account-cash-statement-vmt/+merge/63866
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-consistent-account-cash-statement-vmt.
=== modified file 'account/account_bank_statement.py'
--- account/account_bank_statement.py	2011-05-25 06:13:53 +0000
+++ account/account_bank_statement.py	2011-06-08 13:48:40 +0000
@@ -90,7 +90,8 @@
                         res[statement.id] -= res_currency_obj.compute(cursor,
                                 user, company_currency_id, currency_id,
                                 line.credit, context=context)
-            if statement.state == 'draft':
+
+            if statement.state in ('draft', 'open'):
                 for line in statement.line_ids:
                     res[statement.id] += line.amount
         for r in res:
@@ -127,7 +128,7 @@
     _name = "account.bank.statement"
     _description = "Bank Statement"
     _columns = {
-        'name': fields.char('Name', size=64, required=True, help='if you give the Name other then /, its created Accounting Entries Move will be with same name as statement name. This allows the statement entries to have the same references than the statement itself', states={'confirm': [('readonly', True)]}),
+        'name': fields.char('Name', size=64, required=True, states={'draft': [('readonly', False)]}, readonly=True, help='if you give the Name other then /, its created Accounting Entries Move will be with same name as statement name. This allows the statement entries to have the same references than the statement itself'), # readonly for account_cash_statement
         'date': fields.date('Date', required=True, states={'confirm': [('readonly', True)]}),
         'journal_id': fields.many2one('account.journal', 'Journal', required=True,
             readonly=True, states={'draft':[('readonly',False)]}),
@@ -135,20 +136,19 @@
             states={'confirm':[('readonly', True)]}),
         'balance_start': fields.float('Starting Balance', digits_compute=dp.get_precision('Account'),
             states={'confirm':[('readonly',True)]}),
-        'balance_end_real': fields.float('Ending Balance', digits_compute=dp.get_precision('Account'),
-            states={'confirm':[('readonly', True)]}),
-        'balance_end': fields.function(_end_balance, method=True, string='Balance'),
+        'balance_end_real': fields.float('Closing Balance', digits_compute=dp.get_precision('Account'), states={'confirm': [('readonly', True)]}, help="closing balance entered by the cashbox verifier"),
+        'balance_end': fields.function(_end_balance, method=True, store=True, string='Balance'),
         'company_id': fields.related('journal_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True),
         'line_ids': fields.one2many('account.bank.statement.line',
             'statement_id', 'Statement lines',
             states={'confirm':[('readonly', True)]}),
         'move_line_ids': fields.one2many('account.move.line', 'statement_id',
             'Entry lines', states={'confirm':[('readonly',True)]}),
-        'state': fields.selection([('draft', 'Draft'),('confirm', 'Confirmed')],
+        'state': fields.selection([('draft', 'Draft'),('confirm', 'Closed'),('open','Open')],
             'State', required=True,
             states={'confirm': [('readonly', True)]}, readonly="1",
             help='When new statement is created the state will be \'Draft\'. \
-            \n* And after getting confirmation from the bank it will be in \'Confirmed\' state.'),
+            \n* And after getting confirmation from the bank it will be in \'Confirmed\' state.'), # open for account_cash_statement
         'currency': fields.function(_currency, method=True, string='Currency',
             type='many2one', relation='res.currency'),
         'account_id': fields.related('journal_id', 'default_debit_account_id', type='many2one', relation='account.account', string='Account used in this journal', readonly=True, help='used in statement reconciliation domain, but shouldn\'t be used elswhere.'),

=== modified file 'account/account_cash_statement.py'
--- account/account_cash_statement.py	2011-05-02 18:46:43 +0000
+++ account/account_cash_statement.py	2011-06-08 13:48:40 +0000
@@ -218,18 +218,11 @@
         return res
 
     _columns = {
-        'balance_end_real': fields.float('Closing Balance', digits_compute=dp.get_precision('Account'), states={'confirm': [('readonly', True)]}, help="closing balance entered by the cashbox verifier"),
-        'state': fields.selection(
-            [('draft', 'Draft'),
-            ('confirm', 'Closed'),
-            ('open','Open')], 'State', required=True, states={'confirm': [('readonly', True)]}, readonly="1"),
         'total_entry_encoding': fields.function(_get_sum_entry_encoding, method=True, store=True, string="Cash Transaction", help="Total cash transactions"),
         'closing_date': fields.datetime("Closed On"),
-        'balance_end': fields.function(_end_balance, method=True, store=True, string='Balance', help="Closing balance based on Starting Balance and Cash Transactions"),
         'balance_end_cash': fields.function(_balance_end_cash, method=True, store=True, string='Balance', help="Closing balance based on cashBox"),
         'starting_details_ids': fields.one2many('account.cashbox.line', 'starting_id', string='Opening Cashbox'),
         'ending_details_ids': fields.one2many('account.cashbox.line', 'ending_id', string='Closing Cashbox'),
-        'name': fields.char('Name', size=64, required=True, states={'draft': [('readonly', False)]}, readonly=True, help='if you give the Name other then /, its created Accounting Entries Move will be with same name as statement name. This allows the statement entries to have the same references than the statement itself'),
         'user_id': fields.many2one('res.users', 'Responsible', required=False),
     }
     _defaults = {

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to