Commit Graph
3 Commits
Author SHA1 Message Date
Thibault Delavallée 11d44b9062 [IMP] account, website_sale: improve docstrings / notes
Purpose is to cleanup some remaining notes in code to better know some cleaning
is long awaited, planned but still not in WIP. Brol is not a recognized word
in the whole world. Also add some query counters explanation as counters are
a bit different depending on accounting, community and enterprise runs.

Part-of: odoo/odoo#86254
2022-03-14 17:28:26 +00:00
Thibault Delavallée d0e0db3b8e [IMP] account: add performance test on account invoice send wizard
Just have some numbers before working on composer onchange removal and see
its impact.

Task-2789182 (Account: Invoice send performance test)
Prepares Task-2088884 (Mail: Composer onchange removal)

closes odoo/odoo#85902

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-03-08 16:48:42 +00:00
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