From 12a7d6cb720ff3b60f5f0d2daa274d0564cbe8c7 Mon Sep 17 00:00:00 2001 From: Henrik Norlin Date: Fri, 8 Mar 2024 14:55:57 +0100 Subject: [PATCH] [IMP] donation: add description (if the field exists) --- donation/models/account_bank_statement.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/donation/models/account_bank_statement.py b/donation/models/account_bank_statement.py index 9a175c1ae..fca6ac944 100644 --- a/donation/models/account_bank_statement.py +++ b/donation/models/account_bank_statement.py @@ -59,6 +59,11 @@ def _prepare_donation_vals(self, stline, move_line, payment_mode): "unit_price": amount, "analytic_account_id": move_line.analytic_account_id.id or False, } + # https://github.com/ows-cloud/apps/tree/14.0/donation_analytic_description + if "donation_description" in self.env["account.analytic.account"]._fields: + line_vals["description"] = move_line.analytic_account_id.with_context( + lang=stline.partner_id.lang + ).donation_description partner = stline.partner_id vals = { "company_id": company.id,