Tower: upload om_account_asset 19.0.1.0.0 (was 1.0.0, via marketplace)

This commit is contained in:
2026-05-02 07:00:49 +00:00
parent cc0e6493ae
commit 23cede2cec

View File

@@ -0,0 +1,29 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _
class AssetDepreciationConfirmationWizard(models.TransientModel):
_name = "asset.depreciation.confirmation.wizard"
_description = "asset.depreciation.confirmation.wizard"
date = fields.Date(
'Account Date', required=True,
help="Choose the period for which you want to automatically post the depreciation lines of running assets",
default=fields.Date.context_today
)
def asset_compute(self):
self.ensure_one()
context = self.env.context
created_move_ids = self.env['account.asset.asset'].compute_generated_entries(self.date, asset_type=context.get('asset_type'))
return {
'name': _('Created Asset Moves') if context.get('asset_type') == 'purchase' else _('Created Revenue Moves'),
'view_type': 'form',
'view_mode': 'list,form',
'res_model': 'account.move',
'view_id': False,
'domain': "[('id','in',[" + ','.join(str(id) for id in created_move_ids) + "])]",
'type': 'ir.actions.act_window',
}