[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
This commit is contained in:
Nicolas Martinelli
2016-06-16 09:30:33 +02:00
parent ff95ea976d
commit ef5dbac529
+1 -1
View File
@@ -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)