openerp - Populating dropdown list according to product id in Odoo -
i have created tab in product form manufacturer. has manufacturer_name , manufacturer_partno fields , others. each product has multiple manufacturers (one many relationship). want dropdown of manufacturer_partno in add supplier form of same product (same product id). want know how possible. please me out if can.
// product class extension class product_template(osv.osv): _inherit = "product.template" _columns = { 'mrpproduct_partnumber': fields.char("part number", size=30, required=true), 'mrpproduct_description': fields.text("description", required=true), 'mrpmanufacturers_ids': fields.one2many('mrpproduct.manufacturer','mrpproduct_id',string="manufacturers"), 'mrprohs_compliant': fields.boolean('rohs compliant'), 'mrprequires_inspection': fields.boolean('requires inspection'), 'mrpperishable': fields.boolean('perishable'), 'mrpperishabledate': fields.date('perishable date'), 'mrpwashable': fields.boolean('washable'), 'mrphazardous': fields.boolean('hazardous material'), 'mrphazardouspdf': fields.binary('msdf pdf'), 'mrpmsllevel_id': fields.many2one('mrp.msllevel','msl level'), 'mrppackagingsize_id': fields.many2one('mrp.packagingsize','packaging size'), 'mrpprocesstype_id': fields.many2one('mrp.processtype','process type'), } _order="mrpproduct_partnumber asc" // manufacturer class mrpproduct_manufacturer(osv.osv): _name = "mrpproduct.manufacturer" _columns = { 'mrpmanufacturer_id': fields.many2one('mrp.manufacturers','manufacturers'), 'mrpmanufacturer_pno': fields.char("manufacturer part number", size=30, required=true), 'mrpmanufacturer_preference': fields.selection([('1','1'),('2','2'),('3','3'),('4','4'),('5','5'),('6','6'),('7','7'),('8','8'),('9','9'),], string="priority"), 'mrpdatasheet': fields.binary('data sheet'), 'mrpproduct_id': fields.many2one('product.template','manufacturer'), } _order="mrpmanufacturer_preference desc"
Comments
Post a Comment