Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
6224 มุมมอง

i try to use odoo 14

i put  function in the data file using @api.model to create some records before start using my customer app

but i get this error ::

odoo.tools.convert.ParseError: while parsing file:/c:/users/dell/desktop/odoo14/extra_addons/tools/data/data_tool.xml:4, near
<function model="tools.tool" name="add_tooling"/>

 xml code::

<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data>
<function model="tools.tool" name="add_tooling"/>
</data>
</odoo>
อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,
If you want to run a function or perform any actions before installing a module or after installation or uninstalling a module you can use hooks. In your case you are trying to call a function after installation, do you can use post_init_hook.

This blog will help you to understand about hooks

https://www.cybrosys.com/blog/how-to-use-hooks-in-odoo-development

Regards

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ต.ค. 15
3575
1
ก.ค. 24
2262
1
เม.ย. 22
18364
0
ม.ค. 22
2433
1
มิ.ย. 24
5905