Hi , I wanna Extend
accountReportsWidget
to add a new function but iam not making it work, can somebody help ?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hi , I wanna Extend
accountReportsWidget
to add a new function but iam not making it work, can somebody help ?
in order to extend the accountReportsWidget class and add a new function, you will need to create a new module and include the following steps:
Create a new folder in your Odoo addons directory, and name it according to your module.
Create a new file called __init__.py in your module's folder.
Create another file called models.py in your module's folder.
In the models.py file, you will need to import the accountReportsWidget class and create a new class that inherits from it. Here's an example:
from odoo import api, fields, models
class ExtendedAccountReportsWidget(models.AbstractModel):
_inherit = 'account.reports.widget'
# Your new function here
def your_new_function(self):
# Your code here
from . import models
'models': ['extended_account_reports_widget'],
'depends': ['account_reports_widget'],
It's worth noting that you should test your customizations in a test environment before applying it to a production environment. Also, make sure that the class you are trying to extend is properly defined and that it's compatible with your version of Odoo.
Thank you , but accountReportsWidget is a js class not python one
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng ký| Bài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
|---|---|---|---|---|
|
|
1
thg 10 23
|
2435 | ||
|
|
0
thg 10 20
|
3717 | ||
|
|
0
thg 6 16
|
3739 | ||
|
|
2
thg 5 25
|
1862 | ||
|
|
0
thg 11 24
|
1659 |