Browse Source

Jun 13: [FIX] Bug fixed 'base_accounting_kit'

pull/384/head
Cybrosys Technologies 3 weeks ago
parent
commit
ddc46950eb
  1. 2
      base_accounting_kit/__manifest__.py
  2. 5
      base_accounting_kit/doc/RELEASE_NOTES.md
  3. 43
      base_accounting_kit/models/account_asset_asset.py
  4. 2
      base_accounting_kit/wizard/asset_depreciation_confirmation.py

2
base_accounting_kit/__manifest__.py

@ -21,7 +21,7 @@
############################################################################# #############################################################################
{ {
'name': 'Odoo 18 Full Accounting Kit for Community', 'name': 'Odoo 18 Full Accounting Kit for Community',
'version': '18.0.3.0.6', 'version': '18.0.4.0.6',
'category': 'Accounting', 'category': 'Accounting',
'live_test_url': 'https://kit.easyinstance.com/web/login?redirect=/odoo/accounting', 'live_test_url': 'https://kit.easyinstance.com/web/login?redirect=/odoo/accounting',
'summary': """Odoo 18 Accounting, Odoo 18 Accounting Reports, Odoo18 Accounting, Odoo Accounting, Odoo18 Financial Reports, Odoo18 Asset, Odoo18 Profit and Loss, PDC, Followups, Odoo18, Accounting, Odoo Apps, Reports""", 'summary': """Odoo 18 Accounting, Odoo 18 Accounting Reports, Odoo18 Accounting, Odoo Accounting, Odoo18 Financial Reports, Odoo18 Asset, Odoo18 Profit and Loss, PDC, Followups, Odoo18, Accounting, Odoo Apps, Reports""",

5
base_accounting_kit/doc/RELEASE_NOTES.md

@ -39,3 +39,8 @@
#### Version 18.0.3.0.6 #### Version 18.0.3.0.6
#### FIX #### FIX
- Fixed the CSV bank statement import errors for unformatted files. - Fixed the CSV bank statement import errors for unformatted files.
#### 12.06.2025
#### Version 18.0.4.0.6
#### FIX
- Updated the generation of asset entry when the compute depreciation button click.

43
base_accounting_kit/models/account_asset_asset.py

@ -324,13 +324,17 @@ class AccountAssetAsset(models.Model):
year = depreciation_date.year year = depreciation_date.year
self.write({'depreciation_line_ids': commands}) self.write({'depreciation_line_ids': commands})
last_depr_date = None
if self.depreciation_line_ids:
last_depr_date = max(self.depreciation_line_ids.mapped('depreciation_date'))
if last_depr_date:
self._compute_entries(date=last_depr_date)
return True return True
def validate(self): def validate(self):
"""Update the state to 'open' and track specific fields based on the asset's method.""" """Update the state to 'open' and track specific fields based on the asset's method."""
self.write({'state': 'open'}) self.write({'state': 'open'})
fields = [ field = [
'method', 'method',
'method_number', 'method_number',
'method_period', 'method_period',
@ -340,7 +344,7 @@ class AccountAssetAsset(models.Model):
'salvage_value', 'salvage_value',
'invoice_id', 'invoice_id',
] ]
ref_tracked_fields = self.env['account.asset.asset'].fields_get(fields) ref_tracked_fields = self.env['account.asset.asset'].fields_get(field)
for asset in self: for asset in self:
tracked_fields = ref_tracked_fields.copy() tracked_fields = ref_tracked_fields.copy()
if asset.method == 'linear': if asset.method == 'linear':
@ -351,20 +355,28 @@ class AccountAssetAsset(models.Model):
del (tracked_fields['method_number']) del (tracked_fields['method_number'])
dummy, tracking_value_ids = asset._mail_track(tracked_fields, dummy, tracking_value_ids = asset._mail_track(tracked_fields,
dict.fromkeys( dict.fromkeys(
fields)) field))
asset.message_post(subject=_('Asset created'), asset.message_post(subject=_('Asset created'),
tracking_value_ids=tracking_value_ids) tracking_value_ids=tracking_value_ids)
return {
'name': _('Asset Depreciation Confirmation'), today_date = fields.Date.context_today(self)
'type': 'ir.actions.act_window',
'res_model': 'asset.depreciation.confirmation', # Split lines based on depreciation_date
'view_mode': 'form', draft_lines = asset.depreciation_line_ids.filtered(lambda l: l.move_id and l.move_id.state == 'draft')
'target': 'new',
'context': { #Post only entries before today
'default_date': Date.today(), lines_to_post_now = draft_lines.filtered(lambda l: l.depreciation_date < today_date)
'asset_type': self.type, moves_to_post_now = lines_to_post_now.mapped('move_id')
}, if moves_to_post_now:
} moves_to_post_now._post()
#Set auto_post='at_date' for entries today or later
future_lines = draft_lines.filtered(lambda l: l.depreciation_date >= today_date)
future_moves = future_lines.mapped('move_id')
if future_moves:
future_moves.write({'auto_post': 'at_date'})
return True
def _get_disposal_moves(self): def _get_disposal_moves(self):
@ -544,6 +556,7 @@ class AccountAssetAsset(models.Model):
'name': _('Journal Entries'), 'name': _('Journal Entries'),
'view_mode': 'list,form', 'view_mode': 'list,form',
'res_model': 'account.move', 'res_model': 'account.move',
'views': [(self.env.ref('account.view_move_tree').id, 'list'), (False, 'form')],
'view_id': False, 'view_id': False,
'type': 'ir.actions.act_window', 'type': 'ir.actions.act_window',
'domain': [('id', 'in', move_ids)], 'domain': [('id', 'in', move_ids)],

2
base_accounting_kit/wizard/asset_depreciation_confirmation.py

@ -46,3 +46,5 @@ class AssetDepreciationConfirmationWizard(models.TransientModel):
'domain': "[('id','in',[" + ','.join(str(id) for id in created_move_ids) + "])]", 'domain': "[('id','in',[" + ','.join(str(id) for id in created_move_ids) + "])]",
'type': 'ir.actions.act_window', 'type': 'ir.actions.act_window',
} }

Loading…
Cancel
Save