Merge pull request #34 from expsa/ctp_database

fix_ctp
This commit is contained in:
esam-sermah 2025-10-04 09:08:59 +03:00 committed by GitHub
commit 892b1fd0f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 4 deletions

View File

@ -164,7 +164,6 @@ class CtpDatabaseCleanUp(models.TransientModel):
]
return self.remove_data(to_removes, seqs)
# VVVVVVVVVVV قم باستبدال الدالة التالية VVVVVVVVVVV
def remove_account(self):
to_removes = [
'payment.transaction',
@ -178,7 +177,6 @@ class CtpDatabaseCleanUp(models.TransientModel):
'account.move',
]
res = self.remove_data(to_removes, [])
# FIX: The domain syntax was incorrect (extra '|' at the end)
domain = [
('company_id', '=', self.env.company.id),
'|', ('code', '=ilike', 'account.%'),
@ -196,7 +194,7 @@ class CtpDatabaseCleanUp(models.TransientModel):
})
except Exception as e:
_logger.error('Reset Sequence Data error: %s,%s', domain, e)
self._cr.rollback() # Rollback on error
self._cr.rollback()
return res
def remove_account_chart(self):
@ -230,7 +228,6 @@ class CtpDatabaseCleanUp(models.TransientModel):
'property_account_expense_id': False,
})
# FIX: Check if 'stock.location' model exists before trying to access it
if self.env['ir.model']._get('stock.location'):
self.env['stock.location'].search([]).write({
'valuation_in_account_id': False, 'valuation_out_account_id': False,