From 74bb54bbc659e83d7e5fb894f3001451a68cc22a Mon Sep 17 00:00:00 2001 From: Florian Pose Date: Thu, 17 Mar 2022 16:34:03 +0000 Subject: [PATCH] [FIX] l10n_din5008_purchase: Fixed purchase document title. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Description of the issue/feature this PR addresses: The purchase order document in the German localization (l10n_din5008_purchase) is titled "Purchase Order" way too early. This can lead to confusion. In the worst case, the vendor will treat the request for quotation as purchase order. Current behavior before PR: If the document has been sent once and then is sent again (either to the same recipient, or another), the document is titled "Purchase Order", which will most definitely be treated as such by the recipient. Desired behavior after PR is merged: As long as the document is not confirmed (states "draft", "sent", "to approve"), the title has to be "Request for Quotation". After that (states "purchase", "done"), the title has to be "Purchase Order". closes odoo/odoo#87276 X-original-commit: 1238b3f7441f89d959638b9b4520ebfa19430dc5 Signed-off-by: William André (wan) --- addons/l10n_din5008_purchase/models/purchase.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/l10n_din5008_purchase/models/purchase.py b/addons/l10n_din5008_purchase/models/purchase.py index db7041932ee..a88a254e577 100644 --- a/addons/l10n_din5008_purchase/models/purchase.py +++ b/addons/l10n_din5008_purchase/models/purchase.py @@ -32,9 +32,9 @@ class PurchaseOrder(models.Model): def _compute_l10n_din5008_document_title(self): for record in self: - if record.state == 'draft': + if record.state in ['draft', 'sent', 'to approve']: record.l10n_din5008_document_title = _("Request for Quotation") - elif record.state in ['sent', 'to approve', 'purchase', 'done']: + elif record.state in ['purchase', 'done']: record.l10n_din5008_document_title = _("Purchase Order") elif record.state == 'cancel': record.l10n_din5008_document_title = _("Cancelled Purchase Order")