Odoo Help


how delete a Line in one2Many field ?

on 8/6/17, 10:22 AM 826 views

hello every body,

i need to unlink some lines in my one2Many field while adding news ..

i try this code:

class Devis(models.Model):
_inherit = 'sale.order'

def _onchange_price(self):
for record in self.order_line:
if record.product_id.typea == "t":

but the instruction :

do not work !

update your question with logs if any, usually this is the method we are using to delete the records using unlink() method. so please check whether it is record.product_id.type and you have the correct value "t". if the type is a many2one field then you will get the id instead of name, if selection then check the values.

Hilar AK
on 8/6/17, 11:26 PM

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/6/17, 10:22 AM
Seen: 826 times
Last updated: 8/6/17, 10:57 AM