forked from Yaltik/golem
Code refactoring and improvement
This commit is contained in:
parent
2eda76a20d
commit
35c54abc15
@ -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):
|
||||
|
@ -27,6 +27,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
<tree>
|
||||
<field name="sequence" widget="handle" />
|
||||
<field name="name" />
|
||||
<field name="parent_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@ -37,6 +38,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
<field name="model">golem.partner.area</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<group>
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="area_street_ids">
|
||||
@ -45,6 +47,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
<group>
|
||||
<field name="parent_id"/>
|
||||
<field name="sub_territorie_ids" widget="many2many_tags"/>
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
@ -56,6 +63,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<field name="name"/>
|
||||
<field name="parent_id"/>
|
||||
<filter name="sub_territories" string="Sub Territories"
|
||||
domain="[('parent_id', '!=', False)]"/>
|
||||
<filter name="parent_territories" string="Parent Territories"
|
||||
domain="[('sub_territorie_ids', '!=', False)]"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
Loading…
Reference in New Issue
Block a user