Hello everyone, i've a problem "
how to fill a field automatically ??" i have three fields Article, Lot and Market in my class , i want that the two fields Lot and Market will be filled automatically when i choose the Article (exactly like when we choose a partner ,his adress is filled automatically).
here is my class that adds those fields to the purchase order line :
Code:
class purchase_order_line(osv.osv):
_name = "purchase.order.line"
_inherit = "purchase.order.line"
_columns = {
'id_article': fields.many2one('market.articles' , 'Article', required=False),
'lot_id' : fields.many2one('market.lots', 'Lot Name'),
'market_id' : fields.many2one('market.articles', 'Market Name'),
}
and the code of my class Market look like this :
Code:
class market_markets(osv.osv):
_name = "market.markets"
_columns = {
'name' : fields.char('Market Name', size=30, required=True),
'lot_ids' : fields.one2many('market.lots', 'market_id', 'lot Name'),
}
market_markets()
class market_lots(osv.osv):
_name = "market.lots"
_columns = {
'name' : fields.char('Lot Name', size=30),
'article_ids' : fields.one2many('market.articles', 'lot_id', 'Article Name'),
}
market_lots()
class market_articles(osv.osv):
_name = "market.articles"
_columns = {
'name' : fields.char('Article Name', size=30, required=True),
}
market_articles()
Please , any ideas ???????