Odoo Help

2

0
2 Answers
0
Avatar

Borni DHIFI Tunisia

--Borni DHIFI--
5615
| 7 9 11
Tunis, Tunisia
--Borni DHIFI--

Techno Functional Consultant Odoo(OpenERP) 

http://www.linkedin.com/in/borni

Skype : dhifi.borni

Borni DHIFI Tunisia
5/10/13, 6:47 AM

you can add another field 'product_child_id' in sale.order.line .

'product_child_id': fields.many2one('product.product', 'Product Child',),

add the field in view sale.order . if user selected a product it load the list product_child_id of the product.

must be redefined product_id_change() function to load product_child_ids for this product .something like that:

class my_class(osv.osv):
_inherit = 'sale.order.line' 
def product_id_change(self, cr, uid, ids, pricelist, product, qty=0,
            uom=False, qty_uos=0, uos=False, name='', partner_id=False,
            lang=False, update_tax=True, date_order=False, packaging=False,
            fiscal_position=False, flag=False, context=None):

    res = super(my_class, self).product_id_change(cr, uid, ids, pricelist,
            product, qty=0,uom=False, qty_uos=0, uos=False, name='', 
            partner_id=False,lang=False, update_tax=True, date_order=False,
            packaging=False, fiscal_position=False, flag=False, context=None)

    product_pool = self.pool.get('product.product')
    product_browse= product_pool.browse(cr, uid, product)
    res['value']['product_child_id'] = product_browse.product_child_ids

    return res
   my_class()
0
Stéphane France
5/10/13, 5:34 AM

Is anyone have an idea ?

Ask a Question
Writer
Keep Informed
0 follower(s)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now