Odoo Ajuda

0

0
2 Respostas
1
Jigar Patel (jat)
01/07/19 05:47

Actually, Odoo automatically apply sequence on ID field. This is done by _sequence attribute on model and it's apply on 'ID' field here https://github.com/odoo/odoo/blob/12.0/odoo/models.py#L3630

If you check your table in Postgresql then ID column have description like id integer NOT NULL DEFAULT nextval('model_name_id_seq'::regclass). Here, nextval will execute sequence which will auto increment index.

You can read in detail what is exact nextval function? https://www.postgresql.org/docs/current/sql-createsequence.html

You can use _sequence attribute on model to change sequence field.

0
Nikunja Maharana Índia
01/07/19 20:50

Thank you Jigar Patel

Faça uma Pergunta
Marcadores
Keep Informed
1 seguidor (es)
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