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()
|
sequence = fields.Integer()
|
||||||
area_street_ids = fields.One2many('golem.partner.area.street', 'area_id',
|
area_street_ids = fields.One2many('golem.partner.area.street', 'area_id',
|
||||||
string="street list")
|
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):
|
class ResPartner(models.Model):
|
||||||
|
@ -27,6 +27,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
<tree>
|
<tree>
|
||||||
<field name="sequence" widget="handle" />
|
<field name="sequence" widget="handle" />
|
||||||
<field name="name" />
|
<field name="name" />
|
||||||
|
<field name="parent_id"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</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="model">golem.partner.area</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form>
|
<form>
|
||||||
|
<group>
|
||||||
<group>
|
<group>
|
||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
<field name="area_street_ids">
|
<field name="area_street_ids">
|
||||||
@ -45,6 +47,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</group>
|
</group>
|
||||||
|
<group>
|
||||||
|
<field name="parent_id"/>
|
||||||
|
<field name="sub_territorie_ids" widget="many2many_tags"/>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
</form>
|
</form>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
@ -55,7 +62,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
<field name="model">golem.partner.area</field>
|
<field name="model">golem.partner.area</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<search>
|
<search>
|
||||||
<field name="name" />
|
<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>
|
</search>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user