Commit 31c4a9c8 by François C.

#2595 : Add barcode to associated member

parent 49b9ab4c
Pipeline #1981 passed with stage
in 2 minutes 11 seconds
...@@ -539,11 +539,13 @@ class CagetteMember(models.Model): ...@@ -539,11 +539,13 @@ class CagetteMember(models.Model):
'zip': post_data['zip'], 'zip': post_data['zip'],
'city': post_data['city'], 'city': post_data['city'],
'phone': format_phone_number(post_data['mobile']), # Because list view default show Phone and people mainly gives mobile 'phone': format_phone_number(post_data['mobile']), # Because list view default show Phone and people mainly gives mobile
'barcode_rule_id': settings.COOP_BARCODE_RULE_ID, 'barcode_rule_id': settings.ASSOCIATE_BARCODE_RULE_ID,
'parent_id' : post_data['parent_id'], 'parent_id' : post_data['parent_id'],
'is_associated_people': True 'is_associated_people': True
} }
associated_member_id = api.create('res.partner', associated_member) associated_member_id = api.create('res.partner', associated_member)
am = CagetteMember(associated_member_id)
res['bca'] = am.generate_base_and_barcode(post_data)
# If it's an new associated member with a new partner. Link will be made by the user in BDM/admin # If it's an new associated member with a new partner. Link will be made by the user in BDM/admin
# We add the associated member to the "associate" shift template so we can find them in Odoo # We add the associated member to the "associate" shift template so we can find them in Odoo
elif 'is_associated_people' not in post_data or 'is_associated_people' in post_data and 'parent_id' not in post_data: elif 'is_associated_people' not in post_data or 'is_associated_people' in post_data and 'parent_id' not in post_data:
......
...@@ -69,6 +69,8 @@ ...@@ -69,6 +69,8 @@
- COOP_BARCODE_RULE_ID = 11 - COOP_BARCODE_RULE_ID = 11
- ASSOCIATE_BARCODE_RULE_ID = 12
- FUNDRAISING_CAT_ID = 1 - FUNDRAISING_CAT_ID = 1
- PARTS_PRICE_UNIT = 10.0 - PARTS_PRICE_UNIT = 10.0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment