Odoo Help


How to clear the values of "many2many" field odoo 10?

on 8/21/17, 12:46 AM 936 views

I need to clear "many2many" fields value, So i tried these code but it does not empty the field

My Code:

            purchase_id = fields.Many2many(


                        string='Purchase Order',



                        help='Associated Purchase Order. Filled in automatically when a PO is chosen on the vendor bill.'



            def _onchage_purchase(self):

            self.purchase_id = [6, 0, []] 

I tried like this, but it doesn't works.. Please, can anyone help me to resolve this.


Avinash Nk

--Avinash Nk--

| 4 3 6
Calicut, India
--Avinash Nk--


Avinash Nk
On 8/21/17, 12:50 AM


Check this link : https://www.odoo.com/forum/help-1/question/removing-elements-from-many2many-field-122928

I referred and tried the methods given from this link.. But still i can't get the result

on 8/21/17, 1:02 AM

Check if the onchange function is being called by just putting a print .

if try this :

self.purchase_id = [(6, 0, [])]

Aslam Up
on 8/21/17, 2:00 AM

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.


Odoo Training Center

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

Test it now

Question tools

1 follower(s)


Asked: 8/21/17, 12:46 AM
Seen: 936 times
Last updated: 8/21/17, 12:50 AM