Files
odoo_source/addons/account/models/__init__.py
T
Adrien Widart bdcc012004 [FIX] account, mail: link attachments to invoice
When using the "Send & Print" functionality, if the user adds an
attachment, the latter won't be linked to the record.

To reproduce the error:
1. Open a posted invoice
2. Send & Print
3. Attach a file > Select a file on your device
4. Send the email

Error: The invoice's PDF is added to record's attachments, but not the
other file (from step 3).

When the module selects the attachments that need to be linked to the
invoice, it only keeps the ones currently linked to `mail.compose.message`:
https://github.com/odoo/odoo/blob/6441ab71cb68648aa735057952bf757677a20ee3/addons/mail/models/mail_thread.py#L1719-L1725
This is correct when the user creates a message directly in the chatter.
However, when the mail is created thanks to `Send & Print` functionality,
the attachment is linked to `account.invoice.send`.

Another flow have a similar issue: from invoices list, select few ones,
Action > Send & Print: the generated PDF won't be attached to their
invoice. In such a situation, here is the source of the problem:
https://github.com/odoo/odoo/blob/05ad6c477f7da2a495e5baf5b4629323b9d11fa0/addons/mail/wizard/mail_compose_message.py#L363-L367
There isn't any information about the invoice, therefore it is not
possible to linked the attachment to it.

OPW-2438457

closes odoo/odoo#71495

X-original-commit: 98d3748aca724ef06db89294531d82679df45b74
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2021-05-31 12:39:11 +00:00

35 lines
1.0 KiB
Python

# -*- coding: utf-8 -*-
from . import sequence_mixin
from . import partner
from . import res_partner_bank
from . import account_account_tag
from . import account_account
from . import account_journal
from . import account_tax
from . import account_tax_carryover_line
from . import account_tax_report
from . import account_reconcile_model
from . import account_payment_term
from . import account_move
from . import account_analytic_default
from . import account_partial_reconcile
from . import account_full_reconcile
from . import account_payment
from . import account_payment_method
from . import account_bank_statement
from . import chart_template
from . import account_analytic_line
from . import account_journal_dashboard
from . import product
from . import company
from . import res_config_settings
from . import account_cash_rounding
from . import account_incoterms
from . import digest
from . import res_users
from . import ir_actions_report
from . import res_currency
from . import res_bank
from . import mail_thread