Browse Source

[11.0][WIP] partner_group: Add to comercial_fields

12.0
sergio.teruel 6 years ago
committed by Sergio Teruel
parent
commit
1010908393
  1. 8
      partner_group/models/res_partner.py
  2. 5
      partner_group/readme/DESCRIPTION.rst
  3. 2
      partner_group/views/res_partner_views.xml

8
partner_group/models/res_partner.py

@ -1,6 +1,6 @@
# Copyright 2018 Tecnativa - Sergio Teruel
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import fields, models
from odoo import api, fields, models
class ResPartner(models.Model):
@ -10,3 +10,9 @@ class ResPartner(models.Model):
comodel_name='res.partner',
string='Group',
)
@api.model
def _commercial_fields(self):
res = super()._commercial_fields()
res.append('group_id')
return res

5
partner_group/readme/DESCRIPTION.rst

@ -1,2 +1,5 @@
This module extends the functionality of partner to allow group partners into
other partners, this modulo not use the parent company field.
other partners.
This module is an alternative to parent company field, as setting that field
implies other business logic that wants to be avoided here as this is only for
informative purposes.

2
partner_group/views/res_partner_views.xml

@ -22,7 +22,7 @@
<filter name="group_group" string="Group" context="{'group_by': 'group_id'}"/>
</filter>
<field name="parent_id" position="after">
<field name="group_id" operator="child_of"/>
<field name="group_id"/>
</field>
</field>
</record>

Loading…
Cancel
Save