diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 13803d3ff79..ca66c7e1b4d 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -481,8 +481,8 @@ class account_move_line(osv.osv): 'quantity': fields.float('Quantity', digits=(16,2), help="The optional quantity expressed by this line, eg: number of product sold. The quantity is not a legal requirement but is very useful for some reports."), 'product_uom_id': fields.many2one('product.uom', 'UoM'), 'product_id': fields.many2one('product.product', 'Product'), - 'debit': fields.float('Debit', digits_compute=dp.get_precision('Account')), - 'credit': fields.float('Credit', digits_compute=dp.get_precision('Account')), + 'debit': fields.float('Debit', digits_compute=dp.get_precision('Account'), required=True), + 'credit': fields.float('Credit', digits_compute=dp.get_precision('Account'), required=True), 'account_id': fields.many2one('account.account', 'Account', required=True, ondelete="cascade", domain=[('type','<>','view'), ('type', '<>', 'closed')], select=2), 'move_id': fields.many2one('account.move', 'Move', ondelete="cascade", help="The move of this entry line.", select=2, required=True), 'narration': fields.related('move_id','narration', type='text', relation='account.move', string='Internal Note'), @@ -559,6 +559,8 @@ class account_move_line(osv.osv): 'state': 'draft', 'currency_id': _get_currency, 'journal_id': lambda self, cr, uid, c: c.get('journal_id', False), + 'credit': 0.0, + 'debit': 0.0, 'account_id': lambda self, cr, uid, c: c.get('account_id', False), 'period_id': lambda self, cr, uid, c: c.get('period_id', False), 'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.move.line', context=c)