Hi,

I am creating a wizard where a user selects a material type in the first form.  
Then in the second form, a list of material alloys is loaded based on which 
material type was first selected.  The relationship between the two is 
many2many, but as the user selects their choice, it turns into a many2one.  
Would my best option be a filter where the domain uses a sql query?  Here is my 
model:



class material_type(osv.osv):
    _name = "material.type"
    _description = "Material Types"
    _columns = {
        "name": fields.char("Type Name", size=64, 
required=True, translate=True),
    }
    
class material_alloy(osv.osv):
    _name = "material.alloy"
    _description = "Material Alloys"    
    
    _columns = {
        "name": fields.char("Alloy Name", size=64, 
required=True, translate=True),
        "msds_book": fields.char("MSDS Book", 
size=35, required=False, translate=True),
        "msds_page": fields.char("MSDS Page", 
size=35, required=False, translate=True),
        "msds_no": fields.char("MSDS No", size=35, 
required=False, translate=True),
        "material_type_ids": 
fields.many2many("material.type", "material_alloy_type_rel", 
"material_alloy_id", "material_type_id", "Material Types"),
        #"options": fields.function()
    }



Would this be my only option to filter?


domain = [('alloy_id', 'in', 'any(SQL to return related alloys in 
many2many)')] 


Any help in the right direction would really help.  Thanks!




-------------------- m2f --------------------

--
http://www.openobject.com/forum/viewtopic.php?p=37025#37025

-------------------- m2f --------------------


_______________________________________________
Tinyerp-users mailing list
http://tiny.be/mailman2/listinfo/tinyerp-users

Reply via email to