Browse Source

Add rules in demo data

pull/208/head
Guewen Baconnier 9 years ago
parent
commit
cc06be4808
  1. 2
      partner_changeset/__openerp__.py
  2. 60
      partner_changeset/demo/changeset_field_rule.xml
  3. 2
      partner_changeset/tests/test_changeset_field_rule.py
  4. 1
      partner_changeset/tests/test_changeset_field_type.py
  5. 1
      partner_changeset/tests/test_changeset_flow.py
  6. 1
      partner_changeset/tests/test_changeset_origin.py

2
partner_changeset/__openerp__.py

@ -34,6 +34,8 @@
'views/changeset_field_rule_views.xml',
'views/res_partner_views.xml',
],
'demo': ['demo/changeset_field_rule.xml',
],
'test': [],
'installable': True,
'auto_install': False,

60
partner_changeset/demo/changeset_field_rule.xml

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<record model="changeset.field.rule" id="changeset_field_rule_name">
<field name="model_id" ref="base.model_res_partner"/>
<field name="field_id" ref="base.field_res_partner_name"/>
<field name="action">auto</field>
</record>
<record model="changeset.field.rule" id="changeset_field_rule_street">
<field name="model_id" ref="base.model_res_partner"/>
<field name="field_id" ref="base.field_res_partner_street"/>
<field name="action">validate</field>
</record>
<record model="changeset.field.rule" id="changeset_field_rule_street2">
<field name="model_id" ref="base.model_res_partner"/>
<field name="field_id" ref="base.field_res_partner_street2"/>
<field name="action">validate</field>
</record>
<record model="changeset.field.rule" id="changeset_field_rule_zip">
<field name="model_id" ref="base.model_res_partner"/>
<field name="field_id" ref="base.field_res_partner_zip"/>
<field name="action">validate</field>
</record>
<record model="changeset.field.rule" id="changeset_field_rule_city">
<field name="model_id" ref="base.model_res_partner"/>
<field name="field_id" ref="base.field_res_partner_city"/>
<field name="action">validate</field>
</record>
<record model="changeset.field.rule" id="changeset_field_rule_email">
<field name="model_id" ref="base.model_res_partner"/>
<field name="field_id" ref="base.field_res_partner_email"/>
<field name="action">never</field>
</record>
<record model="changeset.field.rule" id="changeset_field_rule_ref">
<field name="model_id" ref="base.model_res_partner"/>
<field name="field_id" ref="base.field_res_partner_ref"/>
<field name="action">validate</field>
</record>
<record model="changeset.field.rule" id="changeset_field_rule_country_id">
<field name="model_id" ref="base.model_res_partner"/>
<field name="field_id" ref="base.field_res_partner_country_id"/>
<field name="action">validate</field>
</record>
<record model="changeset.field.rule" id="changeset_field_rule_credit_limit">
<field name="model_id" ref="base.model_res_partner"/>
<field name="field_id" ref="base.field_res_partner_credit_limit"/>
<field name="action">validate</field>
</record>
</data>
</openerp>

2
partner_changeset/tests/test_changeset_field_rule.py

@ -32,6 +32,7 @@ class TestChangesetFieldRule(common.TransactionCase):
def test_get_rules(self):
ChangesetFieldRule = self.env['changeset.field.rule']
ChangesetFieldRule.search([]).unlink()
rule1 = ChangesetFieldRule.create({
'model_id': self.partner_model_id,
'field_id': self.field_name.id,
@ -47,6 +48,7 @@ class TestChangesetFieldRule(common.TransactionCase):
def test_get_rules_cache(self):
ChangesetFieldRule = self.env['changeset.field.rule']
ChangesetFieldRule.search([]).unlink()
rule = ChangesetFieldRule.create({
'model_id': self.partner_model_id,
'field_id': self.field_name.id,

1
partner_changeset/tests/test_changeset_field_type.py

@ -29,6 +29,7 @@ class TestChangesetFieldType(ChangesetMixin, common.TransactionCase):
def _setup_rules(self):
ChangesetFieldRule = self.env['changeset.field.rule']
partner_model_id = self.env.ref('base.model_res_partner').id
ChangesetFieldRule.search([]).unlink()
fields = (('char', 'ref'),
('text', 'comment'),
('boolean', 'customer'),

1
partner_changeset/tests/test_changeset_flow.py

@ -45,6 +45,7 @@ class TestChangesetFlow(ChangesetMixin, common.TransactionCase):
def _setup_rules(self):
ChangesetFieldRule = self.env['changeset.field.rule']
ChangesetFieldRule.search([]).unlink()
partner_model_id = self.env.ref('base.model_res_partner').id
self.field_name = self.env.ref('base.field_res_partner_name')
self.field_street = self.env.ref('base.field_res_partner_street')

1
partner_changeset/tests/test_changeset_origin.py

@ -34,6 +34,7 @@ class TestChangesetOrigin(ChangesetMixin, common.TransactionCase):
def _setup_rules(self):
ChangesetFieldRule = self.env['changeset.field.rule']
ChangesetFieldRule.search([]).unlink()
partner_model_id = self.env.ref('base.model_res_partner').id
self.field_name = self.env.ref('base.field_res_partner_name')
ChangesetFieldRule.create({

Loading…
Cancel
Save