這是工作的罰款many2one場,所以我想「AREA_ID」即hindu_data_super類應該在many2many或請讓我知道我可以在一個區域中選擇多個項目......我有many2one領域的域名過濾代碼。如何爲許多人做?
class hindu_desh(osv.Model):
_name="hindu.desh"
_description="Define districts"
_columns={ 'name':fields.char('District Name',size=64,required=True) }
hindu_desh()
class hindu_state(osv.Model):
_name="hindu.state"
_description="Define sub districts"
_columns={ 'name':fields.char('Sub District Name',size=64,required=True), 'hindu_state_id': fields.many2one('hindu.desh','District Name',select=True,required=True,ondelete="restrict") }
hindu_state()
class hindu_dist(osv.Model):
_name="hindu.dist"
_description="Define areas"
_columns={ 'name':fields.char('Area Name',size=64,required=True),
#'area_type': fields.selection(area_type_lov,'Area Type',required=True),
'hindu_state_id':fields.many2one('hindu.state','Sub District Name',size=64,required=True),
'district_id':fields.related('hindu_state_id','hindu_state_id',readonly=True,type='many2one',relation='hindu.desh',string='District Name'),
}
hindu_dist()
class hindu_data_super(osv.Model):
_name = "hindu.data.super"
_description = "Area of Registration Super"
_columns = {
'district_id' : fields.many2one('hindu.desh','District', select=True, required=True, ondelete="restrict"),
'hindu_state_id' : fields.many2one('hindu.state', 'Sub District', domain="[('hindu_state_id', '=', district_id)]", select=True, required=True),
'area_id' : fields.many2one('hindu.dist', 'Area', domain="[('hindu_state_id', '=', hindu_state_id)]", select=True, required=True),
}
hindu_data_super()
你想在** hindu.data.super **而不是many2one的many2many領域?想要設置area_id many2many?你可以請添加更多的描述與你想做的事情。這樣有人可以給你更好的解決問題的建議。 –
亞hindu.data.super我有area_id應該是many2many領域.becoz我想選擇多個項目。所以這個領域應該在很多領域。我努力了 。我得到了內疚的錯誤。如果你有助於獲得many2many域名過濾器選項,這將是偉大的 –