account: remove state reconciled from account.move.line

Use instead the reconciled_id

bzr revid: ced-ae3b56283409ebaf5d551eafd2b553d6cf6a826e
This commit is contained in:
ced 2007-07-09 09:08:50 +00:00
parent 97e1597928
commit baf1b347fe
2 changed files with 7 additions and 10 deletions

View File

@ -163,11 +163,11 @@ class account_move_line(osv.osv):
_columns = {
'name': fields.char('Name', size=64, required=True),
'quantity': fields.float('Quantity', digits=(16,2), help="The optionnal quantity expressed by this line, eg: number of product sold. The quantity is not a legal requirement but is very usefull for some reports."),
'debit': fields.float('Debit', digits=(16,2), states={'reconciled':[('readonly',True)]}),
'credit': fields.float('Credit', digits=(16,2), states={'reconciled':[('readonly',True)]}),
'account_id': fields.many2one('account.account', 'Account', required=True, ondelete="cascade", states={'reconciled':[('readonly',True)]}, domain=[('type','<>','view'), ('type', '<>', 'closed')]),
'debit': fields.float('Debit', digits=(16,2), states={'valid':[('readonly',True)]}),
'credit': fields.float('Credit', digits=(16,2), states={'valid':[('readonly',True)]}),
'account_id': fields.many2one('account.account', 'Account', required=True, ondelete="cascade", states={'valid':[('readonly',True)]}, domain=[('type','<>','view'), ('type', '<>', 'closed')]),
'move_id': fields.many2one('account.move', 'Entry', ondelete="cascade", states={'reconciled':[('readonly',True)]}, help="The entry of this entry line.", select=2),
'move_id': fields.many2one('account.move', 'Entry', ondelete="cascade", states={'valid':[('readonly',True)]}, help="The entry of this entry line.", select=2),
'ref': fields.char('Ref.', size=32),
'statement_id': fields.many2one('account.bank.statement', 'Statement', help="The bank statement used for bank reconciliation", select=True),
@ -179,15 +179,15 @@ class account_move_line(osv.osv):
'journal_id': fields.many2one('account.journal', 'Journal', required=True),
'blocked': fields.boolean('Litigation', help="You can check this box to mark the entry line as a litigation with the associated partner"),
'partner_id': fields.many2one('res.partner', 'Partner Ref.', states={'reconciled':[('readonly',True)]}),
'date_maturity': fields.date('Maturity date', states={'reconciled':[('readonly',True)]}, help="This field is used for payable and receivable entries. You can put the limit date for the payment of this entry line."),
'partner_id': fields.many2one('res.partner', 'Partner Ref.', states={'valid':[('readonly',True)]}),
'date_maturity': fields.date('Maturity date', states={'valid':[('readonly',True)]}, help="This field is used for payable and receivable entries. You can put the limit date for the payment of this entry line."),
'date': fields.date('Effective date', required=True),
'date_created': fields.date('Creation date'),
'analytic_lines': fields.one2many('account.analytic.line', 'move_id', 'Analytic lines'),
'centralisation': fields.selection([('normal','Normal'),('credit','Credit Centralisation'),('debit','Debit Centralisation')], 'Centralisation', size=6),
'balance': fields.function(_balance, method=True, string='Balance'),
'active': fields.boolean('Active'),
'state': fields.selection([('draft','Draft'), ('valid','Valid'), ('reconciled','Reconciled')], 'State', readonly=True),
'state': fields.selection([('draft','Draft'), ('valid','Valid')], 'State', readonly=True),
'tax_code_id': fields.many2one('account.tax.code', 'Tax Account'),
'tax_amount': fields.float('Tax/Base Amount', digits=(16,2), select=True),
}
@ -322,7 +322,6 @@ class account_move_line(osv.osv):
writeoff_line_ids = self.search(cr, uid, [('move_id', '=', writeoff_move_id), ('account_id', '=', account_id)])
ids += writeoff_line_ids
self.write(cr, uid, ids, {'state': 'reconciled'}, update_check=False)
r_id = self.pool.get('account.move.reconcile').create(cr, uid, {
#'name': date,
'type': type,

View File

@ -40,7 +40,6 @@ def _trans_unrec(self, cr, uid, data, context):
recs = filter(lambda x: x['reconcile_id'], recs)
rec_ids = [rec['reconcile_id'][0] for rec in recs]
if len(rec_ids):
cr.execute('update account_move_line set state=\'valid\' where reconcile_id in ('+','.join(map(str,rec_ids))+')')
pooler.get_pool(cr.dbname).get('account.move.reconcile').unlink(cr, uid, rec_ids)
return {}
@ -61,7 +60,6 @@ wiz_unreconcile('account.move.line.unreconcile')
def _trans_unrec_reconcile(self, cr, uid, data, context):
rec_ids = data['ids']
if len(rec_ids):
cr.execute('update account_move_line set state=\'valid\' where reconcile_id in ('+','.join(map(str,rec_ids))+')')
pooler.get_pool(cr.dbname).get('account.move.reconcile').unlink(cr, uid, rec_ids)
return {}