diff --git a/addons/account/models/account_bank_statement_line.py b/addons/account/models/account_bank_statement_line.py index 5fe00e2b20d7a..2f4f0773b744b 100644 --- a/addons/account/models/account_bank_statement_line.py +++ b/addons/account/models/account_bank_statement_line.py @@ -453,7 +453,7 @@ def _find_or_create_bank_account(self): 'partner_id': self.partner_id.id, 'journal_id': None, }) - return bank_account.filtered(lambda x: x.company_id.id in (False, self.company_id.id)) + return bank_account.filtered(lambda x: x.company_id.id in (False, self.company_id.id)).sudo(False) def _get_amounts_with_currencies(self): """ diff --git a/addons/account/views/bill_preview_template.xml b/addons/account/views/bill_preview_template.xml index b342ba0fad369..e1b67d48d100b 100644 --- a/addons/account/views/bill_preview_template.xml +++ b/addons/account/views/bill_preview_template.xml @@ -8,7 +8,7 @@
- Logo + Logo
diff --git a/addons/account/views/report_invoice.xml b/addons/account/views/report_invoice.xml index 6af975feb2c7b..e9daa3c85fa9e 100644 --- a/addons/account/views/report_invoice.xml +++ b/addons/account/views/report_invoice.xml @@ -22,6 +22,9 @@ Tax ID:
+
+ ICE: +
@@ -33,6 +36,9 @@ Tax ID: +
+ ICE: +
@@ -44,6 +50,9 @@ Tax ID: +
+ ICE: +
diff --git a/addons/account/wizard/account_invoice_send.py b/addons/account/wizard/account_invoice_send.py index 47efe2eb823f4..9dfa520cad9cb 100644 --- a/addons/account/wizard/account_invoice_send.py +++ b/addons/account/wizard/account_invoice_send.py @@ -30,6 +30,11 @@ class AccountInvoiceSend(models.TransientModel): compute='_compute_move_types', readonly=True) + # Technical field to display or not the attachment button + display_attachment_fields = fields.Boolean(compute='_compute_display_attachment_fields') + # Technical field to display or not a warning icon besides attachments not supported + attachments_not_supported = fields.Json(compute='_compute_attachments_not_supported') + @api.model def default_get(self, fields): res = super(AccountInvoiceSend, self).default_get(fields) @@ -112,6 +117,16 @@ def _compute_invoice_without_email(self): else: wizard.invoice_without_email = False + @api.depends('is_email', 'composition_mode') + def _compute_display_attachment_fields(self): + for wizard in self: + wizard.display_attachment_fields = wizard.is_email and wizard.composition_mode != 'mass_mail' + + @api.depends('display_attachment_fields', 'attachment_ids') + def _compute_attachments_not_supported(self): + for wizard in self: + wizard.attachments_not_supported = {} + def _send_email(self): if self.is_email: # with_context : we don't want to reimport the file we just exported. diff --git a/addons/account/wizard/account_invoice_send_views.xml b/addons/account/wizard/account_invoice_send_views.xml index e732600c140be..6d1b6c0067c72 100644 --- a/addons/account/wizard/account_invoice_send_views.xml +++ b/addons/account/wizard/account_invoice_send_views.xml @@ -18,6 +18,8 @@ + +
@@ -53,9 +55,6 @@
- - - @@ -63,6 +62,16 @@ + + + +