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>
|
||||
@ -38,12 +39,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="area_street_ids">
|
||||
<tree editable="bottom">
|
||||
<field name="name"/>
|
||||
</tree>
|
||||
</field>
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="area_street_ids">
|
||||
<tree editable="bottom">
|
||||
<field name="name"/>
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
<group>
|
||||
<field name="parent_id"/>
|
||||
<field name="sub_territorie_ids" widget="many2many_tags"/>
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
@ -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="arch" type="xml">
|
||||
<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>
|
||||
</field>
|
||||
</record>
|
||||
|
Loading…
Reference in New Issue
Block a user