From ef5dbac5293bf000b8bc3122f74fcd06b1848cb9 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Wed, 15 Jun 2016 16:19:51 +0200 Subject: [PATCH] [FIX] sale: SO name In v8, the field "Order Reference" was part of the "Import-Compatible Export" fields. This is not the case anymore in v9 since the field is always read-only. The fix uses the same logic than v8: dedine the field as non-readonly for state "Draft" in the model, but always set it to readonly in the view. opw-676095 --- addons/sale/sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index d5ec1833bab..351b6d0602f 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -98,7 +98,7 @@ class SaleOrder(models.Model): for order in self: order.order_line._compute_tax_id() - name = fields.Char(string='Order Reference', required=True, copy=False, readonly=True, index=True, default=lambda self: _('New')) + name = fields.Char(string='Order Reference', required=True, copy=False, readonly=True, states={'draft': [('readonly', False)]}, index=True, default=lambda self: _('New')) origin = fields.Char(string='Source Document', help="Reference of the document that generated this sales order request.") client_order_ref = fields.Char(string='Customer Reference', copy=False)