mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
[FIX] fix datamodel structure, indeed check_payment_ids should be a m2o. In the view we still keep the widget
This commit is contained in:
@@ -40,11 +40,8 @@ class account_check_deposit(orm.Model):
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Name', size=64, required=True, readonly=True,
|
||||
tates={'draft':[('readonly',False)]}),
|
||||
'check_payment_ids': fields.many2many('account.move.line',
|
||||
'account_move_line_deposit_rel',
|
||||
'check_payment_ids': fields.one2many('account.move.line',
|
||||
'check_deposit_id',
|
||||
'move_line_id',
|
||||
'Check Payments',
|
||||
readonly=True,
|
||||
states={'draft':[('readonly',False)]}),
|
||||
@@ -88,9 +85,11 @@ class account_check_deposit(orm.Model):
|
||||
if not deposit.journal_id.update_posted:
|
||||
raise osv.except_osv(_('Error!'), _('You cannot modify a posted entry of this journal.\nFirst you should set the journal to allow cancelling entries.'))
|
||||
for line in deposit.check_payment_ids:
|
||||
line.reconcile_id.unlink()
|
||||
if line.reconcile_id:
|
||||
line.reconcile_id.unlink()
|
||||
deposit.move_id.button_cancel()
|
||||
deposit.move_id.unlink()
|
||||
deposit.write({'cancel': 'draft'})
|
||||
return True
|
||||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
@@ -191,9 +190,6 @@ class account_move_line(orm.Model):
|
||||
_inherit = "account.move.line"
|
||||
|
||||
_columns = {
|
||||
'check_deposit_id': fields.many2many('account.check.deposit',
|
||||
'account_move_line_deposit_rel',
|
||||
'check_deposit_id',
|
||||
'move_line_id',
|
||||
'check_deposit_id': fields.many2one('account.check.deposit',
|
||||
'Check Deposit'),
|
||||
}
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_account_check_deposit_account_check_deposit_group_manager","account_check_deposit_account_check_deposit_group_manager","model_account_check_deposit","base.group_system",1,1,1,1
|
||||
"access_account_check_deposit_account_check_deposit_group_user","account_check_deposit_account_check_deposit_group_user","model_account_check_deposit","base.group_user",1,0,0,0
|
||||
"access_account_check_deposit_account_check_deposit_group_manager","account_check_deposit_account_check_deposit_group_manager","model_account_check_deposit","account.group_account_user",1,1,1,1
|
||||
|
||||
|
Reference in New Issue
Block a user