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

I am trying to add new field into \account.invoice.report pivot table. Sadly whatever i do i cant see the field i am trying to add.

Some context information: I have added sale_order_id field into account.move model and eshop_order boolean field into sale.order which indicates whether order originated in eshop.

eshop_order is the field i am trying to add into pivot table

This is my code:

from odoo import models, fields

class AccountInvoiceReportInherited(models.Model):
_inherit = 'account.invoice.report'

eshop_order = fields.Boolean('sale_order_id.eshop_order', string="Eshop Order", readonly=True)

_depends = {'account.move': ['sale_order_id'],
'sale.order' : ['eshop_order']}

def _select(self):
return super(AccountInvoiceReportInherited, self)._select() + ", sub.eshop_order as eshop_order"

def _sub_select(self):
return super(AccountInvoiceReportInherited, self)._sub_select() + ", ai.eshop_order as eshop_order"

def _group_by(self):
return super(AccountInvoiceReportInherited, self)._group_by() + ", ai.eshop_order"

I could not find any documentation or You Tube videos (except one which did not help)

Any help will be appreciated.
อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi Petr,

you can take a look at this module:

https://apps.odoo.com/apps/modules/12.0/web_pivot_computed_measure/

It does add a new field to the pivot.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

You can try refer the following blog for adding new fields to the existing pivot reports.

https://www.cybrosys.com/blog/inheriting-existing-pivot-reports-in-odoo

Regards

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
มิ.ย. 24
8155
1
พ.ค. 23
6301
1
พ.ค. 23
7584
2
มิ.ย. 25
1404
0
พ.ค. 25
12