跳至內容
選單
此問題已被標幟
2538 瀏覽次數

Hi, in res.partner there is category_id (many2many field, related to res.partner.category)

i would like to add this field to "account.invoice.report"

This is what I have done until now but the new field does not appear in the model:

_columns = {

...

        'partner_category': fields.char('Tag', readonly=True)


def _sub_select(self):

    select_str = """

...

          cat.name as partner_category          

        """


def _from(self):

    from_str = """

...

          JOIN res_partner partner ON ai.commercial_partner_id = partner.id

            LEFT JOIN res_partner_res_partner_category_rel rel ON partner.id = rel.partner_id

               LEFT JOIN res_partner_category cat ON rel.category_id = cat.id

..."""


def _group_by(self):

    group_by_str = """

            GROUP BY ..., cat.name

        """

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
1月 24
1048
0
5月 24
1313
1
3月 22
6950
0
7月 17
2667
2
3月 25
376