mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
@@ -59,6 +59,7 @@ class AccountMove(models.Model):
|
||||
return super().write(vals)
|
||||
|
||||
def post(self):
|
||||
super().post()
|
||||
for move in self:
|
||||
for aml in move.line_ids.filtered("asset_profile_id"):
|
||||
depreciation_base = aml.debit or -aml.credit
|
||||
@@ -79,7 +80,15 @@ class AccountMove(models.Model):
|
||||
.create(vals)
|
||||
)
|
||||
aml.with_context(allow_asset=True).asset_id = asset.id
|
||||
super().post()
|
||||
refs = [
|
||||
"<a href=# data-oe-model=account.asset data-oe-id=%s>%s</a>"
|
||||
% tuple(name_get)
|
||||
for name_get in move.line_ids.filtered(
|
||||
"asset_profile_id"
|
||||
).asset_id.name_get()
|
||||
]
|
||||
message = _("This invoice created the asset(s): %s") % ", ".join(refs)
|
||||
move.message_post(body=message)
|
||||
|
||||
def button_draft(self):
|
||||
invoices = self.filtered(lambda r: not r.is_sale_document())
|
||||
|
||||
Reference in New Issue
Block a user