From 35c54abc15af6b0a9f38c2d46d2c6fcbce0d131e Mon Sep 17 00:00:00 2001 From: youssef Date: Fri, 12 Oct 2018 01:48:10 +0100 Subject: [PATCH] Code refactoring and improvement --- golem_member/models/golem_member.py | 4 +++ .../views/golem_partner_area_views.xml | 26 ++++++++++++++----- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/golem_member/models/golem_member.py b/golem_member/models/golem_member.py index 36f4561..7f1daca 100644 --- a/golem_member/models/golem_member.py +++ b/golem_member/models/golem_member.py @@ -36,6 +36,10 @@ class PartnerArea(models.Model): sequence = fields.Integer() area_street_ids = fields.One2many('golem.partner.area.street', 'area_id', string="street list") + parent_id = fields.Many2one('golem.partner.area', string="Parent Territory", + domain="[('id', '!=', id)]") + sub_territorie_ids = fields.One2many('golem.partner.area', 'parent_id', + string="Sub Territories List") class ResPartner(models.Model): diff --git a/golem_member/views/golem_partner_area_views.xml b/golem_member/views/golem_partner_area_views.xml index efdf406..dbf498b 100644 --- a/golem_member/views/golem_partner_area_views.xml +++ b/golem_member/views/golem_partner_area_views.xml @@ -27,6 +27,7 @@ along with this program. If not, see . + @@ -38,12 +39,18 @@ along with this program. If not, see .
- - - - - - + + + + + + + + + + + +
@@ -55,7 +62,12 @@ along with this program. If not, see . golem.partner.area - + + + +