[IMP] account: put the move_id field of account.move.line object as required on the model object. Force that attribute to False in the views, as the system is already creating a new when needed. This change is not supposed to change the behavior, put it puts a constraint NOT NULL on the link between account.move.line and account.move
bzr revid: qdp-launchpad@tinyerp.com-20100824110414-6gj3asrsj8zxc8m1
This commit is contained in:
parent
46d4da2bac
commit
d6a478e788
|
@ -424,7 +424,7 @@ class account_move_line(osv.osv):
|
|||
'debit': fields.float('Debit', digits_compute=dp.get_precision('Account')),
|
||||
'credit': fields.float('Credit', digits_compute=dp.get_precision('Account')),
|
||||
'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),
|
||||
'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='Narration'),
|
||||
'ref': fields.char('Ref.', size=64),
|
||||
'statement_id': fields.many2one('account.bank.statement', 'Statement', help="The bank statement used for bank reconciliation", select=1),
|
||||
|
@ -917,6 +917,9 @@ class account_move_line(osv.osv):
|
|||
elif field == 'credit':
|
||||
attrs.append('sum="Total credit"')
|
||||
|
||||
elif field == 'move_id':
|
||||
attrs.append('required="False"')
|
||||
|
||||
elif field == 'account_tax_id':
|
||||
attrs.append('domain="[(\'parent_id\',\'=\',False)]"')
|
||||
attrs.append("context=\"{'journal_id':journal_id}\"")
|
||||
|
|
Loading…
Reference in New Issue