Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
2520 Prikazi

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

        """

Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
0
jan. 24
1037
0
maj 24
1306
1
mar. 22
6949
0
jul. 17
2666
2
mar. 25
376