Browse Source

[IMP] emc: demo data skips control

pull/58/head
robin.keunen 5 years ago
parent
commit
5e787e82ee
  1. 1
      easy_my_coop/demo/coop.xml
  2. 3
      easy_my_coop/models/coop.py
  3. 2
      easy_my_coop/tests/test_emc.py
  4. 1
      easy_my_coop/views/subscription_request_view.xml

1
easy_my_coop/demo/coop.xml

@ -118,6 +118,7 @@
<field name="ordered_parts">3</field> <field name="ordered_parts">3</field>
<field name="share_product_id" model="product.template" eval="obj(ref('product_template_share_type_2_demo')).product_variant_id.id"/> <field name="share_product_id" model="product.template" eval="obj(ref('product_template_share_type_2_demo')).product_variant_id.id"/>
<field name="lang">en_US</field> <field name="lang">en_US</field>
<field name="skip_control_ng" eval="True"/>
</record> </record>
<record id="share_line_1_demo" model="share.line"> <record id="share_line_1_demo" model="share.line">

3
easy_my_coop/models/coop.py

@ -235,8 +235,9 @@ class SubscriptionRequest(models.Model):
user_id = fields.Many2one('res.users', user_id = fields.Many2one('res.users',
string='Responsible', string='Responsible',
readonly=True) readonly=True)
# todo rename to valid_subscription_request
validated = fields.Boolean(compute='_validated_lines', validated = fields.Boolean(compute='_validated_lines',
string='Valid Line?',
string='Valid Subscription request?',
readonly=True) readonly=True)
skip_control_ng = fields.Boolean(string="Skip control", skip_control_ng = fields.Boolean(string="Skip control",
help="if this field is checked then no" help="if this field is checked then no"

2
easy_my_coop/tests/test_emc.py

@ -176,6 +176,8 @@ class EMCCase(EMCBaseCase):
def test_validated_lines_on_subscription_request(self): def test_validated_lines_on_subscription_request(self):
request = self.request request = self.request
request.skip_control_ng = False
self.assertFalse(request.skip_control_ng) self.assertFalse(request.skip_control_ng)
self.assertFalse(request.iban) self.assertFalse(request.iban)

1
easy_my_coop/views/subscription_request_view.xml

@ -57,6 +57,7 @@
<field name="email"/> <field name="email"/>
<field name="phone"/> <field name="phone"/>
<field name="contact_person_function" attrs="{'invisible':[('is_company','=',False)]}"/> <field name="contact_person_function" attrs="{'invisible':[('is_company','=',False)]}"/>
<!-- todo highlight iban if not valid -->
<field name="iban"/> <field name="iban"/>
<field name="address"/> <field name="address"/>
<field name="zip_code"/> <field name="zip_code"/>

Loading…
Cancel
Save