Skip to Content
Menu
This question has been flagged
1 Reply
3354 Views

I get Errors when copying same code from v16 to V17 any know how to set this up?

Avatar
Discard
Best Answer

Hi,

Here's an example of how you can set up a post_init_hook in Odoo 17

In init.py


def create_employees(env):

    env['company.employee'].create({

        'name': 'ABC',

        'phone': '+7865 6675 2341',

        'email': 'abc123@gmail.com'

    })

and in the manifest:

    'post_init_hook': 'create_employees',


Hope it helps

Avatar
Discard