[FIX]account_move_protect_deleting:check if account.cash.deposit and account.check.deposit models exists
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
"name": "account_move_protect_deleting",
|
"name": "account_move_protect_deleting",
|
||||||
"version": "16.0.1.0.1",
|
"version": "16.0.1.0.2",
|
||||||
"author": "Elabore",
|
"author": "Elabore",
|
||||||
"website": "https://elabore.coop",
|
"website": "https://elabore.coop",
|
||||||
"maintainer": "Boris Gallet",
|
"maintainer": "Boris Gallet",
|
||||||
|
@@ -12,13 +12,19 @@ class AccountMove(models.Model):
|
|||||||
This work the same with Cash deposit
|
This work the same with Cash deposit
|
||||||
"""
|
"""
|
||||||
for rec in self:
|
for rec in self:
|
||||||
|
|
||||||
|
is_cash_deposit = False
|
||||||
|
is_check_deposit = False
|
||||||
|
|
||||||
# search in account.cash.deposit if account move is this one
|
# search in account.cash.deposit if account move is this one
|
||||||
|
if rec.env.get('account.cash.deposit'):
|
||||||
for cash_deposit in rec.env['account.cash.deposit'].search([]):
|
for cash_deposit in rec.env['account.cash.deposit'].search([]):
|
||||||
if cash_deposit.move_id == rec:
|
if cash_deposit.move_id == rec:
|
||||||
print (cash_deposit.move_id, rec)
|
print (cash_deposit.move_id, rec)
|
||||||
is_cash_deposit = True
|
is_cash_deposit = True
|
||||||
|
|
||||||
# search in account.check.deposit if account move is this one
|
# # search in account.check.deposit if account move is this one
|
||||||
|
if rec.env.get('account.check.deposit'):
|
||||||
for check_deposit in rec.env['account.check.deposit'].search([]):
|
for check_deposit in rec.env['account.check.deposit'].search([]):
|
||||||
if check_deposit.move_id == rec:
|
if check_deposit.move_id == rec:
|
||||||
is_check_deposit = True
|
is_check_deposit = True
|
||||||
|
Reference in New Issue
Block a user