Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
2146 Представления

I can't find the def _get_report_values() for the report  "stock.report_delivery_document." 


wanted to inherit  the model and add my custom fields to customize the report but I tried inheriting: "report.stock.stock_rule", "report.stock.report_reception" and  "report.stock.label_product_product_view" models and adding a log in my terminal but it doesn't call my overridden model. 


My /models dir has an __init__ as well as the main dir. So it does call the inherit  i created.


This is how i inherit the models i have mentioned:

class StockReport(models.AbstractModel):

    _inherit = 'report.stock.report_reception'


    def _get_report_values(self, docids, data=None):

        res = super(StockReport, self)._get_report_values(docids, data)

        print('INFO: THIS IS THE INHERITED REPORT')

       

        # return res


Can someone help me please? Thank you

Аватар
Отменить
Лучший ответ

Hi,


Try this code :


from odoo import models, api

class StockReport(models.AbstractModel):

    _inherit = 'report.stock.report_reception'


    @api.model

    def _get_report_values(self, docids, data=None):

        res = super(StockReport, self)._get_report_values(docids, data)

        print('INFO: THIS IS THE INHERITED REPORT')

        return res


Hope it helps

Аватар
Отменить
Related Posts Ответы Просмотры Активность
0
нояб. 23
1954
0
нояб. 23
1478
1
нояб. 24
3991
1
февр. 24
1817
1
дек. 23
1929