state field is missing :(

Bug #337747 reported by Nilesh
2
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Fix Released
Undecided
Unassigned

Bug Description

I cant find state in columns of expenses line
class hr_expense_line(osv.osv):
    _name = "hr.expense.line"
    _description = "Expense Line"
    def _amount(self, cr, uid, ids, field_name, arg, context):
        if not len(ids):
            return {}
        id_set = ",".join(map(str, ids))
        cr.execute("SELECT l.id,COALESCE(SUM(l.unit_amount*l.unit_quantity),0) AS amount FROM hr_expense_line l WHERE id IN ("+id_set+") GROUP BY l.id ")
        res = dict(cr.fetchall())
        return res

    _columns = {
        'name': fields.char('Short Description', size=128, required=True),
        'date_value': fields.date('Date', required=True),
        'expense_id': fields.many2one('hr.expense.expense', 'Expense', ondelete='cascade', select=True),
        'total_amount': fields.function(_amount, method=True, string='Total'),
        'unit_amount': fields.float('Unit Price', readonly=True, states={'draft':[('readonly',False)]}),
        'unit_quantity': fields.float('Quantities', readonly=True, states={'draft':[('readonly',False)]}),
        'product_id': fields.many2one('product.product', 'Product', readonly=True, states={'draft':[('readonly',False)]}),
        'uom_id': fields.many2one('product.uom', 'UoM', readonly=True, states={'draft':[('readonly',False)]}),
        'description': fields.text('Description'),
        'analytic_account': fields.many2one('account.analytic.account','Analytic account'),
        'ref': fields.char('Reference', size=32),
        'sequence' : fields.integer('Sequence'),
    }

in this code
        'product_id': fields.many2one('product.product', 'Product', readonly=True, states={'draft':[('readonly',False)]}),

means i can fill product when state=draft

but i tried my best to find that field in this object but i cant find that. So please help me to find that.

i check in both

http://bazaar.launchpad.net/%7Eopenerp/openobject-addons/5.0/
and
http://bazaar.launchpad.net/%7Eopenerp/openobject-addons/trunk/

so please try to solve that.

Revision history for this message
Husen Daudi (husendaudi) wrote :

Fixed in trunk revision 2232

Changed in openobject-server:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.