# -*- coding: utf-8 -*-

from openerp.osv import orm, fields


class sale_order(orm.Model):
    _inherit = 'sale.order'

    _columns = {
        # override only to change the 'string' argument
        # from 'Customer' to 'Requesting Entity'
        'partner_id': fields.many2one(
            'res.partner',
            'Requesting Entity',
            readonly=True,
            states={'draft': [('readonly', False)],
                    'sent': [('readonly', False)]},
            required=True,
            change_default=True,
            select=True,
            track_visibility='always'),
        'consignee_id': fields.many2one(
            'res.partner',
            string='Consignee',
            required=True),
        'incoterm_address': fields.char(
            'Incoterm Place',
            help="Incoterm Place of Delivery. "
                 "International Commercial Terms are a series of "
                 "predefined commercial terms used in "
                 "international transactions."),
        'requested_by': fields.text('Requested By'),
    }

@@ -1059,18 +1059,835 @@
 ested By'),%0A
+         'state': fields.selection(%5B%0A            ('draft', 'Draft Cost Estimate'),%0A            ('sent', 'Cost Estimate Sent'),%0A            ('cancel', 'Cancelled'),%0A            ('waiting_date', 'Waiting Schedule'),%0A            ('progress', 'Logistic Order'),%0A            ('manual', 'Logistic Order to Invoice'),%0A            ('invoice_except', 'Invoice Exception'),%0A            ('done', 'Done'),%0A            %5D, 'Status', readonly=True, track_visibility='onchange',%0A            help=%22Gives the status of the cost estimate or logistic order. %5CnThe exception status is automatically set when a cancel operation occurs in the processing of a document linked to the logistic order. %5CnThe 'Waiting Schedule' status is set when the invoice is confirmed but waiting for the scheduler to run on the order date.%22, select=True),%0A%0A
     %7D%0A

Rename state of SO according to LO and Cost Estimate