From de48c88628a66c4560a1004d25a451ec223b846f Mon Sep 17 00:00:00 2001 From: "sergio.teruel" Date: Thu, 27 Sep 2018 14:03:23 +0200 Subject: [PATCH] [11.0][WIP] partner_group: Add to comercial_fields --- partner_group/models/res_partner.py | 8 +++++++- partner_group/readme/DESCRIPTION.rst | 5 ++++- partner_group/views/res_partner_views.xml | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/partner_group/models/res_partner.py b/partner_group/models/res_partner.py index d2b41983f..a0583f5c8 100755 --- a/partner_group/models/res_partner.py +++ b/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 diff --git a/partner_group/readme/DESCRIPTION.rst b/partner_group/readme/DESCRIPTION.rst index fc89def5b..e767bb3b9 100644 --- a/partner_group/readme/DESCRIPTION.rst +++ b/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. diff --git a/partner_group/views/res_partner_views.xml b/partner_group/views/res_partner_views.xml index ba4a775a4..d39e2365c 100755 --- a/partner_group/views/res_partner_views.xml +++ b/partner_group/views/res_partner_views.xml @@ -22,7 +22,7 @@ - +