itpp-labs / odoo-development

Usefull information for odoo developers. Published at odoo-development.readthedocs.io
https://odoo-development.readthedocs.io/
GNU Affero General Public License v3.0
139 stars 171 forks source link

There are no @api.one and @api.multi in Odoo13. #221

Closed pengz1234 closed 4 years ago

pengz1234 commented 4 years ago

I am tring to create a one2one relation.But,I open api.py and find there are no one and multi functions in it,maybe Odoo13 has removed them. How can I make a one2one relation?

yelizariev commented 4 years ago

Hi!

@api.multi is used by default. So, you need to rewrite the methods from api.one to api.multi

If you figure it out, please send a pull request with page update: https://github.com/itpp-labs/odoo-development/blob/master/docs/dev/py/one2one.rst

pengz1234 commented 4 years ago

Finally, I use Many2one to replace one2one. Thanks a lot.