Skip to content

Commit

Permalink
Merge PR #1080 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by dhongu
OCA-git-bot committed Oct 2, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 3429f7c + ba6397f commit b3123c0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions l10n_ro_account_edi_ubl/models/account_edi_format.py
Original file line number Diff line number Diff line change
@@ -35,6 +35,14 @@ def _export_cius_ro(self, invoice):
if old_attachment:
edi_document.sudo().attachment_id = False
old_attachment.unlink()
domain = [
("res_model", "=", "account.move"),
("res_id", "=", invoice.id),
("name", "=", xml_name),
]
old_attachment = self.env["ir.attachment"].sudo().search(domain)
if old_attachment:
old_attachment.unlink()
res = self.env["ir.attachment"].create(
{
"name": xml_name,

0 comments on commit b3123c0

Please sign in to comment.